#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 *, ...);
int main(int argc, char **argv) {
  char c = 'x';
  printf("This is a test\n");
  printf("This is a char: [%c]\n", c);
  printf("This is an int: [%d]\n", -12345);
  printf("This is an int: [%i]\n", 12345);
  printf("This is an octal int: [0%o]\n", 01234567);
  printf("This is an unsigned int: [%u]\n", -1);
  printf("This is a hex int: [0x%x]\n", 0xdead);
  printf("This is a HEX int: [0X%X]\n", 0xBEEF);
  printf("This is a string: [%s]\n", "Cheese");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x78,-0x11(%rbp)
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x11(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0xffffcfc7,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x3039,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x53977,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0xdead,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0xbeef,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    0xf12(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfab(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x78,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0xffffcfc7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x3039,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x53977,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0xdead,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0xbeef,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
lea    0xf0c(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"This is a test\0A\00"
@.str.1 = [22 x i8] c"This is a char: [%c]\0A\00"
@.str.2 = [22 x i8] c"This is an int: [%d]\0A\00"
@.str.3 = [22 x i8] c"This is an int: [%i]\0A\00"
@.str.4 = [29 x i8] c"This is an octal int: [0%o]\0A\00"
@.str.5 = [31 x i8] c"This is an unsigned int: [%u]\0A\00"
@.str.6 = [27 x i8] c"This is a hex int: [0x%x]\0A\00"
@.str.7 = [27 x i8] c"This is a HEX int: [0X%X]\0A\00"
@.str.8 = [24 x i8] c"This is a string: [%s]\0A\00"
@.str.9 = [7 x i8] c"Cheese\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 120, i8* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 -12345)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 12345)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 342391)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 -1)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 57005)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 48879)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"This is a char: [%c]\0A\00"
@.str.2 = [22 x i8] c"This is an int: [%d]\0A\00"
@.str.3 = [22 x i8] c"This is an int: [%i]\0A\00"
@.str.4 = [29 x i8] c"This is an octal int: [0%o]\0A\00"
@.str.5 = [31 x i8] c"This is an unsigned int: [%u]\0A\00"
@.str.6 = [27 x i8] c"This is a hex int: [0x%x]\0A\00"
@.str.7 = [27 x i8] c"This is a HEX int: [0X%X]\0A\00"
@.str.8 = [24 x i8] c"This is a string: [%s]\0A\00"
@.str.9 = [7 x i8] c"Cheese\00"
@str = [15 x i8] c"This is a test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 120)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 -12345)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 12345)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 342391)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 -1)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 57005)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 48879)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}