xunge/DecIR huggingface dataset:
void hc_allow_pair(unsigned int i, unsigned int j, char c_option, char *hc,
                   int *index) {
  hc[index[j] + i] |= c_option;
}


x86 assembly (clang, -O0):
<hc_allow_pair>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movsbl -0x9(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%edx
mov    (%rcx,%rdx,4),%ecx
add    -0x4(%rbp),%ecx
mov    %ecx,%ecx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hc_allow_pair>:
mov    %esi,%eax
add    (%r8,%rax,4),%edi
or     %dl,(%rcx,%rdi,1)
ret

LLVM IR (-O0):
define void @hc_allow_pair(i32 %0, i32 %1, i8 signext %2, i8* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i8, i8* %8
%12 = sext i8 %11 to i32
%13 = load i8*, i8** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %6
%20 = add i32 %18, %19
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %13, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = or i32 %24, %12
%26 = trunc i32 %25 to i8
store i8 %26, i8* %22
ret void
}

LLVM IR (-O2):
define void @hc_allow_pair(i32 %0, i32 %1, i8 signext %2, i8* nocapture %3, i32* nocapture %4) {
%6 = zext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %4, i64 %6
%8 = load i32, i32* %7
%9 = add i32 %8, %0
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %3, i64 %10
%12 = load i8, i8* %11
%13 = or i8 %12, %2
store i8 %13, i8* %11
ret void
}
int sys$get(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(13), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0xd,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$get>:
mov    $0xd,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$get"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 13, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$get"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 13, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
int test_imm_C9uint8_reg(unsigned char val) {
  return ((val) & (-0xC9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C9uint8_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, -201
%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_C9uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 55
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _f(int, int, double const, double const *);
double _I_32(const double omega, const double vertices_omegas[4]) {
  return _f(2, 3, omega, vertices_omegas) / 3;
}


x86 assembly (clang, -O0):
<_I_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_I_32>:
push   %rax
mov    %rdi,%rdx
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <_f@plt>
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @_I_32(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 2, i32 3, double %5, double* %6)
%8 = sdiv i32 %7, 3
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @_I_32(double %0, double* %1) {
%3 = tail call i32 @_f(i32 2, i32 3, double %0, double* %1)
%4 = sdiv i32 %3, 3
%5 = sitofp i32 %4 to double
ret double %5
}
double fp_prev(double x) {
  double y;
  y = x / 2;
  while (((x + y) / 2 != x) && ((x + y) / 2 != y)) {
    y = (x + y) / 2;
  }
  return y;
}


x86 assembly (clang, -O0):
<fp_prev>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x11(%rbp)
jne    1150 <fp_prev+0x50>
jp     1150 <fp_prev+0x50>
jmp    1176 <fp_prev+0x76>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
divsd  %xmm1,%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1186 <fp_prev+0x86>
jmp    11a6 <fp_prev+0xa6>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    111f <fp_prev+0x1f>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_prev>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeec(%rip),%xmm3
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movapd %xmm2,%xmm1
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
ucomisd %xmm0,%xmm2
jne    1134 <fp_prev+0x34>
jnp    113c <fp_prev+0x3c>
ucomisd %xmm1,%xmm2
jne    1120 <fp_prev+0x20>
jp     1120 <fp_prev+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fp_prev(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 2.000000e+00
store double %5, double* %3
br label %6
6: ; preds = %22, %1
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fadd double %7, %8
%10 = fdiv double %9, 2.000000e+00
%11 = load double, double* %2
%12 = fcmp une double %10, %11
br i1 %12, label %13, label %20
13: ; preds = %6
%14 = load double, double* %2
%15 = load double, double* %3
%16 = fadd double %14, %15
%17 = fdiv double %16, 2.000000e+00
%18 = load double, double* %3
%19 = fcmp une double %17, %18
br label %20
20: ; preds = %13, %6
%21 = phi i1 [ false, %6 ], [ %19, %13 ]
br i1 %21, label %22, label %27
22: ; preds = %20
%23 = load double, double* %2
%24 = load double, double* %3
%25 = fadd double %23, %24
%26 = fdiv double %25, 2.000000e+00
store double %26, double* %3
br label %6
27: ; preds = %20
%28 = load double, double* %3
ret double %28
}

LLVM IR (-O2):
define double @fp_prev(double %0) {
%2 = fmul double %0, 5.000000e-01
br label %3
3: ; preds = %3, %1
%4 = phi double [ %2, %1 ], [ %6, %3 ]
%5 = fadd double %4, %0
%6 = fmul double %5, 5.000000e-01
%7 = fcmp une double %6, %0
%8 = fcmp une double %6, %4
%9 = and i1 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(int argc, char *argv[]) {
  foo(3);
  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    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <foo@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 @foo(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 3)
ret i32 0
}
void rop3_172_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_172_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%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
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_172_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_172_1_1(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** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_172_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
void gtk_action_get_visible() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_get_visible() {
ret void
}
/* Variables and functions */
int __argmatch_internal(char const *, char const *const *, char const *, size_t,
                        int /*<<< orphan*/);
int argcasematch(const char *arg, const char *const *arglist,
                 const char *vallist, size_t valsize) {
  return __argmatch_internal(arg, arglist, vallist, valsize, 0);
}


x86 assembly (clang, -O0):
<argcasematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <__argmatch_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argcasematch>:
xor    %r8d,%r8d
jmp    1030 <__argmatch_internal@plt>

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

LLVM IR (-O2):
define i32 @argcasematch(i8* %0, i8** %1, i8* %2, i64 %3) {
%5 = tail call i32 @__argmatch_internal(i8* %0, i8** %1, i8* %2, i64 %3, i32 0)
ret i32 %5
}
int euler_problem_2() {
  int f1 = 1, f2 = 2, sum = 0, t;
  while (f2 < 4000000) {
    if (f2 % 2 == 0) {
      sum += f2;
    }
    t = f2;
    f2 += f1;
    f1 = t;
  }
  return sum;
}


x86 assembly (clang, -O0):
<euler_problem_2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3d0900,-0x8(%rbp)
jge    115d <euler_problem_2+0x5d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <euler_problem_2+0x43>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1119 <euler_problem_2+0x19>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<euler_problem_2>:
mov    $0x2,%ecx
xor    %eax,%eax
mov    $0x1,%edx
nopl   0x0(%rax)
test   $0x1,%cl
mov    $0x0,%esi
cmove  %ecx,%esi
add    %esi,%eax
mov    %edx,%esi
add    %ecx,%esi
mov    %ecx,%edx
mov    %esi,%ecx
cmp    $0x3d0900,%esi
jl     1110 <euler_problem_2+0x10>
ret

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

LLVM IR (-O2):
define i32 @euler_problem_2() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = phi i32 [ 2, %0 ], [ %9, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 %4, i32 0
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %2, %4
%10 = icmp slt i32 %9, 4000000
br i1 %10, label %1, label %11
11: ; preds = %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pci_config_write_word(unsigned char bus, unsigned char dev, int func,
                           unsigned cmd, long val) {
  printf("pci_config_write_word: generic function call\n");
}


x86 assembly (clang, -O0):
<pci_config_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
mov    %r8,-0x18(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"pci_config_write_word: generic function call\0A\00"
define void @pci_config_write_word(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store i8 %0, i8* %6
store i8 %1, i8* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"pci_config_write_word: generic function call\00"
define void @pci_config_write_word(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3, i64 %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD2_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMRD2_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_WMRD2_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRD2_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_WMRD2_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void irc_list() {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s", "LIST");
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
mov    $0x1fd,%esi
lea    0xec2(%rip),%rdx
lea    0xebe(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x200(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_list>:
push   %rbx
sub    $0x200,%rsp
lea    0xed1(%rip),%rdx
lea    0xecd(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"LIST\00"
define void @irc_list() {
%1 = alloca [509 x i8]
%2 = getelementptr inbounds [509 x i8], [509 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 509, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %1, i64 0, i64 0
%5 = call i32 @net_send(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"LIST\00"
define void @irc_list() {
%1 = alloca [509 x i8]
%2 = getelementptr inbounds [509 x i8], [509 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 509, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @net_send(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_logor() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          267, 1, 0 || 3);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          268, 1, 5 || 0);
  ;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          269, 0, 0 || 0);
  ;
}


x86 assembly (clang, -O0):
<test_logor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x10b,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xecd(%rip),%rdi
mov    $0x10c,%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
lea    0xeb5(%rip),%rdi
mov    $0x10d,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logor>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x10b,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x10c,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x10d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
define void @test_logor() {
%1 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 267, i32 1, i32 1)
%2 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 268, i32 1, i32 1)
%3 = call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 269, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
define void @test_logor() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 267, i32 1, i32 1)
%2 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 268, i32 1, i32 1)
%3 = tail call i32 @fexpect(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 269, i32 0, i32 0)
ret void
}
/* Variables and functions */
double comoving_distance(double);
double transverse_distance(double z) { return (comoving_distance(z)); }


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

x86 assembly (clang, -O2):
<transverse_distance>:
jmp    1030 <comoving_distance@plt>

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

LLVM IR (-O2):
define double @transverse_distance(double %0) {
%2 = tail call double @comoving_distance(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char const *strchr(char const *, char);
int test_strrchr(void) {
  const char *str = "hello";
  printf("\tstrrchr");
  if (strchr(str, 'l') != &str[2])
    return 1;
  if (strchr(str, 'q') != NULL)
    return 1;
  if (strchr(str, '\0') != NULL)
    return 1;
  printf("\tpassed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x6c,%esi
call   1030 <strchr@plt>
mov    -0x10(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
je     116a <test_strrchr+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strrchr+0xa2>
mov    -0x10(%rbp),%rdi
mov    $0x71,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     118e <test_strrchr+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strrchr+0xa2>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11af <test_strrchr+0x8f>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <test_strrchr+0xa2>
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strrchr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [9 x i8] c"\09strrchr\00"
@.str.2 = [10 x i8] c"\09passed.\0A\00"
define i32 @test_strrchr() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 108)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = icmp ne i8* %5, %7
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %22
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = call i8* @strchr(i8* %11, i8 signext 113)
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %1
br label %22
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = call i8* @strchr(i8* %16, i8 signext 0)
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 1, i32* %1
br label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %22
22: ; preds = %20, %19, %14, %9
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"\09strrchr\00"
define i32 @test_strrchr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ mxm(double const *, unsigned int *, double const *,
                       unsigned int *, double *, unsigned int *);
void tensor_mxv(double *y, unsigned int ny, const double *A, const double *x,
                unsigned int nx) {
  unsigned int one = 1;
  mxm(A, &ny, x, &nx, y, &one);
}


x86 assembly (clang, -O0):
<tensor_mxv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%r8
lea    -0xc(%rbp),%rsi
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r9
call   1030 <mxm@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tensor_mxv>:
sub    $0x18,%rsp
mov    %rdi,%rax
mov    %esi,0x14(%rsp)
mov    %r8d,0x10(%rsp)
movl   $0x1,0xc(%rsp)
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %rdx,%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1030 <mxm@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @tensor_mxv(double* %0, i32 %1, double* %2, double* %3, i32 %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
store i32 1, i32* %11
%12 = load double*, double** %8
%13 = load double*, double** %9
%14 = load double*, double** %6
%15 = call i32 @mxm(double* %12, i32* %7, double* %13, i32* %10, double* %14, i32* %11)
ret void
}

LLVM IR (-O2):
define void @tensor_mxv(double* %0, i32 %1, double* %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %1, i32* %6
store i32 %4, i32* %7
%9 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%10 = call i32 @mxm(double* %2, i32* %6, double* %3, i32* %7, double* %0, i32* %8)
ret void
}
void cprop_test6(int *data) {
  int j = 5;
  if (data[0])
    data[1] = 10 * j;
  else
    data[2] = 15 * j;
  data[3] = 21 * j;
}


x86 assembly (clang, -O0):
<cprop_test6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     112c <cprop_test6+0x2c>
imul   $0xa,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1137 <cprop_test6+0x37>
imul   $0xf,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
imul   $0x15,-0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_test6>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
mov    $0x4b,%ecx
mov    $0x32,%edx
cmove  %ecx,%edx
mov    %edx,0x4(%rdi,%rax,4)
movl   $0x69,0xc(%rdi)
ret

LLVM IR (-O0):
define void @cprop_test6(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 5, i32* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = mul nsw i32 10, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %10, i32* %12
br label %18
13: ; preds = %1
%14 = load i32, i32* %3
%15 = mul nsw i32 15, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
%20 = mul nsw i32 21, %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @cprop_test6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 75, i32 50
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 105, i32* %7
ret void
}
/* Variables and functions */
int close(int);
int serial_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<serial_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int /*<<< orphan*/);
uint32_t _Nios2_Get_ctlreg_status(void) { return (uint32_t)__builtin_rdctl(0); }


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

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

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_status() {
%1 = call i32 @__builtin_rdctl(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_status() {
%1 = tail call i32 @__builtin_rdctl(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void exit_test(bool result) {
  puts("----------------------------------");
  if (result)
    puts("Test complete. [OK]");
  else
    puts("Test not completed. [FAIL]");
}


x86 assembly (clang, -O0):
<exit_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x4(%rbp)
je     1142 <exit_test+0x32>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
jmp    114e <exit_test+0x3e>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_test>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
lea    0xf0f(%rip),%rax
lea    0xef4(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"----------------------------------\00"
@.str.1 = [20 x i8] c"Test complete. [OK]\00"
@.str.2 = [27 x i8] c"Test not completed. [FAIL]\00"
define void @exit_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"----------------------------------\00"
@.str.1 = [20 x i8] c"Test complete. [OK]\00"
@.str.2 = [27 x i8] c"Test not completed. [FAIL]\00"
define void @exit_test(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
void set_ptr(int **p, int v) {
  int *x;
  x = (int *)malloc(sizeof(int));
  *x = v;
  *p = x;
  return;
}


x86 assembly (clang, -O0):
<set_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ptr>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @set_ptr(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32*
store i32** %0, i32*** %3
store i32 %1, i32* %4
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
store i32 %8, i32* %9
%10 = load i32*, i32** %5
%11 = load i32**, i32*** %3
store i32* %10, i32** %11
ret void
}

LLVM IR (-O2):
define void @set_ptr(i32** nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32 %1, i32* %4
store i32* %4, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xmon_printf(char *, unsigned long);
int print_insn_powerpc(unsigned long insn, unsigned long memaddr) {
  xmon_printf("%.8x", insn);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_insn_powerpc>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <xmon_printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.8x\00"
define i32 @print_insn_powerpc(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 = call i32 @xmon_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.8x\00"
define i32 @print_insn_powerpc(i64 %0, i64 %1) {
%3 = tail call i32 @xmon_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_nodeids(char *);
void fgmvwrite_nodeids_(char *nodeids) { gmvwrite_nodeids(nodeids); }


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

x86 assembly (clang, -O2):
<fgmvwrite_nodeids_>:
jmp    1030 <gmvwrite_nodeids@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_nodeids_(i8* %0) {
%2 = tail call i32 @gmvwrite_nodeids(i8* %0)
ret void
}
void badata_free(void *data) {}


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

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

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

LLVM IR (-O2):
define void @badata_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_zero_flag(int);
void handle_zero_flag(const int value) { set_zero_flag(value == 0); }


x86 assembly (clang, -O0):
<handle_zero_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_zero_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_zero_flag>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
jmp    1030 <set_zero_flag@plt>

LLVM IR (-O0):
define void @handle_zero_flag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @set_zero_flag(i32 %5)
ret void
}

LLVM IR (-O2):
define void @handle_zero_flag(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @set_zero_flag(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *get_prog();
int /*<<< orphan*/ printf(char *, ...);
void usage_and_exit(void) {
  printf("usage: %s\n"
         "       [-h|--help|-v|--version]\n"
         "       [-c|--config <config_file>]\n"
         "       [-p|--pidfile <pid_file>]\n"
         "       [-f|--no-fork]\n",
         get_prog());
  printf("check syslog for debug/error messages\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_prog@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage_and_exit>:
push   %rax
xor    %eax,%eax
call   1030 <get_prog@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf25(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [133 x i8] c"usage: %s\0A [-h|--help|-v|--version]\0A [-c|--config <config_file>]\0A [-p|--pidfile <pid_file>]\0A [-f|--no-fork]\0A\00"
@.str.1 = [39 x i8] c"check syslog for debug/error messages\0A\00"
define void @usage_and_exit() {
%1 = call i8* (...) @get_prog()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [133 x i8] c"usage: %s\0A [-h|--help|-v|--version]\0A [-c|--config <config_file>]\0A [-p|--pidfile <pid_file>]\0A [-f|--no-fork]\0A\00"
@str = [38 x i8] c"check syslog for debug/error messages\00"
define void @usage_and_exit() {
%1 = tail call i8* (...) @get_prog()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 2)
unreachable
}
int main(int argc, char *argv[]) {
  int i;
  int sum = 0;
  for (i = 0; i <= 100; i = i + 1)
    sum = sum + i * i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     1147 <main+0x47>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
char const *weak_n1();
const char *sibcall_weak_n1(void) { return weak_n1(); }


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

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

LLVM IR (-O0):
define i8* @sibcall_weak_n1() {
%1 = call i8* (...) @weak_n1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sibcall_weak_n1() {
%1 = tail call i8* (...) @weak_n1()
ret i8* %1
}
int backIntY(int currentY, int currentDir) {
  if (currentDir == 0)
    return currentY - 1;
  else if (currentDir == 2)
    return currentY + 1;
  else
    return currentY;
}


x86 assembly (clang, -O0):
<backIntY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1122 <backIntY+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <backIntY+0x40>
cmpl   $0x2,-0xc(%rbp)
jne    113a <backIntY+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <backIntY+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<backIntY>:
mov    %edi,%eax
cmp    $0x2,%esi
je     110f <backIntY+0xf>
test   %esi,%esi
jne    1112 <backIntY+0x12>
add    $0xffffffff,%eax
ret
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @backIntY(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 0, label %3
i32 2, label %5
]
3: ; preds = %2
%4 = add nsw i32 %0, -1
br label %7
5: ; preds = %2
%6 = add nsw i32 %0, 1
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
int redund_main(int, char **);
int main(int argc, char *argv[]) { return redund_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <redund_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <redund_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @redund_main(i32 %0, i8** %1)
ret i32 %3
}
__attribute__((always_)) unsigned long __fls(unsigned long word) {
  asm("bsr %1,%0" : "=r"(word) : "rm"(word));
  return word;
}


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

x86 assembly (clang, -O2):
<__fls>:
mov    %rdi,-0x8(%rsp)
bsr    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @__fls(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @__fls(i64 %0) {
%2 = tail call i64 asm "bsr $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("cleanup(\"%s\") called\n", (char *)arg); }


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"cleanup(\22%s\22) called\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}