xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FileProxy_WriteFile(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
int FileProxy_WriteVersionTxt(char *filename, char *verstr, char *vername) {
  char buf[(1024U)] = {0};
  sprintf(buf, "%s", verstr);
  FileProxy_WriteFile(filename, buf, strlen(buf));
  return (0);
}


x86 assembly (clang, -O0):
<FileProxy_WriteVersionTxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x430(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x430(%rbp),%rdi
mov    -0x428(%rbp),%rsi
mov    %eax,%edx
call   1050 <FileProxy_WriteFile@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileProxy_WriteVersionTxt>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1060 <FileProxy_WriteFile@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @FileProxy_WriteVersionTxt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [1024 x i8]* %7 to i8*
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = load i8*, i8** %5
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @FileProxy_WriteFile(i8* %12, i8* %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @FileProxy_WriteVersionTxt(i8* %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i8* @strcpy(i8* %5, i8* dereferenceable(1) %1)
%7 = call i32 @strlen(i8* %5)
%8 = call i32 @FileProxy_WriteFile(i8* %0, i8* %5, i32 %7)
ret i32 0
}
void host_sound_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @host_sound_stop() {
ret void
}
/* Variables and functions */
scalar_t__ M_PI;
float cos(scalar_t__);
float sine_custom_io(float step, float max_steps, float max_val) {
  return max_val * cos((6.28318530718f * step / max_steps) + M_PI) + max_val;
}


x86 assembly (clang, -O0):
<sine_custom_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
mov    0x2e9e(%rip),%rax
cvtsi2ssq (%rax),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine_custom_io>:
push   %rax
movss  %xmm2,0x4(%rsp)
mulss  0xee1(%rip),%xmm0
mov    0x2ec2(%rip),%rax
xorps  %xmm2,%xmm2
cvtsi2ssq (%rax),%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
cvttss2si %xmm2,%rdi
call   1030 <cos@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @sine_custom_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fmul float 0x401921FB60000000, %8
%10 = load float, float* %5
%11 = fdiv float %9, %10
%12 = load i64, i64* @M_PI
%13 = sitofp i64 %12 to float
%14 = fadd float %11, %13
%15 = fptosi float %14 to i64
%16 = call float @cos(i64 %15)
%17 = load float, float* %6
%18 = call float @llvm.fmuladd.f32(float %7, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @sine_custom_io(float %0, float %1, float %2) {
%4 = fmul float %0, 0x401921FB60000000
%5 = fdiv float %4, %1
%6 = load i64, i64* @M_PI
%7 = sitofp i64 %6 to float
%8 = fadd float %5, %7
%9 = fptosi float %8 to i64
%10 = tail call float @cos(i64 %9)
%11 = tail call float @llvm.fmuladd.f32(float %2, float %10, float %2)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int main() {
  for (;;)
    fork();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fork@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @fork()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @fork()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void vga_mode(int mode) {
  outb(0x05, 0x3ce);
  outb(mode, 0x3cf);
}


x86 assembly (clang, -O0):
<vga_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3cf,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_mode>:
push   %rbx
mov    %edi,%ebx
mov    $0x5,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3cf,%esi
pop    %rbx
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @vga_mode(i32 %0) {
%2 = tail call i32 @outb(i32 5, i32 974)
%3 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = y;
    y--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1151 <main+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
char *_getenvp();
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
char *mon_getenvp(void) {
  char *ret;
  monLock();
  ret = _getenvp();
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_getenvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <monLock@plt>
mov    $0x0,%al
call   1050 <_getenvp@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_getenvp>:
push   %rbx
xor    %eax,%eax
call   1030 <monLock@plt>
xor    %eax,%eax
call   1050 <_getenvp@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mon_getenvp() {
%1 = alloca i8*
%2 = call i32 (...) @monLock()
%3 = call i8* (...) @_getenvp()
store i8* %3, i8** %1
%4 = call i32 (...) @monUnlock()
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @mon_getenvp() {
%1 = tail call i32 (...) @monLock()
%2 = tail call i8* (...) @_getenvp()
%3 = tail call i32 (...) @monUnlock()
ret i8* %2
}
/* Variables and functions */
int f421(int *);
int f422(int *p) { return f421(p); }


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

x86 assembly (clang, -O2):
<f422>:
jmp    1030 <f421@plt>

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

LLVM IR (-O2):
define i32 @f422(i32* %0) {
%2 = tail call i32 @f421(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ OS_TaskRegister();
void task_13(void) {
  OS_TaskRegister();
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<task_13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OS_TaskRegister@plt>
jmp    111b <task_13+0xb>

x86 assembly (clang, -O2):
<task_13>:
push   %rax
xor    %eax,%eax
call   1030 <OS_TaskRegister@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <task_13+0x10>

LLVM IR (-O0):
define void @task_13() {
%1 = call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @task_13() {
%1 = tail call i32 (...) @OS_TaskRegister()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ compileFile(char *);
int /*<<< orphan*/ free(void *);
char *getString();
void IF_LoadCS(void) {
  char *f;
  f = getString();
  if (f != NULL) {
    compileFile(f);
    free((void *)f);
  }
}


x86 assembly (clang, -O0):
<IF_LoadCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <IF_LoadCS+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <compileFile@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_LoadCS>:
push   %rbx
xor    %eax,%eax
call   1030 <getString@plt>
test   %rax,%rax
je     1151 <IF_LoadCS+0x21>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <compileFile@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @IF_LoadCS() {
%1 = alloca i8*
%2 = call i8* (...) @getString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @compileFile(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @IF_LoadCS() {
%1 = tail call i8* (...) @getString()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @compileFile(i8* %1)
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %3, %0
ret void
}
int fun544() { return 544; }


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

x86 assembly (clang, -O2):
<fun544>:
mov    $0x220,%eax
ret

LLVM IR (-O0):
define i32 @fun544() {
ret i32 544
}

LLVM IR (-O2):
define i32 @fun544() {
ret i32 544
}
int d_ble_cr1(double a1) { return (__builtin_islessequal(100, a1)); }


x86 assembly (clang, -O0):
<d_ble_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_cr1>:
xor    %eax,%eax
ucomisd 0xef6(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_ble_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_ble_cr1(double %0) {
%2 = fcmp oge double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
int f_i6(int i0, int i1, int i2, int i3, int i4, int i5) { return i5; }


x86 assembly (clang, -O0):
<f_i6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i6>:
mov    %r9d,%eax
ret

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

LLVM IR (-O2):
define i32 @f_i6(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 returned %5) {
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ M3_profile(int, int /*<<< orphan*/ *, int);
void M3_ProfileStop(int sectionID) {
#pragma omp master
  { M3_profile(sectionID, NULL, 3); }
}


x86 assembly (clang, -O0):
<M3_ProfileStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x3,%edx
call   1030 <M3_profile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M3_ProfileStop>:
xor    %esi,%esi
mov    $0x3,%edx
jmp    1030 <M3_profile@plt>

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

LLVM IR (-O2):
define void @M3_ProfileStop(i32 %0) {
%2 = tail call i32 @M3_profile(i32 %0, i32* null, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t n) {
  void *p;
  p = realloc(ptr, n);
  if (p == NULL)
    fatal("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct fdp1_context {
  int dummy;
};

/* Variables and functions */
scalar_t__ fdp1_stream_on(struct fdp1_context *);
scalar_t__ fdp1_test_m2m_object(struct fdp1_context *);
int fdp1_stream_on_tests(struct fdp1_context *fdp1) {
  unsigned int fail = 0;
  fail += fdp1_test_m2m_object(fdp1);
  fail += fdp1_stream_on(fdp1);
  return fail;
}


x86 assembly (clang, -O0):
<fdp1_stream_on_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fdp1_test_m2m_object@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fdp1_stream_on@plt>
mov    %rax,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdp1_stream_on_tests>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fdp1_test_m2m_object@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fdp1_stream_on@plt>
add    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_stream_on_tests(%struct.fdp1_context* %0) {
%2 = alloca %struct.fdp1_context*
%3 = alloca i32
store %struct.fdp1_context* %0, %struct.fdp1_context** %2
store i32 0, i32* %3
%4 = load %struct.fdp1_context*, %struct.fdp1_context** %2
%5 = call i64 @fdp1_test_m2m_object(%struct.fdp1_context* %4)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load %struct.fdp1_context*, %struct.fdp1_context** %2
%11 = call i64 @fdp1_stream_on(%struct.fdp1_context* %10)
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.fdp1_context = type { i32 }
define i32 @fdp1_stream_on_tests(%struct.fdp1_context* %0) {
%2 = tail call i64 @fdp1_test_m2m_object(%struct.fdp1_context* %0)
%3 = tail call i64 @fdp1_stream_on(%struct.fdp1_context* %0)
%4 = add i64 %3, %2
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _glapi_set_dispatch(int /*<<< orphan*/);
void __glCoreNopDispatch(void) { _glapi_set_dispatch(0); }


x86 assembly (clang, -O0):
<__glCoreNopDispatch>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_glapi_set_dispatch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glCoreNopDispatch>:
xor    %edi,%edi
jmp    1030 <_glapi_set_dispatch@plt>

LLVM IR (-O0):
define void @__glCoreNopDispatch() {
%1 = call i32 @_glapi_set_dispatch(i32 0)
ret void
}

LLVM IR (-O2):
define void @__glCoreNopDispatch() {
%1 = tail call i32 @_glapi_set_dispatch(i32 0)
ret void
}
int md5_self_test(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @md5_self_test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ stderr;
void *l9p_calloc(size_t n, size_t size) {
  void *r = calloc(n, size);
  if (r == NULL) {
    fprintf(stderr, "cannot allocate %zd bytes: out of memory\n", n * size);
    abort();
  }
  return (r);
}


x86 assembly (clang, -O0):
<l9p_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1181 <l9p_calloc+0x51>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l9p_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     114c <l9p_calloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
imul   %rbx,%r14
lea    0xea0(%rip),%rsi
mov    %r14,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"cannot allocate %zd bytes: out of memory\0A\00"
define i8* @l9p_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = mul i64 %13, %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"cannot allocate %zd bytes: out of memory\0A\00"
define noalias i8* @l9p_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = mul i64 %1, %0
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int build_niquery(int /*<<< orphan*/ *, struct in6_addr *, int);
int send_probe(int, int /*<<< orphan*/ *, struct in6_addr *, int,
               int /*<<< orphan*/);
int query_name(int sock, uint8_t *buf, struct in6_addr *addr) {
  int cc;
  cc = build_niquery(buf, addr, 2);
  return send_probe(sock, buf, addr, cc, 0);
}


x86 assembly (clang, -O0):
<query_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1040 <build_niquery@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <send_probe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_name>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x2,%edx
call   1040 <build_niquery@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <send_probe@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
define i32 @query_name(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.in6_addr*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.in6_addr* %2, %struct.in6_addr** %6
%8 = load i32*, i32** %5
%9 = load %struct.in6_addr*, %struct.in6_addr** %6
%10 = call i32 @build_niquery(i32* %8, %struct.in6_addr* %9, i32 2)
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = load %struct.in6_addr*, %struct.in6_addr** %6
%14 = load i32, i32* %7
%15 = call i32 @send_probe(i32 %11, i32* %12, %struct.in6_addr* %13, i32 %14, i32 0)
ret i32 %15
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @query_name(i32 %0, i32* %1, %struct.in6_addr* %2) {
%4 = tail call i32 @build_niquery(i32* %1, %struct.in6_addr* %2, i32 2)
%5 = tail call i32 @send_probe(i32 %0, i32* %1, %struct.in6_addr* %2, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
scalar_t__ BRBIP39Decode(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         char const **, char const *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int BRBIP39PhraseIsValid(const char *wordList[], const char *phrase) {
  assert(wordList != NULL);
  assert(phrase != NULL);
  return (BRBIP39Decode(NULL, 0, wordList, phrase) > 0);
}


x86 assembly (clang, -O0):
<BRBIP39PhraseIsValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <BRBIP39Decode@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BRBIP39PhraseIsValid>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <BRBIP39Decode@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @BRBIP39PhraseIsValid(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 = icmp ne i8** %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %4
%15 = call i64 @BRBIP39Decode(i32* null, i32 0, i8** %13, i8* %14)
%16 = icmp sgt i64 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @BRBIP39PhraseIsValid(i8** %0, i8* %1) {
%3 = icmp ne i8** %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i64 @BRBIP39Decode(i32* null, i32 0, i8** %0, i8* %1)
%10 = icmp sgt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
int cubeByValue(int n) { return n * n * n; }


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

x86 assembly (clang, -O2):
<cubeByValue>:
mov    %edi,%eax
imul   %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @cubeByValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cubeByValue(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ _buf_get_pos(int /*<<< orphan*/ *);
long int ftell(FILE *stream) {
  if (NULL == stream) {
    return -1;
  }
  return (long int)_buf_get_pos(stream);
}


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1135 <ftell+0x25>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1142 <ftell+0x32>
mov    -0x10(%rbp),%rdi
call   1030 <_buf_get_pos@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
test   %rdi,%rdi
je     111a <ftell+0xa>
jmp    1030 <_buf_get_pos@plt>
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @ftell(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @_buf_get_pos(i32* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ -1, %1 ]
ret i64 %6
}
int freqToIndex(int freq, int len, int rate) {
  return ((unsigned int)(freq * len)) / (unsigned int)rate;
}


x86 assembly (clang, -O0):
<freqToIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<freqToIndex>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i32 @freqToIndex(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 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = udiv i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @freqToIndex(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = udiv i32 %4, %2
ret i32 %5
}
int Int_dec(int x) { return x - 1; }


x86 assembly (clang, -O0):
<Int_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_dec>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @Int_dec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @Int_dec(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
void INT_Excep_SCI7_TXI7(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI7_TXI7() {
ret void
}
unsigned long task_io_get_inblock(const struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i64 @task_io_get_inblock(%struct.task_struct* nocapture readnone %0) {
ret i64 0
}
int do_622() { return 622; }


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

x86 assembly (clang, -O2):
<do_622>:
mov    $0x26e,%eax
ret

LLVM IR (-O0):
define i32 @do_622() {
ret i32 622
}

LLVM IR (-O2):
define i32 @do_622() {
ret i32 622
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void space(int s) {
  while (s--)
    putchar(' ');
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <space+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <space+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbx
test   %edi,%edi
je     112f <space+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <space+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @space(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int isatty(int fd) {
  if (fd >= 0 && fd <= 2)
    return 1;
  errno = EBADF;
  return 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <isatty+0x27>
cmpl   $0x2,-0x8(%rbp)
jg     1127 <isatty+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1140 <isatty+0x40>
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
mov    $0x1,%eax
cmp    $0x3,%edi
jb     111e <isatty+0x1e>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2ec6(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %12
10: ; preds = %6, %1
%11 = load i32, i32* @EBADF
store i32 %11, i32* @errno
store i32 0, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @isatty(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @EBADF
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int tuner_ctrl_deselect(void *, int);
int bbm_com_i2c_deinit(void *handle) {
  int res;
  res = tuner_ctrl_deselect(handle, 0x5f04);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_i2c_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
call   1030 <tuner_ctrl_deselect@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_i2c_deinit>:
mov    $0x5f04,%esi
jmp    1030 <tuner_ctrl_deselect@plt>

LLVM IR (-O0):
define i32 @bbm_com_i2c_deinit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @tuner_ctrl_deselect(i8* %4, i32 24324)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bbm_com_i2c_deinit(i8* %0) {
%2 = tail call i32 @tuner_ctrl_deselect(i8* %0, i32 24324)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main(void) {
  test();
  printf("All tests passed\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"All tests passed\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"All tests passed\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void initGLFunctions() {}


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

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

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

LLVM IR (-O2):
define void @initGLFunctions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access_counter(unsigned int *, unsigned int *);
int sample_index() {
  unsigned hi, lo;
  access_counter(&hi, &lo);
  return lo % 50000;
}


x86 assembly (clang, -O0):
<sample_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <access_counter@plt>
mov    -0x8(%rbp),%eax
mov    $0xc350,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_index>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <access_counter@plt>
mov    (%rsp),%eax
mov    %eax,%ecx
shr    $0x4,%ecx
imul   $0xa7c5ac5,%rcx,%rcx
shr    $0x27,%rcx
imul   $0xc350,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sample_index() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @access_counter(i32* %1, i32* %2)
%4 = load i32, i32* %2
%5 = urem i32 %4, 50000
ret i32 %5
}

LLVM IR (-O2):
define i32 @sample_index() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @access_counter(i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = urem i32 %6, 50000
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ decToBin(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int d;
  puts("Enter a number:");
  scanf("%d", &d);
  printf("%ld", decToBin(d));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <decToBin@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <decToBin@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @decToBin(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a number:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @decToBin(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int fun860() { return 860; }


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

x86 assembly (clang, -O2):
<fun860>:
mov    $0x35c,%eax
ret

LLVM IR (-O0):
define i32 @fun860() {
ret i32 860
}

LLVM IR (-O2):
define i32 @fun860() {
ret i32 860
}
/* Variables and functions */
int rand();
int random_double() {
  int x = rand() % 255 + 1;
  return x;
}


x86 assembly (clang, -O0):
<random_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_double>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
sub    %edx,%ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_double() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 255
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @random_double() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 255
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int memory_chunk_slot(size_t size) {
  int n = -1;
  while (size > 0) {
    ++n;
    size /= 2;
  }
  return n;
}


x86 assembly (clang, -O0):
<memory_chunk_slot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1134 <memory_chunk_slot+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <memory_chunk_slot+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_chunk_slot>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111f <memory_chunk_slot+0x1f>
mov    %rdi,%rcx
nopl   (%rax)
add    $0x1,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <memory_chunk_slot+0x10>
ret

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

LLVM IR (-O2):
define i32 @memory_chunk_slot(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ -1, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %10
}
__typeof__(scanf((void *)1)) test_scanf_216(void) { return scanf((void *)1); }


x86 assembly (clang, -O0):
<test_scanf_216>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <scanf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scanf_216>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <scanf@plt>

LLVM IR (-O0):
define i32 @test_scanf_216() {
%1 = call i32 (i8*, ...) @scanf(i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_scanf_216() {
%1 = tail call i32 (i8*, ...) @scanf(i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t now() {
  time_t t;
  time(&t);
  mktime(gmtime(&t));
  return t;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <time@plt>
lea    -0x4(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %eax,%edi
call   1040 <mktime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <time@plt>
mov    %rbx,%rdi
call   1050 <gmtime@plt>
mov    %eax,%edi
call   1040 <mktime@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @now() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i32 @gmtime(i32* %1)
%4 = call i32 @mktime(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @now() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i32 @gmtime(i32* %1)
%5 = call i32 @mktime(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int produire() {
  int res;
  res = rand();
  printf("J'ai produit %d\n", res);
  return res;
}


x86 assembly (clang, -O0):
<produire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<produire>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"J'ai produit %d\0A\00"
define i32 @produire() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"J'ai produit %d\0A\00"
define i32 @produire() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %1
}
/* Variables and functions */
unsigned long long get_systime();
void delayMicroseconds(unsigned int us) {
  unsigned long long int alermTime;
  alermTime = get_systime() + us;
  while (get_systime() < alermTime)
    ;
  return;
}


x86 assembly (clang, -O0):
<delayMicroseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_systime@plt>
mov    -0x4(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <get_systime@plt>
cmp    -0x10(%rbp),%rax
jae    1142 <delayMicroseconds+0x32>
jmp    112c <delayMicroseconds+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMicroseconds>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_systime@plt>
mov    %ebx,%ebx
add    %rax,%rbx
nop
xor    %eax,%eax
call   1030 <get_systime@plt>
cmp    %rbx,%rax
jb     1120 <delayMicroseconds+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delayMicroseconds(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @get_systime()
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
store i64 %7, i64* %3
br label %8
8: ; preds = %12, %1
%9 = call i64 (...) @get_systime()
%10 = load i64, i64* %3
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @delayMicroseconds(i32 %0) {
%2 = tail call i64 (...) @get_systime()
%3 = zext i32 %0 to i64
%4 = add i64 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i64 (...) @get_systime()
%7 = icmp ult i64 %6, %4
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}