int main() {
  char string[10];
  int A = -73;
  unsigned int B = 31337;
  strcpy(string, "sample");
  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("[string] %s Address of %08x\n", string, string);
  printf("variable A is at the 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    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa(%rbp),%rsi
lea    -0xa(%rbp),%rdx
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef4(%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>:
sub    $0x18,%rsp
movl   $0xffffffb7,0x8(%rsp)
ff
movl   $0x706d6173,0xc(%rsp)
70
movl   $0x656c70,0xf(%rsp)
lea    0xed4(%rip),%rdi
mov    $0xffffffb7,%esi
mov    $0xffffffb7,%edx
mov    $0xffffffb7,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sample\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 = [48 x i8] c"[field width on B] 3: '%3u', 10: '%10u, '%08u'\0A\00"
@.str.4 = [29 x i8] c"[string] %s Address of %08x\0A\00"
@.str.5 = [36 x i8] c"variable A is at the 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 ([7 x i8], [7 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 ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %18, i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sample\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 = [48 x i8] c"[field width on B] 3: '%3u', 10: '%10u, '%08u'\0A\00"
@.str.4 = [29 x i8] c"[string] %s Address of %08x\0A\00"
@.str.5 = [36 x i8] c"variable A is at the address: %08x\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 -73, i32* %2
%5 = 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)
%6 = 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)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 31337, i32 31337, i32 31337)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32* %2)
ret i32 0
}