> 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/8.5/user-guide/disassembler/disassembly-gallery/atmel-avr-disassembler.md).

# ATMEL AVR Disassembler

Assembler code

```
.text:0000003B
.text:0000003B ; =============== S U B R O U T I N E =======================================
.text:0000003B
.text:0000003B
.text:0000003B                 ; public qsort
.text:0000003B qsort:                                  ; CODE XREF: sub_41+1DE↓p
.text:0000003B                 ldi     r26, 0xA
.text:0000003C                 ldi     r27, 0
.text:0000003D                 ldi     r30, (sub_41 & 0xFF)
.text:0000003E                 ldi     r31, (sub_41 >> 8)
.text:0000003F                 jmp     __prologue_saves__
.text:0000003F ; End of function qsort
.text:0000003F
.text:00000041
.text:00000041 ; =============== S U B R O U T I N E =======================================
.text:00000041
.text:00000041
.text:00000041 sub_41:                                 ; DATA XREF: qsort+2↑o
.text:00000041                                         ; qsort+3↑o
.text:00000041                 movw    r4, r24
.text:00000042                 movw    r8, r22
.text:00000043                 movw    r6, r20
.text:00000044                 movw    r2, r18
.text:00000045                 std     Y+5, r20
.text:00000046                 std     Y+6, r7
.text:00000047                 clr     r18
.text:00000048                 clr     r19
.text:00000049                 sub     r18, r20
.text:0000004A                 sbc     r19, r21
.text:0000004B                 std     Y+8, r19
.text:0000004C                 std     Y+7, r18
.text:0000004D
.text:0000004D loc_4D:                                 ; CODE XREF: sub_41+1EB↓j
.text:0000004D                 ldi     r19, 7
.text:0000004E                 cp      r8, r19
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/8.5/user-guide/disassembler/disassembly-gallery/atmel-avr-disassembler.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
