xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR93_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR93_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR93_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x = rand();
  x *= -5;
  return x + 45;
}


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    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
imul   $0xfffffffb,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2d,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    (%rax,%rax,4),%ecx
mov    $0x2d,%eax
sub    %ecx,%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 = call i32 (...) @rand()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = mul nsw i32 %8, -5
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 45
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = mul nsw i32 %3, -5
%5 = add nsw i32 %4, 45
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ playGame();
int main(int argc, char *argv[]) {
  playGame();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <playGame@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 = call i32 (...) @playGame()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @playGame()
ret i32 0
}
int do_798() { return 798; }


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

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

LLVM IR (-O0):
define i32 @do_798() {
ret i32 798
}

LLVM IR (-O2):
define i32 @do_798() {
ret i32 798
}
/* Type definitions */
struct slPair {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slPairFreeList(struct slPair **);
int /*<<< orphan*/ slPairFreeValsExt(struct slPair *, void (*)());
void slPairFreeValsAndListExt(struct slPair **pList, void (*freeFunc)()) {
  if (pList)
    slPairFreeValsExt(*pList, freeFunc);
  slPairFreeList(pList);
}


x86 assembly (clang, -O0):
<slPairFreeValsAndListExt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <slPairFreeValsAndListExt+0x2b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <slPairFreeValsExt@plt>
mov    -0x8(%rbp),%rdi
call   1040 <slPairFreeList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slPairFreeValsAndListExt>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1131 <slPairFreeValsAndListExt+0x11>
mov    (%rbx),%rdi
call   1030 <slPairFreeValsExt@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <slPairFreeList@plt>

LLVM IR (-O0):
%struct.slPair = type { i32 }
define void @slPairFreeValsAndListExt(%struct.slPair** %0, void (...)* %1) {
%3 = alloca %struct.slPair**
%4 = alloca void (...)*
store %struct.slPair** %0, %struct.slPair*** %3
store void (...)* %1, void (...)** %4
%5 = load %struct.slPair**, %struct.slPair*** %3
%6 = icmp ne %struct.slPair** %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load %struct.slPair**, %struct.slPair*** %3
%9 = load %struct.slPair*, %struct.slPair** %8
%10 = load void (...)*, void (...)** %4
%11 = call i32 @slPairFreeValsExt(%struct.slPair* %9, void (...)* %10)
br label %12
12: ; preds = %7, %2
%13 = load %struct.slPair**, %struct.slPair*** %3
%14 = call i32 @slPairFreeList(%struct.slPair** %13)
ret void
}

LLVM IR (-O2):
%struct.slPair = type { i32 }
define void @slPairFreeValsAndListExt(%struct.slPair** %0, void (...)* %1) {
%3 = icmp eq %struct.slPair** %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load %struct.slPair*, %struct.slPair** %0
%6 = tail call i32 @slPairFreeValsExt(%struct.slPair* %5, void (...)* %1)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 @slPairFreeList(%struct.slPair** %0)
ret void
}
float test_cargf(_Complex float x) { return __builtin_cargf(x); }


x86 assembly (clang, -O0):
<test_cargf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cargf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cargf>:
jmp    1030 <cargf@plt>

LLVM IR (-O0):
define float @test_cargf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %3 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
%13 = call float @cargf(<2 x float> %12)
ret float %13
}

