#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
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 %p\n", string, (void *)string);
  printf("variable A is at address: %p\n", (void *)&A);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffb7,-0x14(%rbp)
movl   $0x7a69,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
movslq -0x14(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%esi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    -0xe(%rbp),%rdx
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x14(%rbp),%rsi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xffffffb7,(%rsp)
lea    0xecd(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec0(%rip),%rdi
mov    $0xffffffffffffffb7,%rsi
mov    $0xffffffb7,%edx
mov    $0xffffffb7,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x7a69,%esi
mov    $0x7a69,%edx
mov    $0x7a69,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
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 = [49 x i8] c"[field width on B] 3: '%3u', 10: '%10u', '%08u'\0A\00"
@.str.4 = [24 x i8] c"[string] %s Address %p\0A\00"
@.str.5 = [30 x i8] c"variable A is at address: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 -73, i32* %3
store i32 31337, i32* %4
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = load i32, i32* %4
%17 = load i32, i32* %4
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %15, i32 %16, i32 %17)
%19 = load i32, i32* %4
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
%22 = load i32, i32* %4
%23 = load i32, i32* %4
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i8* %21, i32 %22, i32 %23)
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%27 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %25, i8* %26)
%28 = bitcast i32* %3 to i8*
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %28)
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 = [49 x i8] c"[field width on B] 3: '%3u', 10: '%10u', '%08u'\0A\00"
@.str.4 = [24 x i8] c"[string] %s Address %p\0A\00"
@.str.5 = [30 x i8] c"variable A is at address: %p\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 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 -73 to i8*), i32 -73, i32 -73)
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* inttoptr (i64 31337 to i8*), i32 31337, i32 31337)
%8 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i8* inttoptr (i64 31337 to i8*), i32 31337, i32 31337)
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %3)
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %4)
ret i32 0
}