xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double raio_cm, raio_m, area_m2;
  scanf("%lf", &raio_cm);
  raio_m = raio_cm * 0.01;
  area_m2 = 3.14159 * raio_m * raio_m;
  printf("Area = %0.4lf\n", area_m2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xec1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea7(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
mulsd  0xec3(%rip),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [15 x i8] c"Area = %0.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = fmul double %6, 1.000000e-02
store double %7, double* %3
%8 = load double, double* %3
%9 = fmul double 3.141590e+00, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [15 x i8] c"Area = %0.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 1.000000e-02
%6 = fmul double %5, 3.141590e+00
%7 = fmul double %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int i64cmp(const void *a, const void *b) {
  const int64_t ia = *(const int64_t *)a;
  const int64_t ib = *(const int64_t *)b;
  if (ia < ib)
    return -1;
  if (ia > ib)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<i64cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <i64cmp+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <i64cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <i64cmp+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <i64cmp+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @ASN1_TYPE_get() {
ret void
}
int Operand_mw_decode(unsigned int *valp __attribute__((__unused__))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Operand_mw_decode(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void display_version(void) {
  printf("%s "
         "$Revision 1.0 $"
         "\n"
         "\n"
         "This is free software; see the source for copying conditions.  There "
         "is NO\n"
         "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
         "PURPOSE.\n",
         "rfdformat");
  exit(0);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf7a(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf7d(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [172 x i8] c"%s $Revision 1.0 $\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
@.str.1 = [10 x i8] c"rfdformat\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [172 x i8] c"%s $Revision 1.0 $\0A\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
@.str.1 = [10 x i8] c"rfdformat\00"
define void @display_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_43uint8_reg(unsigned char val) {
  return ((val) & (-0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffbd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43uint8_reg>:
test   $0xbd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_43uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -67
%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_43uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -67
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int void_pointers(void *foo) { return foo == NULL; }


x86 assembly (clang, -O0):
<void_pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_pointers>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @void_pointers(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @void_pointers(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void av_frame_set_pkt_duration() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_set_pkt_duration() {
ret void
}
/* Variables and functions */
int random();
int my_random(int module) {
  int res;
  res = random();
  res = res % module;
  return res;
}


x86 assembly (clang, -O0):
<my_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_random(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @random()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @my_random(i32 %0) {
%2 = tail call i32 (...) @random()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrot(int, int);
int main(void) {
  printf("%x\n", rightrot(0xaa, 4));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xaa,%edi
mov    $0x4,%esi
call   1040 <rightrot@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrot(i32 170, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void gdk_drag_status() {}


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

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

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

LLVM IR (-O2):
define void @gdk_drag_status() {
ret void
}
/* Variables and functions */
int M_PI;
float sin(float);
float af_softclip(float a) {
  if (a >= M_PI / 2)
    return 1.0;
  else if (a <= -M_PI / 2)
    return -1.0;
  else
    return sin(a);
}


x86 assembly (clang, -O0):
<af_softclip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jb     1152 <af_softclip+0x42>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1198 <af_softclip+0x88>
movss  -0x8(%rbp),%xmm1
xor    %eax,%eax
mov    0x2e88(%rip),%rcx
sub    (%rcx),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
ucomiss %xmm1,%xmm0
jb     1189 <af_softclip+0x79>
movss  0xe81(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1198 <af_softclip+0x88>
movss  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<af_softclip>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
cvtsi2ss %eax,%xmm1
ucomiss %xmm1,%xmm0
jae    113e <af_softclip+0x2e>
neg    %eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
ucomiss %xmm0,%xmm1
jae    1147 <af_softclip+0x37>
jmp    1030 <sin@plt>
movss  0xeba(%rip),%xmm0
ret
movss  0xeb5(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @af_softclip(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = load i32, i32* @M_PI
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to float
%8 = fcmp oge float %4, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store float 1.000000e+00, float* %2
br label %21
10: ; preds = %1
%11 = load float, float* %3
%12 = load i32, i32* @M_PI
%13 = sub nsw i32 0, %12
%14 = sdiv i32 %13, 2
%15 = sitofp i32 %14 to float
%16 = fcmp ole float %11, %15
br i1 %16, label %17, label %18
17: ; preds = %10
store float -1.000000e+00, float* %2
br label %21
18: ; preds = %10
%19 = load float, float* %3
%20 = call float @sin(float %19)
store float %20, float* %2
br label %21
21: ; preds = %18, %17, %9
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @af_softclip(float %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 2
%4 = sitofp i32 %3 to float
%5 = fcmp ugt float %4, %0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = sdiv i32 %2, -2
%8 = sitofp i32 %7 to float
%9 = fcmp ult float %8, %0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call float @sin(float %0)
br label %12
12: ; preds = %6, %1, %10
%13 = phi float [ %11, %10 ], [ 1.000000e+00, %1 ], [ -1.000000e+00, %6 ]
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_fibonacci_series(int a, int b) {
  int sum = a + b;
  if (sum > 4000000) {
    return;
  }
  printf("%d ", sum);
  print_fibonacci_series(b, sum);
}


x86 assembly (clang, -O0):
<print_fibonacci_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3d0900,-0xc(%rbp)
jle    1149 <print_fibonacci_series+0x29>
jmp    1163 <print_fibonacci_series+0x43>
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <print_fibonacci_series@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fibonacci_series>:
push   %rbp
push   %r14
push   %rbx
add    %esi,%edi
cmp    $0x3d0900,%edi
jg     114a <print_fibonacci_series+0x3a>
mov    %esi,%ebx
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %edi,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%edi
cmp    $0x3d0901,%ebx
mov    %ebp,%ebx
jl     1130 <print_fibonacci_series+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_fibonacci_series(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 4000000
br i1 %10, label %11, label %12
11: ; preds = %2
br label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %5
br label %17
17: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_fibonacci_series(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp sgt i32 %3, 4000000
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%9 = add nsw i32 %6, %7
%10 = icmp sgt i32 %9, 4000000
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int sendAnswer(int sock, uint32_t value) {
  char str[32];
  sprintf(str, "%u$", value);
  send(sock, str, strlen(str), 0);
  return 0;
}


x86 assembly (clang, -O0):
<sendAnswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xeb4(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x3c(%rbp),%edi
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendAnswer>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %edi,%ebp
lea    0xebf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u$\00"
define i32 @sendAnswer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [32 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @send(i32 %9, i8* %10, i32 %12, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u$\00"
define i32 @sendAnswer(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 @send(i32 %0, i8* %4, i32 %6, i32 0)
ret i32 0
}
void testBug(void) {}


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

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

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

LLVM IR (-O2):
define void @testBug() {
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int16_t(int16_t const k1, int16_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ _atomic_get_u32(int /*<<< orphan*/ *);
int32_t _atomic_get_s32(int32_t *ptr) {
  return _atomic_get_u32((uint32_t *)ptr);
}


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

x86 assembly (clang, -O2):
<_atomic_get_s32>:
jmp    1030 <_atomic_get_u32@plt>

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

LLVM IR (-O2):
define i32 @_atomic_get_s32(i32* %0) {
%2 = tail call i32 @_atomic_get_u32(i32* %0)
ret i32 %2
}
void f0(void) {}


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

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

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

LLVM IR (-O2):
define void @f0() {
ret void
}
void f0(x) signed char *x;
{}


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

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

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

LLVM IR (-O2):
define void @f0(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct char_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_to_char(char *, struct char_data *);
void do_practice(struct char_data *ch, char *arg, int cmd) {
  send_to_char("You can only practise in a guild.\n\r", ch);
}


x86 assembly (clang, -O0):
<do_practice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <send_to_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.char_data = type { i32 }
@.str = [36 x i8] c"You can only practise in a guild.\0A\0D\00"
define void @do_practice(%struct.char_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.char_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.char_data* %0, %struct.char_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.char_data*, %struct.char_data** %4
%8 = call i32 @send_to_char(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), %struct.char_data* %7)
ret void
}

LLVM IR (-O2):
%struct.char_data = type { i32 }
@.str = [36 x i8] c"You can only practise in a guild.\0A\0D\00"
define void @do_practice(%struct.char_data* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @send_to_char(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), %struct.char_data* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yield();
void f_ping2(void) {
  int i;
  for (i = 0; i < 500; i++) {
    printf("A");
    printf("B");
    printf("C");
    yield();
  }
}


x86 assembly (clang, -O0):
<f_ping2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f4,-0x4(%rbp)
jge    1175 <f_ping2+0x55>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <yield@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f_ping2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ping2>:
push   %rbx
mov    $0x1f4,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <yield@plt>
add    $0xffffffff,%ebx
jne    1130 <f_ping2+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
define void @f_ping2() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 500
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @yield()
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @f_ping2() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i32 @putchar(i32 65)
%4 = tail call i32 @putchar(i32 66)
%5 = tail call i32 @putchar(i32 67)
%6 = tail call i32 (...) @yield()
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 500
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_keypress();
int /*<<< orphan*/ printf(char *, ...);
void wait_for_any_key(const char *message) {
  if (message == NULL)
    printf("Press any key to continue: ");
  else
    printf("%s", message);
  get_keypress();
  printf("\n\n");
}


x86 assembly (clang, -O0):
<wait_for_any_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <wait_for_any_key+0x2a>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115c <wait_for_any_key+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_keypress@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_any_key>:
push   %rax
test   %rdi,%rdi
je     1149 <wait_for_any_key+0x19>
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1157 <wait_for_any_key+0x27>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <get_keypress@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Press any key to continue: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @wait_for_any_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %5
%11 = call i32 (...) @get_keypress()
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Press any key to continue: \00"
@.str.1 = [3 x i8] c"%s\00"
@str = [2 x i8] c"\0A\00"
define void @wait_for_any_key(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (...) @get_keypress()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void irq_unlock_sparse(void) {}


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

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

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

LLVM IR (-O2):
define void @irq_unlock_sparse() {
ret void
}
/* Type definitions */
struct dfont {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dfont *);
void dfont_release(struct dfont *df) { free(df); }


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

x86 assembly (clang, -O2):
<dfont_release>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dfont = type { i32 }
define void @dfont_release(%struct.dfont* %0) {
%2 = alloca %struct.dfont*
store %struct.dfont* %0, %struct.dfont** %2
%3 = load %struct.dfont*, %struct.dfont** %2
%4 = call i32 @free(%struct.dfont* %3)
ret void
}

LLVM IR (-O2):
%struct.dfont = type { i32 }
define void @dfont_release(%struct.dfont* nocapture %0) {
%2 = tail call i32 @free(%struct.dfont* %0)
ret void
}
void print(n) { printf("Address on integer in the print function: %p\n", &n); }


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

x86 assembly (clang, -O2):
<print>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Address on integer in the print function: %p\0A\00"
define void @print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Address on integer in the print function: %p\0A\00"
define void @print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint64_t;
struct rnet_message {
  int dummy;
};

/* Variables and functions */
int add_field(struct rnet_message **, char *, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int rnet_message_add_u64(struct rnet_message **msg, char *key, uint64_t val) {
  uint64_t nval = htobe64(val);
  return add_field(msg, key, strlen(key), (char *)&nval, sizeof(val));
}


x86 assembly (clang, -O0):
<rnet_message_add_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <htobe64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <add_field@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnet_message_add_u64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%edi
call   1050 <htobe64@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x4(%rsp),%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    $0x4,%r8d
call   1030 <add_field@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_u64(%struct.rnet_message** %0, i8* %1, i32 %2) {
%4 = alloca %struct.rnet_message**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.rnet_message** %0, %struct.rnet_message*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htobe64(i32 %8)
store i32 %9, i32* %7
%10 = load %struct.rnet_message**, %struct.rnet_message*** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = bitcast i32* %7 to i8*
%15 = call i32 @add_field(%struct.rnet_message** %10, i8* %11, i32 %13, i8* %14, i32 4)
ret i32 %15
}

LLVM IR (-O2):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_u64(%struct.rnet_message** %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htobe64(i32 %2)
store i32 %6, i32* %4
%7 = tail call i32 @strlen(i8* %1)
%8 = call i32 @add_field(%struct.rnet_message** %0, i8* %1, i32 %7, i8* %5, i32 4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ robber_erase(int);
int /*<<< orphan*/ robber_place(int);
int robber_right(int hex) {
  robber_erase(hex);
  hex++;
  if (hex == 2 || hex == 20)
    hex++;
  if (hex == 22)
    hex = 1;
  robber_place(hex);
  return hex;
}


x86 assembly (clang, -O0):
<robber_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <robber_erase@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1150 <robber_right+0x30>
cmpl   $0x14,-0x4(%rbp)
jne    1159 <robber_right+0x39>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x16,-0x4(%rbp)
jne    116a <robber_right+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <robber_place@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robber_right>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <robber_erase@plt>
cmp    $0x13,%ebx
je     1134 <robber_right+0x14>
cmp    $0x1,%ebx
jne    1139 <robber_right+0x19>
add    $0x2,%ebx
jmp    113c <robber_right+0x1c>
add    $0x1,%ebx
cmp    $0x16,%ebx
mov    $0x1,%ebp
cmovne %ebx,%ebp
mov    %ebp,%edi
call   1030 <robber_place@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @robber_right(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @robber_erase(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 20
br i1 %11, label %12, label %15
12: ; preds = %9, %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 22
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1, i32* %2
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
%21 = call i32 @robber_place(i32 %20)
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @robber_right(i32 %0) {
%2 = tail call i32 @robber_erase(i32 %0)
%3 = add nsw i32 %0, 1
switch i32 %0, label %6 [
i32 19, label %4
i32 1, label %4
]
4: ; preds = %1, %1
%5 = add nuw nsw i32 %0, 2
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %3, %1 ]
%8 = icmp eq i32 %7, 22
%9 = select i1 %8, i32 1, i32 %7
%10 = tail call i32 @robber_place(i32 %9)
ret i32 %9
}
char appleIIMapGet(char pageNum, char pageMem) {}


x86 assembly (clang, -O0):
<appleIIMapGet>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @appleIIMapGet(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @appleIIMapGet(i8 signext %0, i8 signext %1) {
ret i8 undef
}
void rop3_23_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = *D ^ S;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_23_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_23_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
and    %dl,%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_23_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = xor i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %9
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = load i8, i8* %9
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %8
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %7
%35 = load i8, i8* %7
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = trunc i32 %37 to i8
store i8 %38, i8* %7
%39 = load i8, i8* %7
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_23_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = and i8 %6, %4
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_has_moredata(__le16 fc) {
  return (fc & cpu_to_le16(0x2000)) != 0;
}


x86 assembly (clang, -O0):
<ieee80211_has_moredata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x2000,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_moredata>:
push   %rbx
mov    %edi,%ebx
mov    $0x2000,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_moredata(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 8192)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_moredata(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 8192)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int trueThreeFourths(int x) {
  int xs1 = x >> 1;
  int xs2 = x >> 2;
  int bias = (x >> 31) & 0x3;
  int xl2 = x & 0x3;
  int xl1 = (x & 0x1) << 1;
  int incr = (xl2 + xl1 + bias) >> 2;
  return xs1 + xs2 + incr;
}


x86 assembly (clang, -O0):
<trueThreeFourths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trueThreeFourths>:
mov    %edi,%eax
sar    %eax
mov    %edi,%ecx
sar    $0x2,%ecx
add    %eax,%ecx
mov    %edi,%edx
sar    $0x1f,%edx
and    $0x3,%edx
mov    %edi,%eax
and    $0x3,%eax
and    $0x1,%edi
lea    (%rax,%rdi,2),%eax
add    %edx,%eax
shr    $0x2,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @trueThreeFourths(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = ashr i32 %11, 2
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = ashr i32 %13, 31
%15 = and i32 %14, 3
store i32 %15, i32* %5
%16 = load i32, i32* %2
%17 = and i32 %16, 3
store i32 %17, i32* %6
%18 = load i32, i32* %2
%19 = and i32 %18, 1
%20 = shl i32 %19, 1
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
%26 = ashr i32 %25, 2
store i32 %26, i32* %8
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %8
%31 = add nsw i32 %29, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @trueThreeFourths(i32 %0) {
%2 = ashr i32 %0, 1
%3 = ashr i32 %0, 2
%4 = icmp slt i32 %0, 0
%5 = select i1 %4, i32 3, i32 0
%6 = and i32 %0, 3
%7 = shl i32 %0, 1
%8 = and i32 %7, 2
%9 = add nuw nsw i32 %8, %6
%10 = add nuw nsw i32 %9, %5
%11 = lshr i32 %10, 2
%12 = add nsw i32 %2, %3
%13 = add nsw i32 %12, %11
ret i32 %13
}
/* Variables and functions */
scalar_t__ GetCurrentThreadId();
unsigned int usbi_get_tid(void) { return (unsigned int)GetCurrentThreadId(); }


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

x86 assembly (clang, -O2):
<usbi_get_tid>:
xor    %eax,%eax
jmp    1030 <GetCurrentThreadId@plt>

LLVM IR (-O0):
define i32 @usbi_get_tid() {
%1 = call i64 (...) @GetCurrentThreadId()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @usbi_get_tid() {
%1 = tail call i64 (...) @GetCurrentThreadId()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int test_imm_25int32_reg(int val) { return ((val) & (0x25 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_25int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x25,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25int32_reg>:
test   $0x25,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_25int32_reg(i32 %0) {
%2 = and i32 %0, 37
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int fetchFromMemory(int);
int fetchInstruction(int address) { return fetchFromMemory(address); }


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

x86 assembly (clang, -O2):
<fetchInstruction>:
jmp    1030 <fetchFromMemory@plt>

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

LLVM IR (-O2):
define i32 @fetchInstruction(i32 %0) {
%2 = tail call i32 @fetchFromMemory(i32 %0)
ret i32 %2
}
void *mem_realloc(p, u) void *p;
unsigned u;
{
  return mem_realloc_debug(
      p, u,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/"
      "master/CodeFix5/Code/MEM/mem.c",
      290);
}


x86 assembly (clang, -O0):
<mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
mov    $0x122,%ecx
mov    $0x0,%al
call   1030 <mem_realloc_debug@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_realloc>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x122,%ecx
xor    %eax,%eax
call   1030 <mem_realloc_debug@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_realloc(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 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @mem_realloc_debug to i32 (i8*, i32, i8*, i32, ...)*)(i8* %5, i32 %6, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 290)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_realloc(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @mem_realloc_debug to i32 (i8*, i32, i8*, i32, ...)*)(i8* %0, i32 %1, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 290)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
int in_space_class(int c) {
  return in_class(c, ((char[]){'\n', '\r', '\t', ' ', '\f', 0}));
}


x86 assembly (clang, -O0):
<in_space_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
movb   $0xa,-0xa(%rbp)
movb   $0xd,-0x9(%rbp)
movb   $0x9,-0x8(%rbp)
movb   $0x20,-0x7(%rbp)
movb   $0xc,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0xa(%rbp),%rsi
mov    $0x0,%al
call   1030 <in_class@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_space_class>:
push   %rax
movl   $0x20090d0a,0x2(%rsp)
20
movw   $0xc,0x6(%rsp)
lea    0x2(%rsp),%rsi
xor    %eax,%eax
call   1030 <in_class@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @in_space_class(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
store i8 10, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 13, i8* %6
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8 9, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 32, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 12, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @in_class to i32 (i32, i8*, ...)*)(i32 %4, i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @in_space_class(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
store i8 10, i8* %3
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 1
store i8 13, i8* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
store i8 9, i8* %5
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
store i8 32, i8* %6
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 4
store i8 12, i8* %7
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 5
store i8 0, i8* %8
%9 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @in_class to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ output_0();
int /*<<< orphan*/ output_1();
void energenie_master() {
  output_1();
  output_1();
  output_0();
}


x86 assembly (clang, -O0):
<energenie_master>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <output_1@plt>
mov    $0x0,%al
call   1030 <output_1@plt>
mov    $0x0,%al
call   1040 <output_0@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @energenie_master() {
%1 = call i32 (...) @output_1()
%2 = call i32 (...) @output_1()
%3 = call i32 (...) @output_0()
ret void
}

LLVM IR (-O2):
define void @energenie_master() {
%1 = tail call i32 (...) @output_1()
%2 = tail call i32 (...) @output_1()
%3 = tail call i32 (...) @output_0()
ret void
}