#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 atan(double);
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("2+2=%d\n", 2 + 2);
  char c = -129;
  char c1 = 128;
  printf("%d,%d,%d,%u\n", -0, c, c1, -37);
  int n = 108;
  printf("%d decimal = %o octal = %x hex = %X hex\n", n, n, n, n);
  n = 1;
  printf("There %s %d item%s in the list.\n", n != 1 ? "are" : "is", n,
         n != 1 ? "s" : "");
  n = 37;
  printf("There %s %d item%s in the list.\n", n != 1 ? "are" : "is", n,
         n != 1 ? "s" : "");
  char *cp = "";
  printf("'%s'", cp);
  char *s = "%s";
  printf(s, s);
  printf("\nThe decimal equivalent of '%c' is %d\n", '*', '*');
  printf("Pi = %g\n", 4 * atan(1.0));
  printf("%g %g %g %g %g %g\n", 1 / 1.0, 1 / 2.0, 1 / 3.0, 4 / 3.0, 1 / 4.0,
         0.0);
  printf("%g\n", 123456789.0);
  printf("%g %g %g\n", 3.14159e-3, 3.14159e-4, 3.14159e-5);
  printf("%e\n", 3.141593e+00);
  printf("%f\n", 1e38);
  printf("%E %G", 3.1415926573184, 3.1415926573184);
  printf("\n%%d prints a decimal value %D\n", 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xf31(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x7f,-0x1(%rbp)
movb   $0x80,-0x2(%rbp)
movsbl -0x1(%rbp),%edx
movsbl -0x2(%rbp),%ecx
lea    0xf16(%rip),%rdi
xor    %esi,%esi
mov    $0xffffffdb,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x6c,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xf2f(%rip),%rsi
lea    0xf24(%rip),%rax
cmp    $0x1,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%edi
lea    0xf0f(%rip),%rcx
lea    0xf16(%rip),%rax
cmp    $0x1,%edi
cmovne %rax,%rcx
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x25,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xee7(%rip),%rsi
lea    0xedc(%rip),%rax
cmp    $0x1,%ecx
cmovne %rax,%rsi
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%edi
lea    0xec7(%rip),%rcx
lea    0xece(%rip),%rax
cmp    $0x1,%edi
cmovne %rax,%rcx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe94(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x2a,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xdd1(%rip),%xmm0
call   1040 <atan@plt>
mov    %eax,%esi
shl    $0x2,%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
movsd  0xdaa(%rip),%xmm0
movsd  0xdaa(%rip),%xmm1
movsd  0xdaa(%rip),%xmm2
movsd  0xdaa(%rip),%xmm3
movsd  0xdaa(%rip),%xmm4
xorps  %xmm5,%xmm5
mov    $0x6,%al
call   1030 <printf@plt>
lea    0xe3b(%rip),%rdi
movsd  0xd69(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
movsd  0xd3b(%rip),%xmm0
movsd  0xd3b(%rip),%xmm1
movsd  0xd3b(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xe16(%rip),%rdi
movsd  0xd0d(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe04(%rip),%rdi
movsd  0xcef(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdf2(%rip),%rdi
movsd  0xcd1(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xddf(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf35(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf2a(%rip),%rdi
xor    %esi,%esi
mov    $0x7f,%edx
mov    $0xffffff80,%ecx
mov    $0xffffffdb,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
mov    $0x6c,%esi
mov    $0x6c,%edx
mov    $0x6c,%ecx
mov    $0x6c,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf1d(%rip),%rbx
lea    0xf3b(%rip),%rsi
lea    0xf2f(%rip),%r14
mov    %rbx,%rdi
mov    $0x1,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf17(%rip),%rsi
lea    0xf1d(%rip),%rcx
mov    %rbx,%rdi
mov    $0x25,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
mov    %rdi,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x2a,%esi
mov    $0x2a,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movsd  0xe00(%rip),%xmm0
call   1040 <atan@plt>
lea    0x0(,%rax,4),%esi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
movsd  0xddf(%rip),%xmm1
movsd  0xddf(%rip),%xmm2
movsd  0xddf(%rip),%xmm3
movsd  0xddf(%rip),%xmm4
xorps  %xmm5,%xmm5
movsd  0xdb4(%rip),%xmm0
mov    $0x6,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
movsd  0xdc6(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
movsd  0xdb8(%rip),%xmm0
movsd  0xdb8(%rip),%xmm1
movsd  0xdb8(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
movsd  0xdaa(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
movsd  0xd9c(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe57(%rip),%rdi
movsd  0xd8e(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"2+2=%d\0A\00"
@.str.1 = [13 x i8] c"%d,%d,%d,%u\0A\00"
@.str.2 = [41 x i8] c"%d decimal = %o octal = %x hex = %X hex\0A\00"
@.str.3 = [33 x i8] c"There %s %d item%s in the list.\0A\00"
@.str.4 = [4 x i8] c"are\00"
@.str.5 = [3 x i8] c"is\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [5 x i8] c"'%s'\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [39 x i8] c"\0AThe decimal equivalent of '%c' is %d\0A\00"
@.str.11 = [9 x i8] c"Pi = %g\0A\00"
@.str.12 = [19 x i8] c"%g %g %g %g %g %g\0A\00"
@.str.13 = [4 x i8] c"%g\0A\00"
@.str.14 = [10 x i8] c"%g %g %g\0A\00"
@.str.15 = [4 x i8] c"%e\0A\00"
@.str.16 = [4 x i8] c"%f\0A\00"
@.str.17 = [6 x i8] c"%E %G\00"
@.str.18 = [32 x i8] c"\0A%%d prints a decimal value %D\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
store i8 127, i8* %1
store i8 -128, i8* %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %8, i32 %10, i32 -37)
store i32 108, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
store i32 1, i32* %3
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 1
%19 = zext i1 %18 to i64
%20 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 1
%24 = zext i1 %23 to i64
%25 = select i1 %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %20, i32 %21, i8* %25)
store i32 37, i32* %3
%27 = load i32, i32* %3
%28 = icmp ne i32 %27, 1
%29 = zext i1 %28 to i64
%30 = select i1 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0)
%31 = load i32, i32* %3
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 1
%34 = zext i1 %33 to i64
%35 = select i1 %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %30, i32 %31, i8* %35)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8** %4
%37 = load i8*, i8** %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* %37)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8** %5
%39 = load i8*, i8** %5
%40 = load i8*, i8** %5
%41 = call i32 (i8*, ...) @printf(i8* %39, i8* %40)
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 42, i32 42)
%43 = call i32 @atan(double 1.000000e+00)
%44 = mul nsw i32 4, %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double 1.000000e+00, double 5.000000e-01, double 0x3FD5555555555555, double 0x3FF5555555555555, double 2.500000e-01, double 0.000000e+00)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), double 0x419D6F3454000000)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), double 3.141590e-03, double 3.141590e-04, double 3.141590e-05)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double 0x400921FB82C2BD7F)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double 0x47D2CED32A16A1B1)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), double 0x400921FB54C44A44, double 0x400921FB54C44A44)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"2+2=%d\0A\00"
@.str.1 = [13 x i8] c"%d,%d,%d,%u\0A\00"
@.str.2 = [41 x i8] c"%d decimal = %o octal = %x hex = %X hex\0A\00"
@.str.3 = [33 x i8] c"There %s %d item%s in the list.\0A\00"
@.str.4 = [4 x i8] c"are\00"
@.str.5 = [3 x i8] c"is\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [5 x i8] c"'%s'\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [39 x i8] c"\0AThe decimal equivalent of '%c' is %d\0A\00"
@.str.11 = [9 x i8] c"Pi = %g\0A\00"
@.str.12 = [19 x i8] c"%g %g %g %g %g %g\0A\00"
@.str.13 = [4 x i8] c"%g\0A\00"
@.str.14 = [10 x i8] c"%g %g %g\0A\00"
@.str.15 = [4 x i8] c"%e\0A\00"
@.str.16 = [4 x i8] c"%f\0A\00"
@.str.17 = [6 x i8] c"%E %G\00"
@.str.18 = [32 x i8] c"\0A%%d prints a decimal value %D\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 127, i32 -128, i32 -37)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 108, i32 108, i32 108, i32 108)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 42, i32 42)
%9 = tail call i32 @atan(double 1.000000e+00)
%10 = shl nsw i32 %9, 2
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i32 %10)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), double 1.000000e+00, double 5.000000e-01, double 0x3FD5555555555555, double 0x3FF5555555555555, double 2.500000e-01, double 0.000000e+00)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), double 0x419D6F3454000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), double 3.141590e-03, double 3.141590e-04, double 3.141590e-05)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double 0x400921FB82C2BD7F)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), double 0x47D2CED32A16A1B1)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0), double 0x400921FB54C44A44, double 0x400921FB54C44A44)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0), i32 10)
ret i32 0
}