> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/ida-9.3/ida-actions/hx_genpseudo.md).

# hx\_GenPseudo

## Description

This command decompiles the current function. If the decompilation is successful, it opens a new window titled **"Pseudocode"** and places the generated C text in this window.

The following commands can be used in the pseudocode window:

* [Rename](/ida-9.3/ida-actions/hx_rename.md)
* [Set type](/ida-9.3/ida-actions/hx_settype.md)
* [Set number representation](/ida-9.3/ida-actions/hx_hexdec.md)
* [Edit indented comment](/ida-9.3/ida-actions/hx_editcmt.md)
* [Edit block comment](/ida-9.3/ida-actions/hx_editblockcmt.md)
* [Stock comments](/ida-9.3/ida-actions/hx_stockcomments.md)
* [Show all call decompilations](https://github.com/HexRaysSA/ida-docs/blob/9.3/ida-actions/hx_/README.md)
* [Show all xref decompilations](https://github.com/HexRaysSA/ida-docs/blob/9.3/ida-actions/cmd_xref_decomp.md)
* [Hide](/ida-9.3/ida-actions/hx_collapsedecls.md) / [Unhide](/ida-9.3/ida-actions/hx_expanddecls.md)statements
* [Split](/ida-9.3/ida-actions/hx_splitexpr.md) / [Unsplit](/ida-9.3/ida-actions/hx_unsplitexpr.md) expression
* [Force call type](/ida-9.3/ida-actions/hx_forcecalltype.md)
* [Set call type](/ida-9.3/ida-actions/hx_setcalltype.md)
* [Add](/ida-9.3/ida-actions/hx_addvararg.md) / [Del](/ida-9.3/ida-actions/hx_delvararg.md) variadic arguments
* [Del function argument](/ida-9.3/ida-actions/hx_removearg.md)
* [Add/delete function return type](/ida-9.3/ida-actions/hx_addremovereturn.md)
* [Jump to cross reference](/ida-9.3/ida-actions/hx_jmpxref.md)
* [Jump to cross reference globally](/ida-9.3/ida-actions/hx_jumpglobalxref.md)
* [Generate HTML file](/ida-9.3/ida-actions/hx_genhtml.md)
* [Mark](/ida-9.3/ida-actions/hx_markdecompiled.md) / [Unmark](/ida-9.3/ida-actions/hx_unmarkdecompiled.md) as decompiled
* [Copy to assembly](/ida-9.3/ida-actions/hx_copy2asm.md)
* [Show/hide casts](/ida-9.3/ida-actions/hx_toggleshowcasts.md)

If the current item is a local variable, additional items may appear in the context menu:

* [Reset pointer type](/ida-9.3/ida-actions/hx_resetptrtype.md)
* [Convert to struct \*](/ida-9.3/ida-actions/hx_cvt2strucptr.md)
* [Create new struct type](/ida-9.3/ida-actions/hx_newstruc.md)
* [Map to another variable](/ida-9.3/ida-actions/hx_map2othervar.md)
* [Unmap variable(s)](/ida-9.3/ida-actions/hx_map2othervar.md)
* [Split variable](/ida-9.3/ida-actions/hx_splitvar.md)
* [Unsplit variable](/ida-9.3/ida-actions/hx_unsplitvar.md)
* [Forbid assignment propagation](/ida-9.3/ida-actions/hx_nopropvar.md)

If the current item is a union field, an additional item may appear in the context menu:

* [Select union field](/ida-9.3/ida-actions/hx_selunionfield.md)

If the current item is a parenthesis, bracket, or a curly brace, the following hotkey is available:

* [Jump to paired paren](/ida-9.3/ida-actions/hx_jumpnextparen.md)

The user can also select text and copy it to the clipboard with the **Ctrl-C** combination.

If the current item is C statement keyword, an additional item may appear in the context menu:

* [Collapse/uncollapse item](/ida-9.3/ida-actions/hx_collapseitem.md)

The user can also select text and copy it to the clipboard with the **Ctrl-C** combination.

Pressing <kbd>Enter</kbd> on a function name will decompile it. Pressing <kbd>Esc</kbd> will return to the previously decompiled function. If there is no previously decompiled function, the pseudocode window will be closed.

**Ctrl-Enter** or **Ctrl-double click** on a function name will open a new pseudocode window for it.

Pressing <kbd>F5</kbd> while staying in a pseudocode window will refresh its contents. Please note that the decompiler never refreshes pseudocode by itself because it can take really long.

The user can use the mouse right click or keyboard hotkeys to access the commands.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hex-rays.com/ida-9.3/ida-actions/hx_genpseudo.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