LLVM IR (-O2):
define float @test_cargf(<2 x float> %0) {
%2 = tail call float @cargf(<2 x float> %0)
ret float %2
}
int GasGaugeTimerFinished(void) {
  static unsigned int i = 1;
  i--;
  if (i == 0) {
    i = 0x5000;
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<GasGaugeTimerFinished>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2f0d(%rip)
cmpl   $0x0,0x2f06(%rip)
jne    1136 <GasGaugeTimerFinished+0x36>
movl   $0x5000,0x2ef6(%rip)
movl   $0x1,-0x4(%rbp)
jmp    113d <GasGaugeTimerFinished+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GasGaugeTimerFinished>:
mov    0x2f1a(%rip),%ecx
xor    %eax,%eax
add    $0xffffffff,%ecx
sete   %al
mov    $0x5000,%edx
cmovne %ecx,%edx
mov    %edx,0x2f04(%rip)
ret

LLVM IR (-O0):
@GasGaugeTimerFinished.i = internal global i32 1
define i32 @GasGaugeTimerFinished() {
%1 = alloca i32
%2 = load i32, i32* @GasGaugeTimerFinished.i
%3 = add i32 %2, -1
store i32 %3, i32* @GasGaugeTimerFinished.i
%4 = load i32, i32* @GasGaugeTimerFinished.i
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 20480, i32* @GasGaugeTimerFinished.i
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@GasGaugeTimerFinished.i = internal unnamed_addr global i32 1
define i32 @GasGaugeTimerFinished() {
%1 = load i32, i32* @GasGaugeTimerFinished.i
%2 = add i32 %1, -1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 20480, i32 %2
store i32 %4, i32* @GasGaugeTimerFinished.i
%5 = zext i1 %3 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void togo_exit() { exit(1); }


x86 assembly (clang, -O0):
<togo_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<togo_exit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @togo_exit() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @togo_exit() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
double reg_dtheta(double theta, double ang) {
  double rang = ang - theta;
  if (rang < -180.0)
    rang += 360.0;
  if (rang > 180.0)
    rang -= 360.0;
  return rang;
}


x86 assembly (clang, -O0):
<reg_dtheta>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1142 <reg_dtheta+0x42>
movsd  0xed0(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116f <reg_dtheta+0x6f>
movsd  -0x18(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_dtheta>:
subsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
cmpltsd 0xeeb(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movsd  0xedf(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xedb(%rip),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @reg_dtheta(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fcmp olt double %3, -1.800000e+02
%5 = fadd double %3, 3.600000e+02
%6 = select i1 %4, double %5, double %3
%7 = fcmp ogt double %6, 1.800000e+02
%8 = fadd double %6, -3.600000e+02
%9 = select i1 %7, double %8, double %6
ret double %9
}
int h_char(const void *key) { return *(const char *)key % 11; }


x86 assembly (clang, -O0):
<h_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_char>:
movsbl (%rdi),%eax
imul   $0xffffffbb,%eax,%ecx
shr    $0x8,%ecx
add    %al,%cl
mov    %ecx,%edx
shr    $0x7,%dl
sar    $0x3,%cl
add    %dl,%cl
movzbl %cl,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,2),%ecx
sub    %cl,%al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @h_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = srem i32 %5, 11
ret i32 %6
}

LLVM IR (-O2):
define i32 @h_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = srem i8 %2, 11
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int yyerror(char *message) { printf("%s\n", message); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
int dcomp(d1, d2)
double *d1, *d2;
{
  if (*d1 >= *d2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<dcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jb     112e <dcomp+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <dcomp+0x35>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcomp>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @dcomp(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = fcmp oge double %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @dcomp(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ult double %3, %4
%6 = select i1 %5, i32 -1, i32 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void save_game() { printf("Clock:"); }


x86 assembly (clang, -O0):
<save_game>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"Clock:\00"
define void @save_game() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Clock:\00"
define void @save_game() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aztSendCmd(int);
int /*<<< orphan*/ sten_low();
void aztCloseDoor(void) {
  {
    aztSendCmd(97);
    sten_low();
    return;
  }
}


x86 assembly (clang, -O0):
<aztCloseDoor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <aztSendCmd@plt>
mov    $0x0,%al
call   1040 <sten_low@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aztCloseDoor>:
push   %rax
mov    $0x61,%edi
call   1030 <aztSendCmd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sten_low@plt>

LLVM IR (-O0):
define void @aztCloseDoor() {
%1 = call i32 @aztSendCmd(i32 97)
%2 = call i32 (...) @sten_low()
ret void
}

LLVM IR (-O2):
define void @aztCloseDoor() {
%1 = tail call i32 @aztSendCmd(i32 97)
%2 = tail call i32 (...) @sten_low()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x8_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x8_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x8_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x8_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x8_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ munmap(int /*<<< orphan*/ *, int);
size_t sysconf(int /*<<< orphan*/);
void xh_unmmap(uint8_t *vaddr, size_t length) {
  uint32_t page_offset = (size_t)vaddr % sysconf(_SC_PAGESIZE);
  munmap(vaddr - page_offset, length + page_offset);
}


x86 assembly (clang, -O0):
<xh_unmmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %eax,%esi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xh_unmmap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     114e <xh_unmmap+0x2e>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
jmp    1154 <xh_unmmap+0x34>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
movslq %edx,%rsi
lea    0x0(,%rsi,4),%rax
sub    %rax,%rbx
add    %r14d,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <munmap@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define void @xh_unmmap(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i64
%8 = load i32, i32* @_SC_PAGESIZE
%9 = call i64 @sysconf(i32 %8)
%10 = urem i64 %7, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = sub i64 0, %14
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i64, i64* %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = add i64 %17, %19
%21 = trunc i64 %20 to i32
%22 = call i32 @munmap(i32* %16, i32 %21)
ret void
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define void @xh_unmmap(i32* %0, i64 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = load i32, i32* @_SC_PAGESIZE
%5 = tail call i64 @sysconf(i32 %4)
%6 = urem i64 %3, %5
%7 = shl i64 %6, 32
%8 = ashr exact i64 %7, 32
%9 = sub nsw i64 0, %8
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = add i64 %6, %1
%12 = trunc i64 %11 to i32
%13 = tail call i32 @munmap(i32* %10, i32 %12)
ret void
}
int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source,
                                     unsigned int size) {
  return 0;
}


x86 assembly (clang, -O0):
<memcpy_from_eeprom_with_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @memcpy_from_eeprom_with_checksum(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @memcpy_from_eeprom_with_checksum(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int sysfs_modify_freq_policy_max(unsigned int, unsigned long);
int cpufreq_modify_policy_max(unsigned int cpu, unsigned long max_freq) {
  return sysfs_modify_freq_policy_max(cpu, max_freq);
}


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

x86 assembly (clang, -O2):
<cpufreq_modify_policy_max>:
jmp    1030 <sysfs_modify_freq_policy_max@plt>

LLVM IR (-O0):
define i32 @cpufreq_modify_policy_max(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = call i32 @sysfs_modify_freq_policy_max(i32 %5, i64 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cpufreq_modify_policy_max(i32 %0, i64 %1) {
%3 = tail call i32 @sysfs_modify_freq_policy_max(i32 %0, i64 %1)
ret i32 %3
}
void bu_compile_eq(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 2)
    goto er;
  EMIT1ATM("EQ");
  EMITEND();
  return;
er:
  cerror("eq: wrong # of args", args);
}


x86 assembly (clang, -O0):
<bu_compile_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <bu_compile_arg_list@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1169 <bu_compile_eq+0x29>
jmp    1183 <bu_compile_eq+0x43>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <EMIT1ATM@plt>
mov    $0x0,%al
call   1030 <EMITEND@plt>
jmp    1195 <bu_compile_eq+0x55>
mov    -0x8(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <cerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_compile_eq>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <bu_compile_arg_list@plt>
cmp    $0x2,%eax
jne    1166 <bu_compile_eq+0x26>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1050 <EMIT1ATM@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <EMITEND@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1060 <cerror@plt>

LLVM IR (-O0):
%struct.conscell = type opaque
@.str = [3 x i8] c"EQ\00"
@.str.1 = [20 x i8] c"eq: wrong # of args\00"
define void @bu_compile_eq(%struct.conscell* %0) {
%2 = alloca %struct.conscell*
%3 = alloca i32
store %struct.conscell* %0, %struct.conscell** %2
%4 = load %struct.conscell*, %struct.conscell** %2
%5 = call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @EMITEND()
br label %15
12: ; preds = %8
%13 = load %struct.conscell*, %struct.conscell** %2
%14 = call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %13)
br label %15
15: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
%struct.conscell = type opaque
@.str = [3 x i8] c"EQ\00"
@.str.1 = [20 x i8] c"eq: wrong # of args\00"
define void @bu_compile_eq(%struct.conscell* %0) {
%2 = tail call i32 (%struct.conscell*, ...) bitcast (i32 (...)* @bu_compile_arg_list to i32 (%struct.conscell*, ...)*)(%struct.conscell* %0)
%3 = icmp eq i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @EMIT1ATM to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @EMITEND()
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, %struct.conscell*, ...) bitcast (i32 (...)* @cerror to i32 (i8*, %struct.conscell*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.conscell* %0)
br label %9
9: ; preds = %7, %4
ret void
}
yywrap() {}


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

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

LLVM IR (-O0):
define i32 @yywrap() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @yywrap() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
void char_reader(char *buffer, FILE *ptr) { buffer[0] = getc(ptr); }


x86 assembly (clang, -O0):
<char_reader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_reader>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <getc@plt>
mov    %al,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @char_reader(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call signext i8 @getc(i32* %5)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @char_reader(i8* nocapture writeonly %0, i32* nocapture %1) {
%3 = tail call signext i8 @getc(i32* %1)
store i8 %3, i8* %0
ret void
}
void Hal_hook_rd_sgndrecfield_recelemb(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgndrecfield_recelemb() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fileClearerr(int);
int /*<<< orphan*/ fileSetPos(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fileRewind(int fileID) {
  fileSetPos(fileID, (off_t)0, SEEK_SET);
  fileClearerr(fileID);
}


x86 assembly (clang, -O0):
<fileRewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fileSetPos@plt>
mov    -0x4(%rbp),%edi
call   1040 <fileClearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileRewind>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fileSetPos@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <fileClearerr@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @fileRewind(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fileSetPos(i32 %3, i32 0, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @fileClearerr(i32 %6)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @fileRewind(i32 %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fileSetPos(i32 %0, i32 0, i32 %2)
%4 = tail call i32 @fileClearerr(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  int i = 0, j;
  long int counter = 0;
  while (i < 100000) {
    j = i;
    while (j < 100000) {
      j++;
      counter++;
    }
    i++;
  }
  printf("%ld iterations\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1176 <main+0x66>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    1168 <main+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <main+0x1e>
mov    -0x18(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"%ld iterations\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 5000050000)
ret i32 0
}
char *asctime(const struct tm *tm) { return 0; }


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
ret i8* null
}

LLVM IR (-O2):
%struct.tm = type opaque
define noalias i8* @asctime(%struct.tm* nocapture readnone %0) {
ret i8* null
}
void av_fifo_drain() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_drain() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double, int, double, int, double, int,
                          double);
int main(int argc, char *argv[], char *envp[]) {
  printf("Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\n", 1,
         -1.58819e-23, 0x3ff19999, 2.8026e-45, 0x9999999a, 2.025, 3,
         2.72008e+23);
  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    %rdx,-0x18(%rbp)
lea    0xeef(%rip),%rdi
mov    $0x1,%esi
movsd  0xec2(%rip),%xmm0
mov    $0x3ff19999,%edx
movsd  0xebd(%rip),%xmm1
mov    $0x9999999a,%ecx
movsd  0xeb8(%rip),%xmm2
mov    $0x3,%r8d
movsd  0xeb2(%rip),%xmm3
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf08(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
movsd  0xee0(%rip),%xmm2
movsd  0xee0(%rip),%xmm3
mov    $0x1,%esi
mov    $0x3ff19999,%edx
mov    $0x9999999a,%ecx
mov    $0x3,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 1, double -1.588190e-23, i32 1072798105, double 2.802600e-45, i32 -1717986918, double 2.025000e+00, i32 3, double 2.720080e+23)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"Many parameters: %d, %.1f, %d, %.1f, %d, %.1f, %d, %.1f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 1, double -1.588190e-23, i32 1072798105, double 2.802600e-45, i32 -1717986918, double 2.025000e+00, i32 3, double 2.720080e+23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_rules(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Please, set db files.\n");
    return 1;
  }
  print_rules(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <print_rules@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1139 <main+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <print_rules@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Please, set db files.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @print_rules(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [22 x i8] c"Please, set db files.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @print_rules(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char message[12] = "Hello World";
  printf("Message is %s\n", message);
  printf("array 2 is %c\n", message[20]);
  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    0xed3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x8(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xeda(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x1c(%rsp),%esi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.message = [12 x i8] c"Hello World\00"
@.str = [15 x i8] c"Message is %s\0A\00"
@.str.1 = [15 x i8] c"array 2 is %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [12 x i8]* %6 to i8*
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 20
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.message = [12 x i8] c"Hello World\00"
@.str = [15 x i8] c"Message is %s\0A\00"
@.str.1 = [15 x i8] c"array 2 is %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 20
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void root_warn() {
  fprintf(stderr, "WARNING: What you're doing is extremely unsafe!\n"
                  "Running this program setuid or setgid root means\n"
                  "any exploit against it may give the attacker a full\n"
                  "root shell. Please see the man page for instructions\n"
                  "on how to install this program safely.\n\n");
}


x86 assembly (clang, -O0):
<root_warn>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<root_warn>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [243 x i8] c"WARNING: What you're doing is extremely unsafe!\0ARunning this program setuid or setgid root means\0Aany exploit against it may give the attacker a full\0Aroot shell. Please see the man page for instructions\0Aon how to install this program safely.\0A\0A\00"
define void @root_warn() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [243 x i8] c"WARNING: What you're doing is extremely unsafe!\0ARunning this program setuid or setgid root means\0Aany exploit against it may give the attacker a full\0Aroot shell. Please see the man page for instructions\0Aon how to install this program safely.\0A\0A\00"
define void @root_warn() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([243 x i8], [243 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_9Bint16_reg(short val) {
  return ((val) & (-0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Bint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Bint16_reg>:
test   $0xff65,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Bint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -155
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_9Bint16_reg(i16 signext %0) {
%2 = and i16 %0, -155
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tek_graph();
void plD_init_vlt(void) {
  tek_graph();
  fprintf(stdout, "\035");
  fprintf(stdout, "\033\f");
}


x86 assembly (clang, -O0):
<plD_init_vlt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tek_graph@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<plD_init_vlt>:
push   %rbx
xor    %eax,%eax
call   1040 <tek_graph@plt>
mov    0x2eb1(%rip),%rbx
mov    (%rbx),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\1D\00"
@.str.1 = [3 x i8] c"\1B\0C\00"
define void @plD_init_vlt() {
%1 = call i32 (...) @tek_graph()
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\1D\00"
@.str.1 = [3 x i8] c"\1B\0C\00"
define void @plD_init_vlt() {
%1 = tail call i32 (...) @tek_graph()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int get_resource_size(char *data) { return (*(int *)(data + 12)) + 0x10; }


x86 assembly (clang, -O0):
<get_resource_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
add    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_resource_size>:
mov    0xc(%rdi),%eax
add    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @get_resource_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 16
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_resource_size(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 16
ret i32 %5
}
int task_mem_malloc() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @task_mem_malloc() {
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ host;

/* Variables and functions */
scalar_t__ getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int ntohs(int /*<<< orphan*/);
int cf_socket_port_get(int sd) {
  struct sockaddr_in host;
  int addr_len = sizeof(host);
  if (getsockname(sd, (struct sockaddr *)&host, (socklen_t *)&addr_len) != 0) {
    return -1;
  }
  return ntohs(host.sin_port);
}


x86 assembly (clang, -O0):
<cf_socket_port_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <getsockname@plt>
cmp    $0x0,%rax
je     1158 <cf_socket_port_get+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <cf_socket_port_get+0x43>
mov    -0x10(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_socket_port_get>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <getsockname@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1145 <cf_socket_port_get+0x25>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <ntohs@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @cf_socket_port_get(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i64 @getsockname(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @ntohs(i32 %11)
br label %13
13: ; preds = %1, %9
%14 = phi i32 [ %12, %9 ], [ -1, %1 ]
ret i32 %14
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
__attribute__((unused)) void from_tpm_uint16(const uint8_t *buffer,
                                             uint16_t *x) {
  *x = (buffer[0] << 8) | buffer[1];
}


x86 assembly (clang, -O0):
<from_tpm_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_tpm_uint16>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @from_tpm_uint16(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = or i32 %4, %6
store i32 %7, i32* %1
ret void
}