xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dcloadsyscall(int, unsigned char *);
void assign_wrkmem(unsigned char *wrkmem) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    dcloadsyscall(14, wrkmem);
}


x86 assembly (clang, -O0):
<assign_wrkmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    113b <assign_wrkmem+0x2b>
mov    -0x8(%rbp),%rsi
mov    $0xe,%edi
call   1030 <dcloadsyscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_wrkmem>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112a <assign_wrkmem+0x1a>
mov    %rdi,%rsi
mov    $0xe,%edi
jmp    1030 <dcloadsyscall@plt>
ret

LLVM IR (-O0):
define void @assign_wrkmem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @dcloadsyscall(i32 14, i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @assign_wrkmem(i8* %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dcloadsyscall(i32 14, i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
double Sub(double a, double b) { return a - b; }


x86 assembly (clang, -O0):
<Sub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Sub(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 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Sub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
void iobench_end() {}


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

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

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

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

/* Variables and functions */
struct wormFeature *scanChromOffsetFile(char *, char *, int, int, char *, int,
                                        int, int /*<<< orphan*/);
struct wormFeature *wormSomeGenesInRange(char *chromId, int start, int end,
                                         char *gdfDir) {
  return scanChromOffsetFile(gdfDir, ".pgo", 0x690, 2 * sizeof(int) + 1,
                             chromId, start, end, 0);
}


x86 assembly (clang, -O0):
<wormSomeGenesInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%eax
lea    0xec4(%rip),%rsi
mov    $0x690,%edx
mov    $0x9,%ecx
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <scanChromOffsetFile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wormSomeGenesInRange>:
push   %rax
mov    %edx,%eax
mov    %esi,%r9d
mov    %rdi,%r8
lea    0xee0(%rip),%rsi
mov    %rcx,%rdi
mov    $0x690,%edx
mov    $0x9,%ecx
push   $0x0
push   %rax
call   1030 <scanChromOffsetFile@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.wormFeature = type { i32 }
@.str = [5 x i8] c".pgo\00"
define %struct.wormFeature* @wormSomeGenesInRange(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call %struct.wormFeature* @scanChromOffsetFile(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1680, i32 9, i8* %10, i32 %11, i32 %12, i32 0)
ret %struct.wormFeature* %13
}

LLVM IR (-O2):
%struct.wormFeature = type { i32 }
@.str = [5 x i8] c".pgo\00"
define %struct.wormFeature* @wormSomeGenesInRange(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call %struct.wormFeature* @scanChromOffsetFile(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1680, i32 9, i8* %0, i32 %1, i32 %2, i32 0)
ret %struct.wormFeature* %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
unsigned long get_XEnterWindowEvent_serial(void *_p) {
  return (unsigned long)((XEnterWindowEvent *)_p)->serial;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XEnterWindowEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XEnterWindowEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double acos(double);
double c_acos(double arg0) { return acos(arg0); }


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

x86 assembly (clang, -O2):
<c_acos>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define double @c_acos(double %0) {
%2 = tail call double @acos(double %0)
ret double %2
}
printn(n, b) {
  register a;
  if (a = ldiv(n, b))
    printn(a, b);
  putchar(lrem(n, b) + '0');
}


x86 assembly (clang, -O0):
<printn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1050 <ldiv@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1172 <printn+0x32>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <printn@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1060 <lrem@plt>
mov    %eax,%edi
add    $0x30,%edi
mov    $0x0,%al
call   1040 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printn>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <ldiv@plt>
test   %eax,%eax
je     115b <printn+0x1b>
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <printn@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <lrem@plt>
lea    0x30(%rax),%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <putchar@plt>

LLVM IR (-O0):
define i32 @printn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ldiv to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @printn(i32 %12, i32 %13)
br label %15
15: ; preds = %11, %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 (i32, i32, ...) bitcast (i32 (...)* @lrem to i32 (i32, i32, ...)*)(i32 %16, i32 %17)
%19 = add nsw i32 %18, 48
%20 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %19)
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @printn(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ldiv to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printn(i32 %3, i32 %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @lrem to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%9 = add nsw i32 %8, 48
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %9)
ret i32 undef
}
int network_get_user_state(int num) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @network_get_user_state(i32 %0) {
ret i32 0
}
double x2min(double A, double B, double C) {
  double term = A + C - 2 * B;
  if (term == 0)
    return 0;
  return -(A - C) / 2.0 / term;
}


x86 assembly (clang, -O0):
<x2min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1154 <x2min+0x54>
jp     1154 <x2min+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <x2min+0x8b>
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe83(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2min>:
movapd %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jne    1121 <x2min+0x21>
jp     1121 <x2min+0x21>
movapd %xmm1,%xmm0
ret
subsd  %xmm2,%xmm0
mulsd  0xed3(%rip),%xmm0
divsd  %xmm3,%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @x2min(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %6
%13 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %12, double %11)
store double %13, double* %8
%14 = load double, double* %8
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %3
store double 0.000000e+00, double* %4
br label %25
17: ; preds = %3
%18 = load double, double* %5
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fneg double %20
%22 = fdiv double %21, 2.000000e+00
%23 = load double, double* %8
%24 = fdiv double %22, %23
store double %24, double* %4
br label %25
25: ; preds = %17, %16
%26 = load double, double* %4
ret double %26
}

LLVM IR (-O2):
define double @x2min(double %0, double %1, double %2) {
%4 = fadd double %0, %2
%5 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double %4)
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = fsub double %0, %2
%9 = fmul double %8, -5.000000e-01
%10 = fdiv double %9, %5
br label %11
11: ; preds = %3, %7
%12 = phi double [ %10, %7 ], [ 0.000000e+00, %3 ]
ret double %12
}
TR_CLASSVARS_DECL(TR_SizedData) {}


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

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

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

LLVM IR (-O2):
define i32 @TR_CLASSVARS_DECL(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xf7() {
  Assert_real((isgraph(247) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1240, ("isgraph should be 0 for 0xf7"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf7\00"
define void @t_isgraph_0xf7() {
%1 = call i64 @isgraph(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xf7\00"
define void @t_isgraph_0xf7() {
%1 = tail call i64 @isgraph(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int numberOf1InBinary(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int count = numberOf1InBinary(0xff - 1);
  printf("%d\n", count);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @numberOf1InBinary(i32 254)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
unsigned long long _bextr2_u64(unsigned long long, unsigned long long);
unsigned long long test_bextr2_u64(unsigned long long __X,
                                   unsigned long long __Y) {
  return _bextr2_u64(__X, __Y);
}


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

x86 assembly (clang, -O2):
<test_bextr2_u64>:
jmp    1030 <_bextr2_u64@plt>

LLVM IR (-O0):
define i64 @test_bextr2_u64(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 = call i64 @_bextr2_u64(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @test_bextr2_u64(i64 %0, i64 %1) {
%3 = tail call i64 @_bextr2_u64(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char const *);
char *strstr(char *, char const *);
char *del_str(char *str, const char *del) {
  int len;
  char *pos;
  len = strlen(del);
  if ((pos = strstr(str, del)) != NULL)
    strcpy(pos, pos + len);
  return str;
}


x86 assembly (clang, -O0):
<del_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     117b <del_str+0x4b>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     1163 <del_str+0x33>
movslq %r14d,%rsi
add    %rax,%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @del_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @strstr(i8* %9, i8* %10)
store i8* %11, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %6
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = call i32 @strcpy(i8* %14, i8* %18)
br label %20
20: ; preds = %13, %2
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @del_str(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = tail call i32 @strcpy(i8* %4, i8* %8)
br label %10
10: ; preds = %6, %2
ret i8* %0
}
/* Variables and functions */
unsigned int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, unsigned int);
int opt_eq(const char *s, unsigned len, const char *opt) {
  if (strlen(opt) == len && strncmp(s, opt, len) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<opt_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0x14(%rbp),%eax
jne    116b <opt_eq+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116b <opt_eq+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1172 <opt_eq+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_eq>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
cmp    %ebx,%eax
jne    114b <opt_eq+0x2b>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114f <opt_eq+0x2f>
xor    %eax,%eax
jmp    1154 <opt_eq+0x34>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @opt_eq(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 @strncmp(i8* %0, i8* %2, i32 %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %3
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
void *htsmsg_create_map();
void *create_map(void *opaque) { return htsmsg_create_map(); }


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

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

LLVM IR (-O0):
define i8* @create_map(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @htsmsg_create_map()
ret i8* %3
}

LLVM IR (-O2):
define i8* @create_map(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @htsmsg_create_map()
ret i8* %2
}
int isnan_f(float x) { return x != x; }


x86 assembly (clang, -O0):
<isnan_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan_f>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isnan_f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp une float %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isnan_f(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double *malloc(int);
double *doubledup(double *src) {
  double *res = malloc(sizeof(double));
  if (res)
    *res = *src;
  return res;
}


x86 assembly (clang, -O0):
<doubledup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <doubledup+0x35>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubledup>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     112b <doubledup+0x1b>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias double* @doubledup(double* nocapture %0) {
%2 = tail call double* @malloc(i32 8)
%3 = icmp eq double* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = load double, double* %0
store double %5, double* %2
br label %6
6: ; preds = %4, %1
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char const *);
int select_linker_multiboot(const char *binware_file) {
  print("\t(template driver) select_linker_multiboot(%s)\n", binware_file);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [48 x i8] c"\09(template driver) select_linker_multiboot(%s)\0A\00"
define i32 @select_linker_multiboot(i8* %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
void test_three(int x, int y) {
#pragma omp target teams distribute collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ UINT16_MAX;
int add_uint16_overflows(uint16_t a, uint16_t b) {
  return (b > UINT16_MAX - a);
}


x86 assembly (clang, -O0):
<add_uint16_overflows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%rcx
sub    -0x8(%rbp),%rcx
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_uint16_overflows>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
sub    %rdi,%rcx
xor    %eax,%eax
cmp    %rsi,%rcx
setl   %al
ret

LLVM IR (-O0):
@UINT16_MAX = global i64 0
define i32 @add_uint16_overflows(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @UINT16_MAX
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = icmp sgt i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@UINT16_MAX = global i64 0
define i32 @add_uint16_overflows(i64 %0, i64 %1) {
%3 = load i64, i64* @UINT16_MAX
%4 = sub nsw i64 %3, %0
%5 = icmp slt i64 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int mem_get_be24_as_int(const void *vmem) {
  unsigned int val;
  const unsigned char *mem = (const unsigned char *)vmem;
  val = mem[0] << 16;
  val |= mem[1] << 8;
  val |= mem[2];
  return val;
}


x86 assembly (clang, -O0):
<mem_get_be24_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_get_be24_as_int>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mem_get_be24_as_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
unsigned int CalcTimeDifference(unsigned int startTime, unsigned int endTime) {
  if (endTime < startTime)
    return (0xffffffff - (startTime - endTime));
  else
    return (endTime - startTime);
}


x86 assembly (clang, -O0):
<CalcTimeDifference>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    112b <CalcTimeDifference+0x2b>
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <CalcTimeDifference+0x34>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcTimeDifference>:
mov    %edi,%eax
neg    %eax
cmp    %edi,%esi
not    %edi
cmovb  %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @CalcTimeDifference(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 = load i32, i32* %4
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sub i32 %10, %11
%13 = sub i32 -1, %12
store i32 %13, i32* %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = sub i32 %15, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @CalcTimeDifference(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, %0
%4 = xor i32 %0, -1
%5 = sub i32 0, %0
%6 = select i1 %3, i32 %4, i32 %5
%7 = add i32 %6, %1
ret i32 %7
}
/* Variables and functions */
bool sub_and_test(float a, float b) {
  if ((a == 0.0) || (b == 0.0)) {
    return 0;
  }
  return ((a - b) == a);
}


x86 assembly (clang, -O0):
<sub_and_test>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112f <sub_and_test+0x2f>
jp     112f <sub_and_test+0x2f>
jmp    114b <sub_and_test+0x4b>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1157 <sub_and_test+0x57>
jp     1157 <sub_and_test+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1175 <sub_and_test+0x75>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_and_test>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomiss %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
ucomiss %xmm0,%xmm2
setnp  %sil
sete   %al
and    %sil,%al
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @sub_and_test(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 0, i32* %3
br label %21
14: ; preds = %9
%15 = load float, float* %4
%16 = load float, float* %5
%17 = fsub float %15, %16
%18 = load float, float* %4
%19 = fcmp oeq float %17, %18
%20 = zext i1 %19 to i32
store i32 %20, i32* %3
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @sub_and_test(float %0, float %1) {
%3 = fcmp une float %0, 0.000000e+00
%4 = fcmp une float %1, 0.000000e+00
%5 = fsub float %0, %1
%6 = fcmp oeq float %5, %0
%7 = and i1 %3, %4
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_enablevreftraining(size_t ahbregaddr) {
  (*(volatile uint32_t *)((184 << 2) + (ahbregaddr))) |= (1 << 24);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2e0,%rax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x1000000,0x2e0(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_enablevreftraining(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 736, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 16777216
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_enablevreftraining(i64 %0) {
%2 = add i64 %0, 736
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 16777216
store volatile i32 %5, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_loop_with_nop_cycle_cost(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @get_loop_with_nop_cycle_cost() {
ret i32 5
}

LLVM IR (-O2):
define i32 @get_loop_with_nop_cycle_cost() {
ret i32 5
}
/* Variables and functions */
float exp(float const);
float gauss_2d(float mx, float my, float sx, float sy, float x, float y) {
  float const dx = (x - mx) / sx;
  float const dy = (y - my) / sy;
  return exp(-(dx * dx + dy * dy) / 2);
}


x86 assembly (clang, -O0):
<gauss_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x20(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe71(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gauss_2d>:
subss  %xmm0,%xmm4
divss  %xmm2,%xmm4
subss  %xmm1,%xmm5
divss  %xmm3,%xmm5
mulss  %xmm5,%xmm5
mulss  %xmm4,%xmm4
addss  %xmm5,%xmm4
mulss  0xecc(%rip),%xmm4
movaps %xmm4,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @gauss_2d(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%15 = load float, float* %11
%16 = load float, float* %7
%17 = fsub float %15, %16
%18 = load float, float* %9
%19 = fdiv float %17, %18
store float %19, float* %13
%20 = load float, float* %12
%21 = load float, float* %8
%22 = fsub float %20, %21
%23 = load float, float* %10
%24 = fdiv float %22, %23
store float %24, float* %14
%25 = load float, float* %13
%26 = load float, float* %13
%27 = load float, float* %14
%28 = load float, float* %14
%29 = fmul float %27, %28
%30 = call float @llvm.fmuladd.f32(float %25, float %26, float %29)
%31 = fneg float %30
%32 = fdiv float %31, 2.000000e+00
%33 = call float @exp(float %32)
ret float %33
}

LLVM IR (-O2):
define float @gauss_2d(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fsub float %4, %0
%8 = fdiv float %7, %2
%9 = fsub float %5, %1
%10 = fdiv float %9, %3
%11 = fmul float %10, %10
%12 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %11)
%13 = fmul float %12, -5.000000e-01
%14 = tail call float @exp(float %13)
ret float %14
}
/* Variables and functions */
double gegl_floor(double);
double gegl_ceil(double x) { return -gegl_floor(-x); }


x86 assembly (clang, -O0):
<gegl_ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <gegl_floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gegl_ceil>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <gegl_floor@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gegl_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @gegl_floor(double %4)
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @gegl_ceil(double %0) {
%2 = fneg double %0
%3 = tail call double @gegl_floor(double %2)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
void *malloc(size_t);
void *numa_alloc_interleaved(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<numa_alloc_interleaved>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @numa_alloc_interleaved(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @numa_alloc_interleaved(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ AltitudeHoldStateHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void AltitudeHoldStateRequestUpdate() {
  UAVObjRequestUpdate(AltitudeHoldStateHandle());
}


x86 assembly (clang, -O0):
<AltitudeHoldStateRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AltitudeHoldStateHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AltitudeHoldStateRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <AltitudeHoldStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @AltitudeHoldStateRequestUpdate() {
%1 = call i32 (...) @AltitudeHoldStateHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AltitudeHoldStateRequestUpdate() {
%1 = tail call i32 (...) @AltitudeHoldStateHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
char *diskfd_to_devpath(int);
int /*<<< orphan*/ free(char *);
int path_attached_to_hba(char *, char const *);
int disk_attached_to_hba(int fd, const char *hba_path) {
  char *disk_path = diskfd_to_devpath(fd);
  int rc = path_attached_to_hba(disk_path, hba_path);
  if (disk_path)
    free(disk_path);
  return rc;
}


x86 assembly (clang, -O0):
<disk_attached_to_hba>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <diskfd_to_devpath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <path_attached_to_hba@plt>
mov    %eax,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116f <disk_attached_to_hba+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disk_attached_to_hba>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbp
call   1050 <diskfd_to_devpath@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1040 <path_attached_to_hba@plt>
mov    %eax,%ebp
test   %rbx,%rbx
je     1158 <disk_attached_to_hba+0x28>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @disk_attached_to_hba(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i32, i32* %3
%8 = call i8* @diskfd_to_devpath(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i32 @path_attached_to_hba(i8* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
br label %17
17: ; preds = %14, %2
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @disk_attached_to_hba(i32 %0, i8* %1) {
%3 = tail call i8* @diskfd_to_devpath(i32 %0)
%4 = tail call i32 @path_attached_to_hba(i8* %3, i8* %1)
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
float cos(int);
int log(float);
float random2();
float sqrt(int);
float randn(void) {
  float x = random2();
  float y = random2();
  return sqrt(-2 * log(x)) * cos(2 * (3.14159265359) * y);
}


x86 assembly (clang, -O0):
<randn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random2@plt>
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random2@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1060 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe75(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randn>:
push   %rax
xor    %eax,%eax
call   1030 <random2@plt>
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <random2@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1050 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1060 <sqrt@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe7b(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mulss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @randn() {
%1 = alloca float
%2 = alloca float
%3 = call float (...) @random2()
store float %3, float* %1
%4 = call float (...) @random2()
store float %4, float* %2
%5 = load float, float* %1
%6 = call i32 @log(float %5)
%7 = mul nsw i32 -2, %6
%8 = call float @sqrt(i32 %7)
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fmul double 0x401921FB54442EEA, %10
%12 = fptosi double %11 to i32
%13 = call float @cos(i32 %12)
%14 = fmul float %8, %13
ret float %14
}

LLVM IR (-O2):
define float @randn() {
%1 = tail call float (...) @random2()
%2 = tail call float (...) @random2()
%3 = tail call i32 @log(float %1)
%4 = mul nsw i32 %3, -2
%5 = tail call float @sqrt(i32 %4)
%6 = fpext float %2 to double
%7 = fmul double %6, 0x401921FB54442EEA
%8 = fptosi double %7 to i32
%9 = tail call float @cos(i32 %8)
%10 = fmul float %5, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int x = 7;
  if (5 < x < 9)
    printf("Correct\n");
  else
    printf("False\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x9,%eax
jge    1150 <main+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <main+0x4c>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Correct\0A\00"
@.str.1 = [7 x i8] c"False\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 5, %3
%5 = zext i1 %4 to i32
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Correct\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int is_even(int a) { return a % 2; }


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = srem i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int open(char *, int /*<<< orphan*/);
void redirect_err_to(char *filename) {
  int fd;
  fd = open(filename, O_WRONLY);
  dup2(fd, 2);
  close(fd);
}


x86 assembly (clang, -O0):
<redirect_err_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect_err_to>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
define void @redirect_err_to(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_WRONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @dup2(i32 %7, i32 2)
%9 = load i32, i32* %3
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define void @redirect_err_to(i8* nocapture %0) {
%2 = load i32, i32* @O_WRONLY
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = tail call i32 @dup2(i32 %3, i32 2)
%5 = tail call i32 @close(i32 %3)
ret void
}