int main() {
  char string[10];
  int A = -73;
  unsigned int B = 31337;
  strcpy(string, "example");
  printf("[A] Dec: %d, Hex: %x, Unsigned: %u\n", A, A, A);
  printf("[B] Dec: %d, Hex: %x, Unsigned: %u\n", B, B, B);
  printf("[field width on B] 3: '%3u', 10: '%10u', '%08u'\n", B, B, B);
  printf("variable A is at address: %08x\n", &A);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xffffffb7,-0x10(%rbp)
movl   $0x7a69,-0x14(%rbp)
lea    -0xa(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xffffffb7,0x4(%rsp)
ff
lea    0xee0(%rip),%rdi
mov    $0xffffffb7,%esi
mov    $0xffffffb7,%edx
mov    $0xffffffb7,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"example\00"
@.str.1 = [36 x i8] c"[A] Dec: %d, Hex: %x, Unsigned: %u\0A\00"
@.str.2 = [36 x i8] c"[B] Dec: %d, Hex: %x, Unsigned: %u\0A\00"
@.str.3 = [49 x i8] c"[field width on B] 3: '%3u', 10: '%10u', '%08u'\0A\00"
@.str.4 = [32 x i8] c"variable A is at address: %08x\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
store i32 -73, i32* %2
store i32 31337, i32* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i8* @strcpy(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"[A] Dec: %d, Hex: %x, Unsigned: %u\0A\00"
@.str.2 = [36 x i8] c"[B] Dec: %d, Hex: %x, Unsigned: %u\0A\00"
@.str.3 = [49 x i8] c"[field width on B] 3: '%3u', 10: '%10u', '%08u'\0A\00"
@.str.4 = [32 x i8] c"variable A is at address: %08x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -73, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 -73, i32 -73, i32 -73)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 31337, i32 31337, i32 31337)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 31337, i32 31337, i32 31337)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32* %1)
ret i32 0
}