Skip to content

Instantly share code, notes, and snippets.

Created Jun 14, 2020
What would you like to do?
#include <stdio.h>
int main(int argc, char **argv) {
for (int i = 0; i < 4; i++) {
int j = i;
printf("&i = %p, &j = %p\n", &i, &j);
return 0;
.file "main.c"
.intel_syntax noprefix
.section .rodata
.string "&i = %p, &j = %p\n"
.globl main
.type main, @function
push rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
mov rbp, rsp
.cfi_def_cfa_register 6
sub rsp, 32
mov DWORD PTR -20[rbp], edi
mov QWORD PTR -32[rbp], rsi
mov DWORD PTR -4[rbp], 0
jmp .L2
mov eax, DWORD PTR -4[rbp]
mov DWORD PTR -8[rbp], eax
lea rdx, -8[rbp]
lea rax, -4[rbp]
mov rsi, rax
lea rdi, .LC0[rip]
mov eax, 0
call printf@PLT
mov eax, DWORD PTR -4[rbp]
add eax, 1
mov DWORD PTR -4[rbp], eax
mov eax, DWORD PTR -4[rbp]
cmp eax, 3
jle .L3
mov eax, 0
.cfi_def_cfa 7, 8
.size main, .-main
.ident "GCC: (Debian 8.3.0-6) 8.3.0"
.section .note.GNU-stack,"",@progbits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment