xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x4d() {
  Assert_real((iscntrl(77) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              390, ("iscntrl should be 0 for M"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x4d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x186,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x4d>:
push   %rax
mov    $0x4d,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x186,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for M\00"
define void @t_iscntrl_0x4d() {
%1 = call i64 @iscntrl(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for M\00"
define void @t_iscntrl_0x4d() {
%1 = tail call i64 @iscntrl(i32 77)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 390, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int Random_init(void) {
  srand((unsigned)time(NULL));
  return 0;
}


x86 assembly (clang, -O0):
<Random_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Random_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Random_init() {
%1 = call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @Random_init() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double testfunc(int, double);
int main() {
  int data1 = 10;
  double data2 = 3.14159;
  double result;
  result = testfunc(data1, data2);
  printf("The bad result is %gf\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
call   1030 <testfunc@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0xa,%edi
call   1030 <testfunc@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"The bad result is %gf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store i32 10, i32* %2
store double 3.141590e+00, double* %3
%5 = load i32, i32* %2
%6 = load double, double* %3
%7 = call double @testfunc(i32 %5, double %6)
store double %7, double* %4
%8 = load double, double* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"The bad result is %gf\0A\00"
define i32 @main() {
%1 = tail call double @testfunc(i32 10, double 3.141590e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
int sum(int n) { return n == 0 ? 0 : n + sum(n - 1); }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <sum+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <sum+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
je     1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @sum(i32 %9)
%11 = add nsw i32 %7, %10
br label %12
12: ; preds = %6, %5
%13 = phi i32 [ 0, %5 ], [ %11, %6 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
void all_threads_ready(void) {}


x86 assembly (clang, -O0):
<all_threads_ready>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_threads_ready>:
ret

LLVM IR (-O0):
define void @all_threads_ready() {
ret void
}

LLVM IR (-O2):
define void @all_threads_ready() {
ret void
}
/* Variables and functions */
double area(int);
double circumf(int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int x = 10;
  printf("Radius: %d\n", x);
  printf("Circumference: %f\n", circumf(x));
  printf("Area: %f\n", area(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <circumf@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <area@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
movsd  0xec0(%rip),%xmm0
call   1030 <printf@plt>
mov    $0xa,%edi
call   1050 <circumf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <area@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Radius: %d\0A\00"
@.str.1 = [19 x i8] c"Circumference: %f\0A\00"
@.str.2 = [10 x i8] c"Area: %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %4)
%6 = load i32, i32* %2
%7 = call double @circumf(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load i32, i32* %2
%10 = call double @area(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Radius: %d\0A\00"
@.str.1 = [19 x i8] c"Circumference: %f\0A\00"
@.str.2 = [10 x i8] c"Area: %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 1.000000e+01)
%2 = tail call double @circumf(i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), double %2)
%4 = tail call double @area(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t reduce32(uint32_t a) {
  uint32_t t;
  t = a & 0x7FFFFF;
  a >>= 23;
  t += ((a << 13) - a);
  return t;
}


x86 assembly (clang, -O0):
<reduce32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x17,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
sub    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce32>:
mov    %edi,%ecx
and    $0x7fffff,%ecx
sar    $0x17,%edi
mov    %edi,%eax
shl    $0xd,%eax
sub    %edi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @reduce32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 8388607
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = ashr i32 %6, 23
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = shl i32 %8, 13
%10 = load i32, i32* %2
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @reduce32(i32 %0) {
%2 = and i32 %0, 8388607
%3 = ashr i32 %0, 23
%4 = mul nsw i32 %3, 8191
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t get_1970_usec() {
  struct timeval tv = {0};
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_1970_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_1970_usec>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64, i32 }
define i64 @get_1970_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64, i32 }
define i64 @get_1970_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank6High(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank6();
void m22_setParamsEXX1(uint16_t addr, uint8_t val) {
  __setCHRBank6High(addr, val);
  m22_SetChrROMBank6();
}


x86 assembly (clang, -O0):
<m22_setParamsEXX1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <__setCHRBank6High@plt>
mov    $0x0,%al
call   1030 <m22_SetChrROMBank6@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m22_setParamsEXX1>:
push   %rax
call   1040 <__setCHRBank6High@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <m22_SetChrROMBank6@plt>

LLVM IR (-O0):
define void @m22_setParamsEXX1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @__setCHRBank6High(i32 %5, i32 %6)
%8 = call i32 (...) @m22_SetChrROMBank6()
ret void
}

LLVM IR (-O2):
define void @m22_setParamsEXX1(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank6High(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank6()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t double_to_uint64(double value) {
  union {
    uint64_t iv;
    double val;
  } a;
  a.val = value;
  return a.iv;
}


x86 assembly (clang, -O0):
<double_to_uint64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_uint64>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @double_to_uint64(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @double_to_uint64(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int read(int, void *, int);
int libc_read(int fd, void *a, int nbytes) { return read(fd, a, nbytes); }


x86 assembly (clang, -O0):
<libc_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @libc_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @libc_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_file(const char *path) {
  struct stat statbuf;
  if (stat(path, &statbuf) == 0)
    return S_ISREG(statbuf.st_mode) != 0;
  return 0;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    115f <is_file+0x3f>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <is_file+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISREG(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ]
ret i32 %13
}
void mmc_pwrseq_post_power_on(struct mmc_host *host) {}


x86 assembly (clang, -O0):
<mmc_pwrseq_post_power_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmc_pwrseq_post_power_on>:
ret

LLVM IR (-O0):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_post_power_on(%struct.mmc_host* %0) {
%2 = alloca %struct.mmc_host*
store %struct.mmc_host* %0, %struct.mmc_host** %2
ret void
}

LLVM IR (-O2):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_post_power_on(%struct.mmc_host* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_sysCx();
int /*<<< orphan*/ lose_sysCx();
int /*<<< orphan*/ testfn_Associa();
int /*<<< orphan*/ testfn_RBTree();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  init_sysCx();
  testfn_RBTree();
  testfn_Associa();
  lose_sysCx();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_sysCx@plt>
mov    $0x0,%al
call   1030 <testfn_RBTree@plt>
mov    $0x0,%al
call   1060 <testfn_Associa@plt>
mov    $0x0,%al
call   1050 <lose_sysCx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_sysCx@plt>
xor    %eax,%eax
call   1030 <testfn_RBTree@plt>
xor    %eax,%eax
call   1060 <testfn_Associa@plt>
xor    %eax,%eax
call   1050 <lose_sysCx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @init_sysCx()
%9 = call i32 (...) @testfn_RBTree()
%10 = call i32 (...) @testfn_Associa()
%11 = call i32 (...) @lose_sysCx()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_sysCx()
%4 = tail call i32 (...) @testfn_RBTree()
%5 = tail call i32 (...) @testfn_Associa()
%6 = tail call i32 (...) @lose_sysCx()
ret i32 0
}
__attribute__((always_)) int is_highmem(struct zone *zone) { return 0; }


x86 assembly (clang, -O0):
<is_highmem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_highmem>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.zone = type opaque
define i32 @is_highmem(%struct.zone* %0) {
%2 = alloca %struct.zone*
store %struct.zone* %0, %struct.zone** %2
ret i32 0
}

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @is_highmem(%struct.zone* nocapture readnone %0) {
ret i32 0
}
void internal_callback_connectionLost(void *context, char *cause) { return; }


x86 assembly (clang, -O0):
<internal_callback_connectionLost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_callback_connectionLost>:
ret

LLVM IR (-O0):
define void @internal_callback_connectionLost(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @internal_callback_connectionLost(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_run() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_run"
         "\n");
}


x86 assembly (clang, -O0):
<pa_pdispatch_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_pdispatch_run>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_pdispatch_run\0A\00"
define i32 @pa_pdispatch_run() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_pdispatch_run\00"
define i32 @pa_pdispatch_run() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ f();
int main(void) {
  if (f())
    goto out;
out:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
cmp    $0x0,%rax
je     1135 <main+0x25>
jmp    113a <main+0x2a>
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @f()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
ret i32 0
}
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
pid_t vfork(void) {
  long __res;
  __asm__ volatile("int $0x80" : "=a"(__res) : "0"(190));
  do {
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<vfork>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbe,%eax
int    $0x80
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfork>:
mov    $0xbe,%eax
int    $0x80
ret

LLVM IR (-O0):
define i8* @vfork() {
%1 = alloca i64
%2 = call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 190)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %3
ret i8* %5
}

LLVM IR (-O2):
define i8* @vfork() {
%1 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i64 190)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
int readIntL(char **pInData) {
  char *pData = *pInData;
  int iRet = 0;
  char *pRet = (char *)&iRet;
  pRet[0] = pData[3];
  pRet[1] = pData[2];
  pRet[2] = pData[1];
  pRet[3] = pData[0];
  pData += 4;
  *pInData = pData;
  return iRet;
}


x86 assembly (clang, -O0):
<readIntL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIntL>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
add    $0x4,%rcx
mov    %rcx,(%rdi)
bswap  %eax
ret

LLVM IR (-O0):
define i32 @readIntL(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %2
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
store i8* %7, i8** %3
store i32 0, i32* %4
%8 = bitcast i32* %4 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 3
store i8 %26, i8* %28
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 4
store i8* %30, i8** %3
%31 = load i8*, i8** %3
%32 = load i8**, i8*** %2
store i8* %31, i8** %32
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @readIntL(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 3
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %2, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = load i8, i8* %7
%9 = load i8, i8* %2
%10 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %10, i8** %0
%11 = zext i8 %9 to i32
%12 = shl nuw i32 %11, 24
%13 = zext i8 %8 to i32
%14 = shl nuw nsw i32 %13, 16
%15 = zext i8 %6 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = zext i8 %4 to i32
%18 = or i32 %16, %17
%19 = or i32 %18, %14
%20 = or i32 %19, %12
ret i32 %20
}
/* Variables and functions */
double idfStandard(double);
double idfNormal(double m, double s, double u) {
  return (m + s * idfStandard(u));
}


x86 assembly (clang, -O0):
<idfNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <idfStandard@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idfNormal>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <idfStandard@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @idfNormal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @idfStandard(double %9)
%11 = call double @llvm.fmuladd.f64(double %8, double %10, double %7)
ret double %11
}

LLVM IR (-O2):
define double @idfNormal(double %0, double %1, double %2) {
%4 = tail call double @idfStandard(double %2)
%5 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %0)
ret double %5
}
void inter_elemental_sql_final(void) { return; }


x86 assembly (clang, -O0):
<inter_elemental_sql_final>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_elemental_sql_final>:
ret

LLVM IR (-O0):
define void @inter_elemental_sql_final() {
ret void
}

LLVM IR (-O2):
define void @inter_elemental_sql_final() {
ret void
}
void simple_free_data(void *data) { (void)data; }


x86 assembly (clang, -O0):
<simple_free_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_free_data>:
ret

LLVM IR (-O0):
define void @simple_free_data(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @simple_free_data(i8* nocapture %0) {
ret void
}
int CMP_CompareFloats(void *pA, void *pB) {
  float *a, *b;
  a = pA;
  b = pB;
  if (*a >= *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CMP_CompareFloats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jb     113d <CMP_CompareFloats+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <CMP_CompareFloats+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP_CompareFloats>:
movss  (%rdi),%xmm0
xor    %eax,%eax
ucomiss (%rsi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @CMP_CompareFloats(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
store float* %9, float** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to float*
store float* %11, float** %7
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = load float*, float** %7
%15 = load float, float* %14
%16 = fcmp oge float %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %19
18: ; preds = %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @CMP_CompareFloats(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int adc_10_isr(void) { return (*(volatile unsigned int *)(0x7E00B00C)); }


x86 assembly (clang, -O0):
<adc_10_isr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00b00c,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_10_isr>:
mov    0x7e00b00c,%eax
ret

LLVM IR (-O0):
define i32 @adc_10_isr() {
%1 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @adc_10_isr() {
%1 = load volatile i32, i32* inttoptr (i64 2113974284 to i32*)
ret i32 %1
}
void pool_stat(int full) { return; }


x86 assembly (clang, -O0):
<pool_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_stat>:
ret

LLVM IR (-O0):
define void @pool_stat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pool_stat(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ do_cow_fopen(char const *, char const *);
FILE *do_generic_freopen(char const *name, char const *mode, FILE *file,
                         FILE *(*open_proc)(char const *, char const *,
                                            FILE *)) {
  do_cow_fopen(name, mode);
  do {
  } while (0);
  return open_proc(name, mode, file);
}


x86 assembly (clang, -O0):
<do_generic_freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <do_cow_fopen@plt>
jmp    113a <do_generic_freopen+0x2a>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_generic_freopen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <do_cow_fopen@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    *%rax

LLVM IR (-O0):
define i32* @do_generic_freopen(i8* %0, i8* %1, i32* %2, i32* (i8*, i8*, i32*)* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32* (i8*, i8*, i32*)*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32* (i8*, i8*, i32*)* %3, i32* (i8*, i8*, i32*)** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @do_cow_fopen(i8* %9, i8* %10)
br label %12
12: ; preds = %4
br label %13
13: ; preds = %12
%14 = load i32* (i8*, i8*, i32*)*, i32* (i8*, i8*, i32*)** %8
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = load i32*, i32** %7
%18 = call i32* %14(i8* %15, i8* %16, i32* %17)
ret i32* %18
}

LLVM IR (-O2):
define i32* @do_generic_freopen(i8* %0, i8* %1, i32* %2, i32* (i8*, i8*, i32*)* nocapture %3) {
%5 = tail call i32 @do_cow_fopen(i8* %0, i8* %1)
%6 = tail call i32* %3(i8* %0, i8* %1, i32* %2)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ eat(unsigned long);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ put_forks(unsigned long);
int /*<<< orphan*/ take_forks(unsigned long);
int /*<<< orphan*/ think(unsigned long);
void *philosopher(void *thread_id) {
  while (1) {
    think((unsigned long)thread_id);
    take_forks((unsigned long)thread_id);
    eat((unsigned long)thread_id);
    put_forks((unsigned long)thread_id);
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<philosopher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <think@plt>
mov    -0x8(%rbp),%rdi
call   1060 <take_forks@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eat@plt>
mov    -0x8(%rbp),%rdi
call   1050 <put_forks@plt>
jmp    114c <philosopher+0xc>

x86 assembly (clang, -O2):
<philosopher>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <think@plt>
mov    %rbx,%rdi
call   1060 <take_forks@plt>
mov    %rbx,%rdi
call   1030 <eat@plt>
mov    %rbx,%rdi
call   1050 <put_forks@plt>
jmp    1150 <philosopher+0x10>

LLVM IR (-O0):
define i8* @philosopher(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @think(i64 %5)
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %7 to i64
%9 = call i32 @take_forks(i64 %8)
%10 = load i8*, i8** %2
%11 = ptrtoint i8* %10 to i64
%12 = call i32 @eat(i64 %11)
%13 = load i8*, i8** %2
%14 = ptrtoint i8* %13 to i64
%15 = call i32 @put_forks(i64 %14)
br label %3
}

LLVM IR (-O2):
define noalias i8* @philosopher(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @think(i64 %2)
%5 = tail call i32 @take_forks(i64 %2)
%6 = tail call i32 @eat(i64 %2)
%7 = tail call i32 @put_forks(i64 %2)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void color(int attr, int fg, int bg) {
  printf("%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40);
}


x86 assembly (clang, -O0):
<color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x1e,%ecx
mov    -0xc(%rbp),%r8d
add    $0x28,%r8d
lea    0xec7(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color>:
mov    %edi,%eax
lea    0x1e(%rsi),%ecx
lea    0x28(%rdx),%r8d
lea    0xee0(%rip),%rdi
mov    $0x1b,%esi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%c[%d;%d;%dm\00"
define void @color(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 30
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 40
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 27, i32 %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%c[%d;%d;%dm\00"
define void @color(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 30
%5 = add nsw i32 %2, 40
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0, i32 %4, i32 %5)
ret void
}
int num_digits(int n) {
  int r = 1;
  while (n > 9) {
    n /= 10;
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1134 <num_digits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <num_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
mov    $0x1,%eax
cmp    $0xa,%edi
jl     1134 <num_digits+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <num_digits+0x20>
ret

LLVM IR (-O0):
define i32 @num_digits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 9
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @num_digits(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
long double strtod(char const *, char **);
long double strtold(const char *str, char **endptr) {
  return (strtod(str, endptr));
}


x86 assembly (clang, -O0):
<strtold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold>:
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define x86_fp80 @strtold(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call x86_fp80 @strtod(i8* %5, i8** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @strtold(i8* %0, i8** nocapture %1) {
%3 = tail call x86_fp80 @strtod(i8* %0, i8** %1)
ret x86_fp80 %3
}
int __pruss_detect_hw_version(unsigned int *pruss_io) {
  if (pruss_io[(0x01C34000 - 0x01C30000) >> 2] == 0x4E825900)
    return 1;
  else {
    if (pruss_io[(0x4a320000 - 0x4a300000) >> 2] == 0x4E82A900)
      return 2;
    else
      return -1;
  }
}


x86 assembly (clang, -O0):
<__pruss_detect_hw_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x4e825900,0x4000(%rax)
59 82 4e
jne    1128 <__pruss_detect_hw_version+0x28>
movl   $0x1,-0x4(%rbp)
jmp    114f <__pruss_detect_hw_version+0x4f>
mov    -0x10(%rbp),%rax
cmpl   $0x4e82a900,0x20000(%rax)
a9 82 4e
jne    1148 <__pruss_detect_hw_version+0x48>
movl   $0x2,-0x4(%rbp)
jmp    114f <__pruss_detect_hw_version+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pruss_detect_hw_version>:
mov    $0x1,%eax
cmpl   $0x4e825900,0x4000(%rdi)
59 82 4e
je     1126 <__pruss_detect_hw_version+0x26>
xor    %eax,%eax
cmpl   $0x4e82a900,0x20000(%rdi)
a9 82 4e
sete   %al
lea    (%rax,%rax,2),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @__pruss_detect_hw_version(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 4096
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1317165312
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %16
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 32768
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 1317185792
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 2, i32* %2
br label %16
15: ; preds = %9
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %14, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @__pruss_detect_hw_version(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4096
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1317165312
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 32768
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 1317185792
%9 = select i1 %8, i32 2, i32 -1
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t _calc_data_size(uint16_t size) {
  uint16_t input_data_size = size / 8;
  if (size % 8)
    input_data_size++;
  return input_data_size;
}


x86 assembly (clang, -O0):
<_calc_data_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1132 <_calc_data_size+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_calc_data_size>:
lea    0x7(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x3,%eax
and    $0x7,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @_calc_data_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %6, 8
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @_calc_data_size(i32 %0) {
%2 = sdiv i32 %0, 8
%3 = and i32 %0, 7
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge7(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 7);
}


x86 assembly (clang, -O0):
<charge7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x7,%edx
call   1030 <charge_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charge7>:
mov    $0x7,%edx
jmp    1030 <charge_generic@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @charge7(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %3
%6 = load %struct.battle_char*, %struct.battle_char** %4
%7 = call i32 @charge_generic(%struct.battle_char* %5, %struct.battle_char* %6, i32 7)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge7(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int be32dec(int /*<<< orphan*/ const *);
uint64_t be64dec(const uint8_t *buf) {
  return (uint64_t)((uint64_t)be32dec(buf) << 32 | be32dec(buf + 4));
}


x86 assembly (clang, -O0):
<be64dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <be32dec@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1030 <be32dec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64dec>:
push   %rbx
mov    %rdi,%rbx
call   1030 <be32dec@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <be32dec@plt>

LLVM IR (-O0):
define i32 @be64dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @be32dec(i32* %3)
%5 = shl i32 %4, 32
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 4
%8 = call i32 @be32dec(i32* %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @be64dec(i32* %0) {
%2 = tail call i32 @be32dec(i32* %0)
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = tail call i32 @be32dec(i32* %3)
ret i32 poison
}
void hdd_image_log(const char *fmt, ...) {}


x86 assembly (clang, -O0):
<hdd_image_log>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdd_image_log>:
ret

LLVM IR (-O0):
define void @hdd_image_log(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @hdd_image_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ air();
int main(void) {
  air();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <air@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <air@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @air()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @air()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This test program is intended for a little-endian architecture\n"
         "with an IEEE-standard 128-bit long double.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [107 x i8] c"This test program is intended for a little-endian architecture\0Awith an IEEE-standard 128-bit long double.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [106 x i8] c"This test program is intended for a little-endian architecture\0Awith an IEEE-standard 128-bit long double.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int close_log_file(void) { return 0; }


x86 assembly (clang, -O0):
<close_log_file>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_log_file>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @close_log_file() {
ret i32 0
}

LLVM IR (-O2):
define i32 @close_log_file() {
ret i32 0
}