list.c lines 19 to 26 of 42 19 struct node * prev = NULL ; 20 while ( head ) { 21 struct node * next = head - > next ; 22 head - > next = prev ; 23 prev = head ; 24 head = next ; 25 } 26 return prev ; disassembly reverse 10019 10 20 test rdi, rdi 10019 13 je 1001935 10019 15 push rbp 10019 16 mov rbp, rsp 10019 19 xor eax, eax 10019 1b nop dword ptr [rax + rax] 10019 20 mov rcx, rax rcx 28b410b0 1 10019 23 mov rax, rdi rax 28b41090 4 10019 26 21 mov rdi, qword ptr [rdi + 8] 28b41098 28b41070 9 10019 2a 22 mov qword ptr [rax + 8], rcx 10019 2e 20 test rdi, rdi 10019 31 jne 1001920 taken 10019 33 pop rbp 10019 34 26 ret 10019 35 xor eax, eax 10019 37 ret 1001938 endbr64 _init registers stack heap code data rwx read-only rax 28b41090 4 rbx 0 rcx 28b410b0 1 rdx 0 rsi 28b410c0 0 rdi 28b41090 4 rbp 7ffe970f17b0 7ffe970f17d0 7ffe970f1880 7ffe970f18e0 0 rsp 7ffe970f17b0 7ffe970f17d0 7ffe970f1880 7ffe970f18e0 0 r8 7f2ba3019ac0 0 r9 0x20 32 r10 0x10 16 r11 7f2ba3019ac8 28b410c0 0 r12 7ffe970f1908 7ffe970f2fce "zig-out/targets/list" r13 1 r14 7f2ba32ac000 7f2ba32ad3c0 0 r15 10029c0 1 rip 1001926 reverse+22 cf PF af zf sf IF df of stack eight words from rsp · the frames they belong to rsp rbp 7ffe970f17 b0 7ffe970f17d0 7ffe970f1880 7ffe970f17 b8 10018b0 main+80 7ffe970f17 c0 7f2ba3020de8 7ffe970f1918 7ffe970f17 c8 0 7ffe970f17 d0 7ffe970f1880 7ffe970f18e0 0 7ffe970f17 d8 7f2ba2e27781 libc+27781 7ffe970f17 e0 7f2ba328fc60 ld.so+22c60 7ffe970f17 e8 7ffe970f1908 7ffe970f2fce "zig-ou… reverse main libc+27781 the list its bytes value next malloc's never read the heap, 28b41070 to 28b410bf 28b410 70 09 00 00 00 00 00 00 00 50 10 b4 28 00 00 00 00 9 28b41050 28b410 80 21 00 00 00 00 00 00 00 malloc's: a chunk of 32 28b410 90 04 00 00 00 00 00 00 00 70 10 b4 28 00 00 00 00 4 28b41070 28b410 a0 21 00 00 00 00 00 00 00 malloc's: a chunk of 32 28b410 b0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1 NULL 28b410b0 1 rcx 28b41090 4 rax rdi 28b41070 9 28b41050 16 28b41030 25 28b41010 36 moment 71 of 95 Stopped in reverse, about to load head->next. rdi points at a node; the word after its value is the next node.