xunge/DecIR huggingface dataset:
/* Variables and functions */
int f197(int *);
int f198(int *p) { return f197(p); }


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

x86 assembly (clang, -O2):
<f198>:
jmp    1030 <f197@plt>

LLVM IR (-O0):
define i32 @f198(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f197(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f198(i32* %0) {
%2 = tail call i32 @f197(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void err(char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float _rintf(float);
float rintf(float x) { return _rintf(x); }


x86 assembly (clang, -O0):
<rintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_rintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintf>:
jmp    1030 <_rintf@plt>

LLVM IR (-O0):
define float @rintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_rintf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = tail call float @_rintf(float %0)
ret float %2
}
double _dlimit(double v, double min, double max) {
  if (v < min)
    return (min);
  if (v > max)
    return (max);
  return (v);
}


x86 assembly (clang, -O0):
<_dlimit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <_dlimit+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <_dlimit+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <_dlimit+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <_dlimit+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dlimit>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @_dlimit(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @_dlimit(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int event_queue_add_timer_hr(int, int *, int, int /*<<< orphan*/);
int event_queue_add_timer(int eq, int *id, int sec) {
  return event_queue_add_timer_hr(eq, id, sec, 0);
}


x86 assembly (clang, -O0):
<event_queue_add_timer>:
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
xor    %ecx,%ecx
call   1030 <event_queue_add_timer_hr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_queue_add_timer>:
xor    %ecx,%ecx
jmp    1030 <event_queue_add_timer_hr@plt>

LLVM IR (-O0):
define i32 @event_queue_add_timer(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 = load i32, i32* %6
%10 = call i32 @event_queue_add_timer_hr(i32 %7, i32* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @event_queue_add_timer(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @event_queue_add_timer_hr(i32 %0, i32* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Error(int, char *, int /*<<< orphan*/);
void Com_ErrorDrop_f(void) { Com_Error(1, "%s", Cmd_Argv(1)); }


x86 assembly (clang, -O0):
<Com_ErrorDrop_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Cmd_Argv@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xec4(%rip),%rsi
call   1040 <Com_Error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_ErrorDrop_f>:
push   %rax
mov    $0x1,%edi
call   1030 <Cmd_Argv@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1040 <Com_Error@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Com_ErrorDrop_f() {
%1 = call i32 @Cmd_Argv(i32 1)
%2 = call i32 @Com_Error(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Com_ErrorDrop_f() {
%1 = tail call i32 @Cmd_Argv(i32 1)
%2 = tail call i32 @Com_Error(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
__attribute__((always_)) int x264_clip3(int v, int i_min, int i_max) {
  return ((v < i_min) ? i_min : (v > i_max) ? i_max : v);
}


x86 assembly (clang, -O0):
<x264_clip3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <x264_clip3+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <x264_clip3+0x47>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <x264_clip3+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <x264_clip3+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_clip3>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @x264_clip3(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @x264_clip3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
void convert_float_to_int32(float sinus, void *buf) {
  *((int32_t *)buf) = (int32_t)(sinus);
}


x86 assembly (clang, -O0):
<convert_float_to_int32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
cvttss2si -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float_to_int32>:
cvttss2si %xmm0,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @convert_float_to_int32(float %0, i8* %1) {
%3 = alloca float
%4 = alloca i8*
store float %0, float* %3
store i8* %1, i8** %4
%5 = load float, float* %3
%6 = fptosi float %5 to i64
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @convert_float_to_int32(float %0, i8* nocapture writeonly %1) {
%3 = fptosi float %0 to i64
%4 = bitcast i8* %1 to i64*
store i64 %3, i64* %4
ret void
}
/* Variables and functions */
int tolower(int);
int SDL_tolower(int x) { return tolower(x); }


x86 assembly (clang, -O0):
<SDL_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_tolower>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @SDL_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @tolower(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @SDL_tolower(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x7e() {
  Assert_real((isxdigit(126) == 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_isxdigit.c",
              635, ("isxdigit should be 0 for ~"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x7e>:
push   %rax
mov    $0x7e,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x27b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ~\00"
define void @t_isxdigit_0x7e() {
%1 = call i64 @isxdigit(i32 126)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ~\00"
define void @t_isxdigit_0x7e() {
%1 = tail call i64 @isxdigit(i32 126)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 635, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sqrt(double);
double vector_mag(double v[]) {
  return (sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
}


x86 assembly (clang, -O0):
<vector_mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_mag>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <vector_mag+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vector_mag(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @vector_mag(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int address;

/* Variables and functions */
int /*<<< orphan*/ tpi_read();
int /*<<< orphan*/ tpi_write(int);
uint8_t tpi_sin(uint8_t address) {
  tpi_write((0x10) | ((((address) & (0x30)) << (1)) | (((address) & (0x0F)))));
  return tpi_read();
}


x86 assembly (clang, -O0):
<tpi_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0x30,%edi
shl    $0x1,%edi
mov    -0x4(%rbp),%eax
and    $0xf,%eax
or     %eax,%edi
or     $0x10,%edi
call   1040 <tpi_write@plt>
mov    $0x0,%al
call   1030 <tpi_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpi_sin>:
push   %rax
mov    %edi,%eax
and    $0x30,%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%edi
add    $0x10,%edi
call   1040 <tpi_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <tpi_read@plt>

LLVM IR (-O0):
define i32 @tpi_sin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 48
%5 = shl i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = or i32 %5, %7
%9 = or i32 16, %8
%10 = call i32 @tpi_write(i32 %9)
%11 = call i32 (...) @tpi_read()
ret i32 %11
}

LLVM IR (-O2):
define i32 @tpi_sin(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, 96
%4 = and i32 %0, 15
%5 = or i32 %4, %3
%6 = or i32 %5, 16
%7 = tail call i32 @tpi_write(i32 %6)
%8 = tail call i32 (...) @tpi_read()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ STAGE_1_init();
int /*<<< orphan*/ STAGE_2_init();
int /*<<< orphan*/ STAGE_3_init();
int /*<<< orphan*/ STAGE_null_init();
void STAGES_init(void) {
  STAGE_1_init();
  STAGE_2_init();
  STAGE_3_init();
  STAGE_null_init();
}


x86 assembly (clang, -O0):
<STAGES_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <STAGE_1_init@plt>
mov    $0x0,%al
call   1040 <STAGE_2_init@plt>
mov    $0x0,%al
call   1050 <STAGE_3_init@plt>
mov    $0x0,%al
call   1060 <STAGE_null_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<STAGES_init>:
push   %rax
xor    %eax,%eax
call   1030 <STAGE_1_init@plt>
xor    %eax,%eax
call   1040 <STAGE_2_init@plt>
xor    %eax,%eax
call   1050 <STAGE_3_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <STAGE_null_init@plt>

LLVM IR (-O0):
define void @STAGES_init() {
%1 = call i32 (...) @STAGE_1_init()
%2 = call i32 (...) @STAGE_2_init()
%3 = call i32 (...) @STAGE_3_init()
%4 = call i32 (...) @STAGE_null_init()
ret void
}

LLVM IR (-O2):
define void @STAGES_init() {
%1 = tail call i32 (...) @STAGE_1_init()
%2 = tail call i32 (...) @STAGE_2_init()
%3 = tail call i32 (...) @STAGE_3_init()
%4 = tail call i32 (...) @STAGE_null_init()
ret void
}
/* Variables and functions */
scalar_t__ fun(int);
int /*<<< orphan*/ printf(char *);
void main() {
  int n;
  for (n = 1; n < 1000; n++)
    if (fun(n) == 0)
      break;
  if (n >= 1000)
    printf("ok");
  else
    printf("no");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    1166 <main+0x46>
mov    -0x4(%rbp),%edi
call   1030 <fun@plt>
cmp    $0x0,%rax
jne    1153 <main+0x33>
jmp    1166 <main+0x46>
jmp    1158 <main+0x38>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
cmpl   $0x3e8,-0x4(%rbp)
jl     1184 <main+0x64>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
jmp    1190 <main+0x70>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebp
lea    0xed3(%rip),%rbx
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <fun@plt>
test   %rax,%rax
je     115a <main+0x3a>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1140 <main+0x20>
mov    %r14,%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ok\00"
@.str.1 = [3 x i8] c"no\00"
define void @main() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %11, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i64 @fun(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %2
14: ; preds = %9, %2
%15 = load i32, i32* %1
%16 = icmp sge i32 %15, 1000
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ok\00"
@.str.1 = [3 x i8] c"no\00"
define void @main() {
br label %4
1: ; preds = %4
%2 = add nuw nsw i32 %5, 1
%3 = icmp eq i32 %2, 1000
br i1 %3, label %8, label %4
4: ; preds = %0, %1
%5 = phi i32 [ 1, %0 ], [ %2, %1 ]
%6 = tail call i64 @fun(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %1
8: ; preds = %4, %1
%9 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %4 ]
%10 = tail call i32 @printf(i8* dereferenceable(1) %9)
ret void
}
/* Variables and functions */
#define TPACKET_V1 129
#define TPACKET_V2 128
int __v1_tx_kernel_ready(void *);
int __v2_tx_kernel_ready(void *);
int /*<<< orphan*/ assert(int);
int __v1_v2_tx_kernel_ready(void *base, int version) {
  switch (version) {
  case TPACKET_V1:
    return __v1_tx_kernel_ready(base);
  case TPACKET_V2:
    return __v2_tx_kernel_ready(base);
  default:
    assert(!(1));
    return 0;
  }
}


x86 assembly (clang, -O0):
<__v1_v2_tx_kernel_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x80,%eax
je     1179 <__v1_v2_tx_kernel_ready+0x49>
jmp    1155 <__v1_v2_tx_kernel_ready+0x25>
mov    -0x18(%rbp),%eax
sub    $0x81,%eax
jne    118a <__v1_v2_tx_kernel_ready+0x5a>
jmp    1168 <__v1_v2_tx_kernel_ready+0x38>
mov    -0x10(%rbp),%rdi
call   1040 <__v1_tx_kernel_ready@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <__v1_v2_tx_kernel_ready+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <__v2_tx_kernel_ready@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <__v1_v2_tx_kernel_ready+0x68>
xor    %edi,%edi
call   1050 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__v1_v2_tx_kernel_ready>:
cmp    $0x80,%esi
je     1145 <__v1_v2_tx_kernel_ready+0x15>
cmp    $0x81,%esi
jne    114a <__v1_v2_tx_kernel_ready+0x1a>
jmp    1040 <__v1_tx_kernel_ready@plt>
jmp    1030 <__v2_tx_kernel_ready@plt>
push   %rax
xor    %edi,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__v1_v2_tx_kernel_ready(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %13 [
i32 129, label %7
i32 128, label %10
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @__v1_tx_kernel_ready(i8* %8)
store i32 %9, i32* %3
br label %15
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @__v2_tx_kernel_ready(i8* %11)
store i32 %12, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 @assert(i32 0)
store i32 0, i32* %3
br label %15
15: ; preds = %13, %10, %7
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @__v1_v2_tx_kernel_ready(i8* %0, i32 %1) {
switch i32 %1, label %7 [
i32 129, label %3
i32 128, label %5
]
3: ; preds = %2
%4 = tail call i32 @__v1_tx_kernel_ready(i8* %0)
br label %9
5: ; preds = %2
%6 = tail call i32 @__v2_tx_kernel_ready(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @assert(i32 0)
br label %9
9: ; preds = %7, %5, %3
%10 = phi i32 [ 0, %7 ], [ %6, %5 ], [ %4, %3 ]
ret i32 %10
}
int ValArrayDefaultCompareFn(const void *pleft, const void *pright) {
  const int *left = pleft, *right = pright;
  return *left < *right ? -1 : (*left > *right ? 1 : 0);
}


x86 assembly (clang, -O0):
<ValArrayDefaultCompareFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    113b <ValArrayDefaultCompareFn+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <ValArrayDefaultCompareFn+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValArrayDefaultCompareFn>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ValArrayDefaultCompareFn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %25
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp sgt i32 %19, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
br label %25
25: ; preds = %17, %16
%26 = phi i32 [ -1, %16 ], [ %24, %17 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @ValArrayDefaultCompareFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void __attribute__((no)) HEX00_hashesDatInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_hashesDatInit() {
ret void
}
void BIPRO_SuspendThreads() {}


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

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

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

LLVM IR (-O2):
define void @BIPRO_SuspendThreads() {
ret void
}
/* Variables and functions */
int ft_atoi_base(char const *, int);
int /*<<< orphan*/ ft_putchar(char);
int main(int ac, const char **av) {
  int result;
  (void)ac;
  result = ft_atoi_base(av[1], 16);
  ft_putchar('\n');
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x10,%esi
call   1030 <ft_atoi_base@plt>
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x10,%esi
call   1030 <ft_atoi_base@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @ft_atoi_base(i8* %10, i32 16)
store i32 %11, i32* %6
%12 = call i32 @ft_putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @ft_atoi_base(i8* %4, i32 16)
%6 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
_Complex long foo_long(_Complex long x) { return x; }


x86 assembly (clang, -O0):
<foo_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_long>:
mov    %rsi,%rdx
mov    %rdi,%rax
ret

LLVM IR (-O0):
define { i64, i64 } @foo_long(i64 %0, i64 %1) {
%3 = alloca { i64, i64 }
%4 = alloca { i64, i64 }
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 0
%8 = load i64, i64* %7
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %4, i32 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 1
store i64 %8, i64* %11
store i64 %10, i64* %12
%13 = load { i64, i64 }, { i64, i64 }* %3
ret { i64, i64 } %13
}

LLVM IR (-O2):
define { i64, i64 } @foo_long(i64 %0, i64 %1) {
%3 = insertvalue { i64, i64 } poison, i64 %0, 0
%4 = insertvalue { i64, i64 } %3, i64 %1, 1
ret { i64, i64 } %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *f) {
  fprintf(f, "Usage: ethercat_master [options] MASTER_MAC...\n"
             "Options:\n"
             "  -d VALUE  debug level\n"
             "  -b MAC    backup MAC\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x67,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [104 x i8] c"Usage: ethercat_master [options] MASTER_MAC...\0AOptions:\0A -d VALUE debug level\0A -b MAC backup MAC\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [104 x i8] c"Usage: ethercat_master [options] MASTER_MAC...\0AOptions:\0A -d VALUE debug level\0A -b MAC backup MAC\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0), i64 103, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ heap_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  heap_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <heap_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <heap_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @heap_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @heap_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
int expect_taken(int x) {
  if (__builtin_expect(x, 1))
    return 0;
  return x;
}


x86 assembly (clang, -O0):
<expect_taken>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1121 <expect_taken+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1127 <expect_taken+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @expect_taken(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @expect_taken(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoop();
int /*<<< orphan*/ initialize_callbacks();
int /*<<< orphan*/ initialize_glut(int *, char **);
int /*<<< orphan*/ initialize_light();
int /*<<< orphan*/ initialize_matrices();
int /*<<< orphan*/ initialize_textures();
int main(int argc, char **argv) {
  initialize_glut(&argc, argv);
  initialize_callbacks();
  initialize_light();
  initialize_matrices();
  initialize_textures();
  glutMainLoop();
  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    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1060 <initialize_glut@plt>
mov    $0x0,%al
call   1050 <initialize_callbacks@plt>
mov    $0x0,%al
call   1080 <initialize_light@plt>
mov    $0x0,%al
call   1030 <initialize_matrices@plt>
mov    $0x0,%al
call   1070 <initialize_textures@plt>
mov    $0x0,%al
call   1040 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1060 <initialize_glut@plt>
xor    %eax,%eax
call   1050 <initialize_callbacks@plt>
xor    %eax,%eax
call   1080 <initialize_light@plt>
xor    %eax,%eax
call   1030 <initialize_matrices@plt>
xor    %eax,%eax
call   1070 <initialize_textures@plt>
xor    %eax,%eax
call   1040 <glutMainLoop@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 i8**, i8*** %5
%7 = call i32 @initialize_glut(i32* %4, i8** %6)
%8 = call i32 (...) @initialize_callbacks()
%9 = call i32 (...) @initialize_light()
%10 = call i32 (...) @initialize_matrices()
%11 = call i32 (...) @initialize_textures()
%12 = call i32 (...) @glutMainLoop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @initialize_glut(i32* %3, i8** %1)
%5 = call i32 (...) @initialize_callbacks()
%6 = call i32 (...) @initialize_light()
%7 = call i32 (...) @initialize_matrices()
%8 = call i32 (...) @initialize_textures()
%9 = call i32 (...) @glutMainLoop()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct dhcpmsg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_u32_option(struct dhcpmsg *, int, int /*<<< orphan*/);
void add_option_serverid(struct dhcpmsg *packet, uint32_t sid) {
  add_u32_option(packet, 0x36, sid);
}


x86 assembly (clang, -O0):
<add_option_serverid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x36,%esi
call   1030 <add_u32_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_option_serverid>:
mov    %esi,%edx
mov    $0x36,%esi
jmp    1030 <add_u32_option@plt>

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

LLVM IR (-O2):
%struct.dhcpmsg = type { i32 }
define void @add_option_serverid(%struct.dhcpmsg* %0, i32 %1) {
%3 = tail call i32 @add_u32_option(%struct.dhcpmsg* %0, i32 54, i32 %1)
ret void
}
/* Type definitions */
struct random_t {
  int dummy;
};

/* Variables and functions */
float UINT_MAX;
scalar_t__ random_intmax(struct random_t *);
float random_float(struct random_t *r) {
  return (float)random_intmax(r) / UINT_MAX;
}


x86 assembly (clang, -O0):
<random_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <random_intmax@plt>
cvtsi2ss %rax,%xmm0
mov    0x2eb7(%rip),%rax
divss  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float>:
push   %rax
call   1030 <random_intmax@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec6(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.random_t = type { i32 }
@UINT_MAX = global float 0.000000e+00
define float @random_float(%struct.random_t* %0) {
%2 = alloca %struct.random_t*
store %struct.random_t* %0, %struct.random_t** %2
%3 = load %struct.random_t*, %struct.random_t** %2
%4 = call i64 @random_intmax(%struct.random_t* %3)
%5 = sitofp i64 %4 to float
%6 = load float, float* @UINT_MAX
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
%struct.random_t = type { i32 }
@UINT_MAX = global float 0.000000e+00
define float @random_float(%struct.random_t* %0) {
%2 = tail call i64 @random_intmax(%struct.random_t* %0)
%3 = sitofp i64 %2 to float
%4 = load float, float* @UINT_MAX
%5 = fdiv float %3, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ threeDimAccess(int ***, int *);
void f(int ***arr) {
  int x;
  threeDimAccess(arr, &x);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <threeDimAccess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <threeDimAccess@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f(i32*** %0) {
%2 = alloca i32***
%3 = alloca i32
store i32*** %0, i32**** %2
%4 = load i32***, i32**** %2
%5 = call i32 @threeDimAccess(i32*** %4, i32* %3)
ret void
}

LLVM IR (-O2):
define void @f(i32*** %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @threeDimAccess(i32*** %0, i32* %2)
ret void
}
void RTTimeNanoTSLegacySync(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeNanoTSLegacySync() {
ret void
}
/* Variables and functions */
int inputYOrN(int /*<<< orphan*/);
int /*<<< orphan*/ lineBreak();
int /*<<< orphan*/ mainWorkplaceSimLoop(char *);
int /*<<< orphan*/ puts(char *);
void workplaceSim(char *username) {
  int cont;
  puts("Welcome to Workplace Simulator 2015!");
  cont = inputYOrN(0);
  lineBreak();
  while (cont) {
    mainWorkplaceSimLoop(username);
    lineBreak();
    cont = inputYOrN(0);
  }
}


x86 assembly (clang, -O0):
<workplaceSim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <inputYOrN@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <lineBreak@plt>
cmpl   $0x0,-0xc(%rbp)
je     1192 <workplaceSim+0x52>
mov    -0x8(%rbp),%rdi
call   1050 <mainWorkplaceSimLoop@plt>
mov    $0x0,%al
call   1060 <lineBreak@plt>
xor    %edi,%edi
call   1030 <inputYOrN@plt>
mov    %eax,-0xc(%rbp)
jmp    1169 <workplaceSim+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workplaceSim>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <inputYOrN@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <lineBreak@plt>
test   %ebp,%ebp
je     118a <workplaceSim+0x4a>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <mainWorkplaceSimLoop@plt>
xor    %eax,%eax
call   1060 <lineBreak@plt>
xor    %edi,%edi
call   1030 <inputYOrN@plt>
test   %eax,%eax
jne    1170 <workplaceSim+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Welcome to Workplace Simulator 2015!\00"
define void @workplaceSim(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @inputYOrN(i32 0)
store i32 %5, i32* %3
%6 = call i32 (...) @lineBreak()
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = call i32 @mainWorkplaceSimLoop(i8* %11)
%13 = call i32 (...) @lineBreak()
%14 = call i32 @inputYOrN(i32 0)
store i32 %14, i32* %3
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Welcome to Workplace Simulator 2015!\00"
define void @workplaceSim(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @inputYOrN(i32 0)
%4 = tail call i32 (...) @lineBreak()
%5 = icmp eq i32 %3, 0
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = tail call i32 @mainWorkplaceSimLoop(i8* %0)
%8 = tail call i32 (...) @lineBreak()
%9 = tail call i32 @inputYOrN(i32 0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cos(int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopNumber();
int /*<<< orphan*/ wStackPushNumber(int /*<<< orphan*/);
void wBuiltinCos() { wStackPushNumber(cos(wStackPopNumber())); }


x86 assembly (clang, -O0):
<wBuiltinCos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mov    %eax,%edi
call   1040 <wStackPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinCos>:
push   %rax
xor    %eax,%eax
call   1030 <wStackPopNumber@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <wStackPushNumber@plt>

LLVM IR (-O0):
define void @wBuiltinCos() {
%1 = call i32 (...) @wStackPopNumber()
%2 = call i32 @cos(i32 %1)
%3 = call i32 @wStackPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBuiltinCos() {
%1 = tail call i32 (...) @wStackPopNumber()
%2 = tail call i32 @cos(i32 %1)
%3 = tail call i32 @wStackPushNumber(i32 %2)
ret void
}
/* Variables and functions */
long simple_rand();
int rand_255(void) {
  long int temp = 256;
  while (temp > 255) {
    temp = simple_rand();
    temp %= 257;
  }
  return temp;
}


x86 assembly (clang, -O0):
<rand_255>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x100,-0x8(%rbp)
cmpq   $0xff,-0x8(%rbp)
jle    1150 <rand_255+0x40>
mov    $0x0,%al
call   1030 <simple_rand@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x101,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
jmp    1120 <rand_255+0x10>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_255>:
push   %rbx
movabs $0x7f807f807f807f81,%rbx
7f 80 7f
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <simple_rand@plt>
mov    %rax,%rcx
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,%rax
shl    $0x8,%rax
add    %rdx,%rax
sub    %rax,%rcx
cmp    $0xff,%rcx
jg     1120 <rand_255+0x10>
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rand_255() {
%1 = alloca i64
store i64 256, i64* %1
br label %2
2: ; preds = %5, %0
%3 = load i64, i64* %1
%4 = icmp sgt i64 %3, 255
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = call i64 (...) @simple_rand()
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = srem i64 %7, 257
store i64 %8, i64* %1
br label %2
9: ; preds = %2
%10 = load i64, i64* %1
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_255() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 (...) @simple_rand()
%3 = srem i64 %2, 257
%4 = icmp sgt i64 %3, 255
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = trunc i64 %3 to i32
ret i32 %6
}
/* Variables and functions */
double log_bino_d(int, int);
double log_binomial_d(int a, int b) {
  if (b > a / 2)
    return log_bino_d(a, a - b);
  if (b < 0)
    return -(1.0 / 0.0);
  return log_bino_d(a, b);
}


x86 assembly (clang, -O0):
<log_binomial_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jle    1154 <log_binomial_d+0x44>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <log_bino_d@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <log_binomial_d+0x70>
cmpl   $0x0,-0x10(%rbp)
jge    1170 <log_binomial_d+0x60>
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <log_binomial_d+0x70>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <log_bino_d@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_binomial_d>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
cmp    %esi,%eax
jge    1125 <log_binomial_d+0x15>
mov    %edi,%eax
sub    %esi,%eax
mov    %eax,%esi
jmp    1129 <log_binomial_d+0x19>
test   %esi,%esi
js     112e <log_binomial_d+0x1e>
jmp    1030 <log_bino_d@plt>
movsd  0xeca(%rip),%xmm0
ret

LLVM IR (-O0):
define double @log_binomial_d(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 2
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = call double @log_bino_d(i32 %11, i32 %14)
store double %15, double* %3
br label %24
16: ; preds = %2
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
store double 0xFFF0000000000000, double* %3
br label %24
20: ; preds = %16
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call double @log_bino_d(i32 %21, i32 %22)
store double %23, double* %3
br label %24
24: ; preds = %20, %19, %10
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @log_binomial_d(i32 %0, i32 %1) {
%3 = sdiv i32 %0, 2
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 %0, %1
br label %9
7: ; preds = %2
%8 = icmp slt i32 %1, 0
br i1 %8, label %12, label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %1, %7 ]
%11 = tail call double @log_bino_d(i32 %0, i32 %10)
br label %12
12: ; preds = %9, %7
%13 = phi double [ 0xFFF0000000000000, %7 ], [ %11, %9 ]
ret double %13
}