> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/callable/callable.instructions_recursive.md).

# Callable.instructions\_recursive()

`instructions_recursive() ->` [`APISet`](/glider-ide/api/iterables/apiset.md)`[`[`Instruction`](/glider-ide/api/instruction.md)`]`

The function is the ***recursive*****/*****inter-procedural*** variant of the [`instructions()`](/glider-ide/api/callable/callable.instructions.md), meaning that it works recursively. It returns a set of Instructions object representing all the instructions which are reachable from the target function, the differences between `instructions_recursive()` and `instructions()` the latter will only return instructions directly accessible from the function. At the same time, the recursive version will find all the instructions recursively, which are eventually called when executing the function.

Also, note that the return types of `instructions_recursive() -> APISet[Instruction]` and `instructions() -> Instructions` are different, the recursive version returns an APISet of Instruction objects, while the original one returns Instructions (queryable) object.

## Query Example

```python
from glider import *

def query():
    # Let's find a function with name transferFrom
    functions = Functions().with_name('transferOwnership').exec(1)

    # Print the code of the function
    print(functions[0].source_code())

    # Return the list of (recursive) instructions, as it return a set, we need to cast it to list
    return list(functions[0].instructions_recursive().exec(10))

```

For the function:

```solidity
function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }
```

The output is:

## Example Output

<figure><img src="/files/gAKLr3K5avGDSgwPiiJl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lf8jDeCsQvh0ODF3hG22" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/fTX0SdUjiocnUBKYr74U" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tvxQaU4CxNTOOszMnAIR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Uu0DXiXHQJPUN8CszxoA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7d2vWTFRtp9vUCPb19h1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/E64b1jUtw4QfYXbXR5fv" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/VZHl9Hck6b9co8SWUbdv" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/xcaXj7Wg3Lwdb5vgh6sB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0Er5Is9a1IehaeJO6idl" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/gi3awJzh5s02ZRjWRvQu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/hSnD0RQ6L7Qk04SuMx5J" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/rUzweW6U0s2iVEtclpOH" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/aWeap56jtqoWcEW14rbd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0mM3lsEDYkJzvBNYTW2V" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3YxJ4T8y2nNBOi7j5hhJ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5Rm7qzAwISAkF5FmouzJ" alt=""><figcaption></figcaption></figure>
