> 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_userdefinedcall.md).

# hx\_UserDefinedCall

## Description

Decompile as call. This commands configures a function call the current instruction should be replaced by in the pseudocode output.

Special names can be used to access operands of the current instructions: \_\_OP1, \_\_OP2, ... for first, second, etc. operands. Each function argument having a name like that will be replaced in the call by the value of the corresponding operand of the instruction. Also if the function name has this format, a call to the location pointed by the corresponding operand will be generated. Other arguments and the return value will be placed into locations derived from the function prototype according to the current compiler, calling convention, argument and return types. You can use IDA-specific *\_\_usercall* calling convention to specify arbitrary locations independently of platform and argument/return types (read IDA help pages about the user defined calling conventions for more info).

**Examples**

* We could ask to replace the following instruction: `out 2b, ax` by specifying the following prototype: `void OUT(unsigned int8 __OP1, int16 __OP2)` which would lead to the following decompiler output: `OUT(0x2b, v1);` where v1 is mapped to ax.
* The following prototype: `int __usercall syscall@<R0;>(int code@<R12;>, void *a1@<R0;>, void *a2@<R1;>)` applied to the second instruction in the following piece of code: `mov r12, #0x148` `svc 0x801` will generate the following pseudocode: `v3 = syscall(328, v1, v2);` where v1, v2, v3 are mapped to R0, R1, R2 respectively.


---

# 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_userdefinedcall.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.
