#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 INT_MAX;
int INT_MIN;
double M_PI;
int abs(int);
unsigned long labs(unsigned long);
int /*<<< orphan*/ printf(char *, int);
double sin(int);
int main(int argc, const char *argv[]) {
  unsigned long x = 255;
  printf("x is %lu.\n", x);
  printf("In octal, x is %lo.\n", x);
  printf("In hexadecimal, x is %lx.\n", x);
  printf("3 * 3 + 5 * 2 = %d\n", 3 * 3 + 5 * 2);
  printf("11 / 3 = %f\n", (float)11 / 3);
  double y = 12345.6789;
  printf("y is %.2f\n", y);
  printf("y is %.2e\n", y);
  printf("Sin of 1 rad = %.3f\n", sin(1));
  printf("PI is %f\n", M_PI);
  unsigned long test = -5;
  test = labs(test);
  printf("%lu\n", test);
  short num = 10;
  long den = 3;
  printf("%f\n", (float)num / den);
  unsigned long a = 1;
  printf("%lu", a);
  printf("%d\n", INT_MAX + 1);
  printf("%d\n", INT_MIN);
  printf("%d\n", abs(INT_MIN));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xff,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x13,%esi
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x3,%esi
call   1050 <printf@plt>
movabs $0x40c81cd6e631f8a1,%rax
1c c8 40
mov    %rax,-0x20(%rbp)
cvttsd2si -0x20(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
cvttsd2si -0x20(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <sin@plt>
cvttsd2si %xmm0,%esi
lea    0xe80(%rip),%rdi
call   1050 <printf@plt>
mov    0x2dea(%rip),%rax
cvttsd2si (%rax),%esi
lea    0xe7e(%rip),%rdi
call   1050 <printf@plt>
movq   $0xfffffffffffffffb,-0x28(%rbp)
ff
mov    -0x28(%rbp),%rdi
call   1040 <labs@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
movw   $0xa,-0x2a(%rbp)
movq   $0x3,-0x38(%rbp)
movswl -0x2a(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ssq -0x38(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%esi
lea    0xdfb(%rip),%rdi
call   1050 <printf@plt>
movq   $0x1,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %eax,%esi
lea    0xe1f(%rip),%rdi
call   1050 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xdbc(%rip),%rdi
call   1050 <printf@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%esi
lea    0xda7(%rip),%rdi
call   1050 <printf@plt>
mov    0x2d28(%rip),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xd8b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0xff,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x13,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x3039,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x3039,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sin@plt>
cvttsd2si %xmm0,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e2c(%rip),%rax
cvttsd2si (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%esi
add    $0x1,%esi
lea    0xe39(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2db7(%rip),%r14
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    (%r14),%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"x is %lu.\0A\00"
@.str.1 = [21 x i8] c"In octal, x is %lo.\0A\00"
@.str.2 = [27 x i8] c"In hexadecimal, x is %lx.\0A\00"
@.str.3 = [20 x i8] c"3 * 3 + 5 * 2 = %d\0A\00"
@.str.4 = [13 x i8] c"11 / 3 = %f\0A\00"
@.str.5 = [11 x i8] c"y is %.2f\0A\00"
@.str.6 = [11 x i8] c"y is %.2e\0A\00"
@.str.7 = [21 x i8] c"Sin of 1 rad = %.3f\0A\00"
@.str.8 = [10 x i8] c"PI is %f\0A\00"
@M_PI = global double 0.000000e+00
@.str.9 = [5 x i8] c"%lu\0A\00"
@.str.10 = [4 x i8] c"%f\0A\00"
@.str.11 = [4 x i8] c"%lu\00"
@.str.12 = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca double
%8 = alloca i64
%9 = alloca i16
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 255, i64* %6
%12 = load i64, i64* %6
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i64, i64* %6
%16 = trunc i64 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i64, i64* %6
%19 = trunc i64 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 19)
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 3)
store double 0x40C81CD6E631F8A1, double* %7
%23 = load double, double* %7
%24 = fptosi double %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %24)
%26 = load double, double* %7
%27 = fptosi double %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = call double @sin(i32 1)
%30 = fptosi double %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %30)
%32 = load double, double* @M_PI
%33 = fptosi double %32 to i32
%34 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %33)
store i64 -5, i64* %8
%35 = load i64, i64* %8
%36 = call i64 @labs(i64 %35)
store i64 %36, i64* %8
%37 = load i64, i64* %8
%38 = trunc i64 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 %38)
store i16 10, i16* %9
store i64 3, i64* %10
%40 = load i16, i16* %9
%41 = sitofp i16 %40 to float
%42 = load i64, i64* %10
%43 = sitofp i64 %42 to float
%44 = fdiv float %41, %43
%45 = fptosi float %44 to i32
%46 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 %45)
store i64 1, i64* %11
%47 = load i64, i64* %11
%48 = trunc i64 %47 to i32
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %48)
%50 = load i32, i32* @INT_MAX
%51 = add nsw i32 %50, 1
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %51)
%53 = load i32, i32* @INT_MIN
%54 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @INT_MIN
%56 = call i32 @abs(i32 %55)
%57 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"x is %lu.\0A\00"
@.str.1 = [21 x i8] c"In octal, x is %lo.\0A\00"
@.str.2 = [27 x i8] c"In hexadecimal, x is %lx.\0A\00"
@.str.3 = [20 x i8] c"3 * 3 + 5 * 2 = %d\0A\00"
@.str.4 = [13 x i8] c"11 / 3 = %f\0A\00"
@.str.5 = [11 x i8] c"y is %.2f\0A\00"
@.str.6 = [11 x i8] c"y is %.2e\0A\00"
@.str.7 = [21 x i8] c"Sin of 1 rad = %.3f\0A\00"
@.str.8 = [10 x i8] c"PI is %f\0A\00"
@M_PI = global double 0.000000e+00
@.str.9 = [5 x i8] c"%lu\0A\00"
@.str.10 = [4 x i8] c"%f\0A\00"
@.str.11 = [4 x i8] c"%lu\00"
@.str.12 = [4 x i8] c"%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 255)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 255)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 255)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 19)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 3)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 12345)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 12345)
%10 = tail call double @sin(i32 1)
%11 = fptosi double %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i32 %11)
%13 = load double, double* @M_PI
%14 = fptosi double %13 to i32
%15 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %14)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 5)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 1)
%19 = load i32, i32* @INT_MAX
%20 = add nsw i32 %19, 1
%21 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @INT_MIN
%23 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @INT_MIN
%25 = tail call i32 @llvm.abs.i32(i32 %24, i1 true)
%26 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i32 %25)
ret i32 0
}