Explain Assembly code
Paste assembly from a debugger or Compiler Explorer and Vibe explains it in plain English: which register holds which C variable, how subs and b.ne make a loop, and what changes between -O0, -O1 and -O2.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe25 lines selected
Press Explain it for the sample, or paste your own code first.
What this Assembly sample shows
- registers and arguments
- The C names are gone, and registers hold the values. Arm's calling convention, the AAPCS64, passes the first 8 integer and pointer arguments in
x0tox7and returns the result inx0, sonumsarrives inx0,countinw1, andmov x0, x8hands back the total.w1is the low 32 bits ofx1, the size of anint. A caller built the same way put the array's address inx0and 4 inw1, then jumped to_sum. - compare and branch
cmp w1, #1andb.lt LBB0_4skip the loop whencountis less than 1, and LBB0_4 returns 0. The loop is the 4 instructions after LBB0_2:ldr w10, [x0], #4loads one int and movesx04 bytes on to the next one,addadds it to the total inw8,substakes 1 off a copy ofcountinx9, andb.nejumps back until that copy reaches 0. No register countsiup: the compiler counts down instead.- -O0 and -O1
- At
-O0the same function was 25 instructions, with a loop of 16. It keptnums,count,totalandiin memory on the stack and loaded them again on every pass: 13 of its instructions read or write[sp, ...]. At-O1it was 13 instructions with a loop of 4, and none of them touched the stack. - arm64 and x86-64
- The same C built for x86-64 Linux is a different instruction set:
testlandjleinstead ofcmpandb.lt,numsinrdiandcountinesi, and a loop that adds straight from memory with oneaddl (%rdi,%rdx,4), %eax. Every arm64 instruction took 4 bytes, and the x86-64 ones took 1 to 6. Linked with a testmainand run, it returned 16 for 3, 5, -2 and 10, 0 for a count of 0 or -3, and 703 for the numbers 1 to 37.
Good to know
- Built with clang 22.1.8 on Linux.
clang --target=arm64-apple-macos -O1 -Swrites assembly text instead of building a program, so no Mac was needed. The sample is the_sumfunction from that output with the C added as;comments. Left out:.p2align 2,.cfi_startproc,.cfi_endproc, 3; %bb.N:block comments and the output's first 2 and last 2 lines. The trimmed text still assembled to the same 13 instructions, byte for byte. The arm64 code wasn't run: the results come from x86-64 builds of the same C, run on Linux. - At
-O2the function grew to 62 instructions and 3 loops. The main loop loads 4 128-bitqregisters per pass, adds them withadd.4sand counts down by 16, so it takes 16 ints at a time. A second loop takes 4 at a time, and the-O1loop is left for the last few. The x86-64-O2build still returned the same 4 results. - Apple's guide Writing ARM64 code for Apple platforms (developer.apple.com) says macOS follows the 64-bit Arm standard apart from a few listed differences, such as
x18being reserved. None of them changes the registers used here.
Watch out: The function you're looking for may not be in the assembly at all. With sum and a main that calls it in one file, -O1 turned main into 2 instructions, mov w0, #16 and ret: the compiler worked out the total of 3, 5, -2 and 10 itself, and nothing calls sum, though it is still in the file. In the x86-64 build, a gdb breakpoint on sum never stopped, and the program exited with 16. At -O0, main calls sum.
Explain Assembly code beside your editor
Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).
Install on Mac
curl -fsSL https://unvibe.site/install.sh | bashPaste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.
Or download the .dmg · Intel Mac build · SHA-256 checksums
Opening the .dmg the first time
- Open the .dmg and drag Unvibe to Applications.
- Open it once; macOS says it can't verify it. Click Done.

Real screen, macOS 15 - System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.

Real screen, macOS 15
The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open