xunge/DecIR huggingface dataset:
double g_Hep(t)
double t;
{
  if (t == 0.0) {
    return 0.0;
  }
  return 5.68e-12 * sqrt(t) * exp(-631515.0 / t) / (1.0 + sqrt(t / 1e5));
}


x86 assembly (clang, -O0):
<g_Hep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1152 <g_Hep+0x32>
jp     1152 <g_Hep+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c6 <g_Hep+0xa6>
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe98(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_Hep>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <g_Hep+0x11>
jp     1131 <g_Hep+0x11>
movapd %xmm1,%xmm0
ret
sub    $0x18,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
jb     114b <g_Hep+0x2b>
sqrtsd %xmm0,%xmm0
jmp    1150 <g_Hep+0x30>
call   1040 <sqrt@plt>
mulsd  0xea8(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xea2(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm1
divsd  0xe87(%rip),%xmm0
ucomisd 0xe8f(%rip),%xmm0
jb     1199 <g_Hep+0x79>
sqrtsd %xmm0,%xmm0
jmp    11aa <g_Hep+0x8a>
movsd  %xmm1,0x8(%rsp)
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xe66(%rip),%xmm0
divsd  %xmm0,%xmm1
add    $0x18,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @g_Hep(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sqrt(double %8)
%10 = fmul double 5.680000e-12, %9
%11 = load double, double* %3
%12 = fdiv double -6.315150e+05, %11
%13 = call double @exp(double %12)
%14 = fmul double %10, %13
%15 = load double, double* %3
%16 = fdiv double %15, 1.000000e+05
%17 = call double @sqrt(double %16)
%18 = fadd double 1.000000e+00, %17
%19 = fdiv double %14, %18
store double %19, double* %2
br label %20
20: ; preds = %7, %6
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @g_Hep(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fmul double %4, 5.680000e-12
%6 = fdiv double -6.315150e+05, %0
%7 = tail call double @exp(double %6)
%8 = fmul double %5, %7
%9 = fdiv double %0, 1.000000e+05
%10 = tail call double @sqrt(double %9)
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
br label %13
13: ; preds = %1, %3
%14 = phi double [ %12, %3 ], [ 0.000000e+00, %1 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_bfin_ssync();
void ssync(void) { __builtin_bfin_ssync(); }


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

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

LLVM IR (-O0):
define void @ssync() {
%1 = call i32 (...) @__builtin_bfin_ssync()
ret void
}

LLVM IR (-O2):
define void @ssync() {
%1 = tail call i32 (...) @__builtin_bfin_ssync()
ret void
}
/* Type definitions */
typedef char *int64_t;

/* Variables and functions */
int64_t neg32(int64_t in) {
  int64_t out;
  asm("neg %%eax" : "=a"(out) : "0"(in));
  return out;
}


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

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

LLVM IR (-O0):
define i8* @neg32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "neg %eax", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @neg32(i8* readnone %0) {
%2 = tail call i8* asm "neg %eax", "={ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt13(void) {
  SendInterrupt(0x5D, 0x1, 0x8000, 0x20000000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5d,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x20000000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt13>:
mov    $0x5d,%edi
mov    $0x1,%esi
mov    $0x8000,%edx
mov    $0x20000000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt13() {
%1 = call i32 @SendInterrupt(i32 93, i32 1, i32 32768, i32 536870912)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt13() {
%1 = tail call i32 @SendInterrupt(i32 93, i32 1, i32 32768, i32 536870912)
ret void
}
/* Type definitions */
struct gbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
size_t gbuf_size(struct gbuf const *);
size_t gbuf_nmemb(struct gbuf const *buf, size_t elem_size) {
  assert(buf != NULL);
  return gbuf_size(buf) / elem_size;
}


x86 assembly (clang, -O0):
<gbuf_nmemb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <gbuf_size@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbuf_nmemb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <gbuf_size@plt>
mov    %rax,%rcx
or     %r14,%rcx
shr    $0x20,%rcx
je     1153 <gbuf_nmemb+0x33>
xor    %edx,%edx
div    %r14
jmp    1158 <gbuf_nmemb+0x38>
xor    %edx,%edx
div    %r14d
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.gbuf = type { i32 }
define i64 @gbuf_nmemb(%struct.gbuf* %0, i64 %1) {
%3 = alloca %struct.gbuf*
%4 = alloca i64
store %struct.gbuf* %0, %struct.gbuf** %3
store i64 %1, i64* %4
%5 = load %struct.gbuf*, %struct.gbuf** %3
%6 = icmp ne %struct.gbuf* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.gbuf*, %struct.gbuf** %3
%10 = call i64 @gbuf_size(%struct.gbuf* %9)
%11 = load i64, i64* %4
%12 = udiv i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.gbuf = type { i32 }
define i64 @gbuf_nmemb(%struct.gbuf* %0, i64 %1) {
%3 = icmp ne %struct.gbuf* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 @gbuf_size(%struct.gbuf* %0)
%7 = udiv i64 %6, %1
ret i64 %7
}
/* Variables and functions */
size_t xv_round2(size_t x) {
  x -= 1;
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  x |= (x >> 32);
  x++;
  return x;
}


x86 assembly (clang, -O0):
<xv_round2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xv_round2>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @xv_round2(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
unsigned addval_124(unsigned x) { return x + 1019724425U; }


x86 assembly (clang, -O0):
<addval_124>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3cc7c289,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @addval_124(i32 %0) {
%2 = add i32 %0, 1019724425
ret i32 %2
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int procnetdev_version(char *buf) {
  if (strstr(buf, "compressed"))
    return 3;
  if (strstr(buf, "bytes"))
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<procnetdev_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <procnetdev_version+0x32>
movl   $0x3,-0x4(%rbp)
jmp    116f <procnetdev_version+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1168 <procnetdev_version+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <procnetdev_version+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procnetdev_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
je     112f <procnetdev_version+0x1f>
pop    %rbx
ret
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
cmp    $0x1,%rax
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"compressed\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @procnetdev_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 3, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strstr(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %14
13: ; preds = %8
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"compressed\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @procnetdev_version(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 3, %1 ], [ %7, %4 ]
ret i32 %9
}
OP(fd, e2) {
  illegal_1();
  op_e2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_e2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_e2()
ret i32 undef
}
int console_msg_printer_close(void *impl) {
  (void)impl;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @console_msg_printer_close(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void nrerror(char error_text[]) {
  printf("ERROR: terminating optimizer - %s\n", error_text);
}


x86 assembly (clang, -O0):
<nrerror>:
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):
<nrerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [35 x i8] c"ERROR: terminating optimizer - %s\0A\00"
define void @nrerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int, char const *);
void test_assert_equal_f32(float val1, float val2, const char *msg) {
  test_assert(val1 >= val2 - 0.00000001 && val1 <= val2 + 0.00000001, msg);
}


x86 assembly (clang, -O0):
<test_assert_equal_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xec0(%rip),%xmm2
subsd  %xmm2,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jb     117b <test_assert_equal_f32+0x6b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe93(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_equal_f32>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movsd  0xee0(%rip),%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
setae  %al
addsd  0xed5(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    %rdi,%rsi
setae  %cl
and    %al,%cl
movzbl %cl,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @test_assert_equal_f32(float %0, float %1, i8* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i8*
store float %0, float* %4
store float %1, float* %5
store i8* %2, i8** %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fsub double %10, 1.000000e-08
%12 = fcmp oge double %8, %11
br i1 %12, label %13, label %20
13: ; preds = %3
%14 = load float, float* %4
%15 = fpext float %14 to double
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fadd double %17, 1.000000e-08
%19 = fcmp ole double %15, %18
br label %20
20: ; preds = %13, %3
%21 = phi i1 [ false, %3 ], [ %19, %13 ]
%22 = zext i1 %21 to i32
%23 = load i8*, i8** %6
%24 = call i32 @test_assert(i32 %22, i8* %23)
ret void
}

LLVM IR (-O2):
define void @test_assert_equal_f32(float %0, float %1, i8* %2) {
%4 = fpext float %0 to double
%5 = fpext float %1 to double
%6 = fadd double %5, -1.000000e-08
%7 = fcmp ole double %6, %4
%8 = fadd double %5, 1.000000e-08
%9 = fcmp oge double %8, %4
%10 = and i1 %7, %9
%11 = zext i1 %10 to i32
%12 = tail call i32 @test_assert(i32 %11, i8* %2)
ret void
}
int Q_isgraph(int c) {
  if (c >= 0x21 && c <= 0x7E)
    return (1);
  if (c >= 0x80 && c <= 0xFE)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<Q_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x21,-0x8(%rbp)
jl     1127 <Q_isgraph+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <Q_isgraph+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1154 <Q_isgraph+0x54>
cmpl   $0x80,-0x8(%rbp)
jl     114d <Q_isgraph+0x4d>
cmpl   $0xfe,-0x8(%rbp)
jg     114d <Q_isgraph+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <Q_isgraph+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isgraph>:
lea    -0x21(%rdi),%eax
cmp    $0x5e,%eax
setb   %al
add    $0xffffff80,%edi
cmp    $0x7f,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @Q_isgraph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %18
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 128
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 254
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %18
17: ; preds = %13, %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @Q_isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = add i32 %0, -128
%5 = icmp ult i32 %4, 127
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int Hsh_Int3ManHash(int iData0, int iData1, int iData2, int nTableSize) {
  return (4177 * (unsigned)iData0 + 7873 * (unsigned)iData1 +
          1699 * (unsigned)iData2) %
         (unsigned)nTableSize;
}


x86 assembly (clang, -O0):
<Hsh_Int3ManHash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
imul   $0x1051,-0x4(%rbp),%eax
imul   $0x1ec1,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0x6a3,-0xc(%rbp),%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hsh_Int3ManHash>:
imul   $0x1051,%edi,%eax
imul   $0x1ec1,%esi,%esi
add    %eax,%esi
imul   $0x6a3,%edx,%eax
add    %esi,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Hsh_Int3ManHash(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = mul i32 4177, %9
%11 = load i32, i32* %6
%12 = mul i32 7873, %11
%13 = add i32 %10, %12
%14 = load i32, i32* %7
%15 = mul i32 1699, %14
%16 = add i32 %13, %15
%17 = load i32, i32* %8
%18 = urem i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @Hsh_Int3ManHash(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %0, 4177
%6 = mul i32 %1, 7873
%7 = add i32 %6, %5
%8 = mul i32 %2, 1699
%9 = add i32 %7, %8
%10 = urem i32 %9, %3
ret i32 %10
}
void test_mixed(double d1, float f2) {
  (void)__builtin_isgreater(d1, f2);
  (void)__builtin_isgreaterequal(d1, f2);
  (void)__builtin_isless(d1, f2);
  (void)__builtin_islessequal(d1, f2);
  (void)__builtin_islessgreater(d1, f2);
  (void)__builtin_isunordered(d1, f2);
}


x86 assembly (clang, -O0):
<test_mixed>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_mixed(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp ogt double %5, %7
%9 = zext i1 %8 to i32
%10 = load double, double* %3
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = fcmp oge double %10, %12
%14 = zext i1 %13 to i32
%15 = load double, double* %3
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = fcmp olt double %15, %17
%19 = zext i1 %18 to i32
%20 = load double, double* %3
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = fcmp ole double %20, %22
%24 = zext i1 %23 to i32
%25 = load double, double* %3
%26 = load float, float* %4
%27 = fpext float %26 to double
%28 = fcmp one double %25, %27
%29 = zext i1 %28 to i32
%30 = load double, double* %3
%31 = load float, float* %4
%32 = fpext float %31 to double
%33 = fcmp uno double %30, %32
%34 = zext i1 %33 to i32
ret void
}

LLVM IR (-O2):
define void @test_mixed(double %0, float %1) {
ret void
}
/* Variables and functions */
int mygetchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  c = mygetchar();
  printf("%c", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 (...) @mygetchar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FP_COMPARE_MEM();
int /*<<< orphan*/ addbyte(int);
void FP_COMPARE_IW() {
  addbyte(0x0f);
  addbyte(0xbf);
  addbyte(0xc0);
  addbyte(0xf2);
  addbyte(0x0f);
  addbyte(0x2a);
  addbyte(0xc8);
  FP_COMPARE_MEM();
}


x86 assembly (clang, -O0):
<FP_COMPARE_IW>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0xbf,%edi
call   1040 <addbyte@plt>
mov    $0xc0,%edi
call   1040 <addbyte@plt>
mov    $0xf2,%edi
call   1040 <addbyte@plt>
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0x2a,%edi
call   1040 <addbyte@plt>
mov    $0xc8,%edi
call   1040 <addbyte@plt>
mov    $0x0,%al
call   1030 <FP_COMPARE_MEM@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_COMPARE_IW>:
push   %rax
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0xbf,%edi
call   1040 <addbyte@plt>
mov    $0xc0,%edi
call   1040 <addbyte@plt>
mov    $0xf2,%edi
call   1040 <addbyte@plt>
mov    $0xf,%edi
call   1040 <addbyte@plt>
mov    $0x2a,%edi
call   1040 <addbyte@plt>
mov    $0xc8,%edi
call   1040 <addbyte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <FP_COMPARE_MEM@plt>

LLVM IR (-O0):
define void @FP_COMPARE_IW() {
%1 = call i32 @addbyte(i32 15)
%2 = call i32 @addbyte(i32 191)
%3 = call i32 @addbyte(i32 192)
%4 = call i32 @addbyte(i32 242)
%5 = call i32 @addbyte(i32 15)
%6 = call i32 @addbyte(i32 42)
%7 = call i32 @addbyte(i32 200)
%8 = call i32 (...) @FP_COMPARE_MEM()
ret void
}

LLVM IR (-O2):
define void @FP_COMPARE_IW() {
%1 = tail call i32 @addbyte(i32 15)
%2 = tail call i32 @addbyte(i32 191)
%3 = tail call i32 @addbyte(i32 192)
%4 = tail call i32 @addbyte(i32 242)
%5 = tail call i32 @addbyte(i32 15)
%6 = tail call i32 @addbyte(i32 42)
%7 = tail call i32 @addbyte(i32 200)
%8 = tail call i32 (...) @FP_COMPARE_MEM()
ret void
}
/* Variables and functions */
void CL_FlushMemory(void) {}


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

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

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

LLVM IR (-O2):
define void @CL_FlushMemory() {
ret void
}
void free_value(void *a) {}


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

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

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

LLVM IR (-O2):
define void @free_value(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char const *);
int use_atoi(const char *here, const int maxlen) { return atoi(here); }


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

x86 assembly (clang, -O2):
<use_atoi>:
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @use_atoi(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 = call i32 @atoi(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @use_atoi(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @atoi(i8* %0)
ret i32 %3
}
float kpa2psi(float kpa) { return kpa * (1.0f / 6.89475729f); }


x86 assembly (clang, -O0):
<kpa2psi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kpa2psi>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @kpa2psi(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3FC29098C0000000
ret float %4
}

LLVM IR (-O2):
define float @kpa2psi(float %0) {
%2 = fmul float %0, 0x3FC29098C0000000
ret float %2
}
__attribute__((weak, used, noreturn)) void _exit(int i) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @_exit to i8*)], section "llvm.metadata"
define weak void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32)* @_exit to i8*)], section "llvm.metadata"
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void bar(void) {
  char *nuller = 0;
  puts("hi in bar");
  *nuller = 'a';
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"hi in bar\00"
define void @bar() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %1
store i8 97, i8* %3
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"hi in bar\00"
define void @bar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola a todos \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [15 x i8] c"Hola a todos \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hola a todos \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __sev();
void check__sev(void) { __sev(); }


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

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

LLVM IR (-O0):
define void @check__sev() {
%1 = call i32 (...) @__sev()
ret void
}

LLVM IR (-O2):
define void @check__sev() {
%1 = tail call i32 (...) @__sev()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_platform_id;
typedef int cl_int;

/* Variables and functions */
int main(void) {
  cl_platform_id id;
  cl_int result;
  result = 0;
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int rand();
int motAleatoire(char mot[]) { return rand(); }


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

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

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

LLVM IR (-O2):
define i32 @motAleatoire(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  TYPE_1__ *r_map;
};
struct TYPE_3__ {
  int l_next;
  char *l_name;
};

/* Variables and functions */
TYPE_2__ _r_debug;
int /*<<< orphan*/ puts(char *);
void break_link_map() {
  puts("Overwriting link_map.");
  _r_debug.r_map->l_next = 0x1337BEEF;
  _r_debug.r_map->l_name = "invalid";
}


x86 assembly (clang, -O0):
<break_link_map>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
movl   $0x1337beef,(%rax)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
lea    0xed5(%rip),%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<break_link_map>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ec4(%rip),%rax
mov    (%rax),%rax
movl   $0x1337beef,(%rax)
lea    0xee2(%rip),%rcx
mov    %rcx,0x8(%rax)
pop    %rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__* }
%struct.TYPE_3__ = type { i32, i8* }
@.str = [22 x i8] c"Overwriting link_map.\00"
@_r_debug = global %struct.TYPE_4__ zeroinitializer
@.str.1 = [8 x i8] c"invalid\00"
define void @break_link_map() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load %struct.TYPE_3__*, %struct.TYPE_3__** getelementptr inbounds (%struct.TYPE_4__, %struct.TYPE_4__* @_r_debug, i32 0, i32 0)
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i32 0, i32 0
store i32 322420463, i32* %3
%4 = load %struct.TYPE_3__*, %struct.TYPE_3__** getelementptr inbounds (%struct.TYPE_4__, %struct.TYPE_4__* @_r_debug, i32 0, i32 0)
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i32 0, i32 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %5
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { %struct.TYPE_3__* }
%struct.TYPE_3__ = type { i32, i8* }
@.str = [22 x i8] c"Overwriting link_map.\00"
@_r_debug = global %struct.TYPE_4__ zeroinitializer
@.str.1 = [8 x i8] c"invalid\00"
define void @break_link_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load %struct.TYPE_3__*, %struct.TYPE_3__** getelementptr inbounds (%struct.TYPE_4__, %struct.TYPE_4__* @_r_debug, i64 0, i32 0)
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
store i32 322420463, i32* %3
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %4
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t CRCUpdateCCITT(uint16_t crc, uint8_t data) {
  data ^= (uint8_t)(crc & 0xFF);
  data ^= (data << 4);
  return (crc >> 8) ^ (data << 8) ^ (data << 3) ^ (data >> 4);
}


x86 assembly (clang, -O0):
<CRCUpdateCCITT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
xor    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRCUpdateCCITT>:
movzbl %dil,%ecx
xor    %esi,%ecx
mov    %ecx,%eax
shl    $0x4,%eax
xor    %ecx,%eax
sar    $0x8,%edi
mov    %eax,%ecx
shl    $0x8,%ecx
xor    %edi,%ecx
lea    0x0(,%rax,8),%edx
sar    $0x4,%eax
xor    %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @CRCUpdateCCITT(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = load i32, i32* %4
%8 = xor i32 %7, %6
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = shl i32 %9, 4
%11 = load i32, i32* %4
%12 = xor i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = ashr i32 %13, 8
%15 = load i32, i32* %4
%16 = shl i32 %15, 8
%17 = xor i32 %14, %16
%18 = load i32, i32* %4
%19 = shl i32 %18, 3
%20 = xor i32 %17, %19
%21 = load i32, i32* %4
%22 = ashr i32 %21, 4
%23 = xor i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @CRCUpdateCCITT(i32 %0, i32 %1) {
%3 = and i32 %0, 255
%4 = xor i32 %3, %1
%5 = shl i32 %4, 4
%6 = xor i32 %5, %4
%7 = ashr i32 %0, 8
%8 = shl i32 %6, 8
%9 = xor i32 %8, %7
%10 = shl i32 %6, 3
%11 = xor i32 %9, %10
%12 = ashr i32 %6, 4
%13 = xor i32 %11, %12
ret i32 %13
}
void GP_break32(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break32() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read32le(void *buf) {
  uint8_t *p = buf;
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


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

x86 assembly (clang, -O2):
<read32le>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @read32le(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 12
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
char *cpputest_malloc_location(unsigned long, char *, int);
char *mallocAllocation() {
  return cpputest_malloc_location(
      10UL,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/Pindar/common-data-structures-in-c/refs/heads/"
      "master/Code/Mug_tdd/tests/CppUTest/tests/AllocationInCFile.c",
      9);
}


x86 assembly (clang, -O0):
<mallocAllocation>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
lea    0xee0(%rip),%rsi
mov    $0x9,%edx
call   1030 <cpputest_malloc_location@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallocAllocation>:
lea    0xee9(%rip),%rsi
mov    $0xa,%edi
mov    $0x9,%edx
jmp    1030 <cpputest_malloc_location@plt>

LLVM IR (-O0):
@.str = [197 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Pindar/common-data-structures-in-c/refs/heads/master/Code/Mug_tdd/tests/CppUTest/tests/AllocationInCFile.c\00"
define i8* @mallocAllocation() {
%1 = call i8* @cpputest_malloc_location(i64 10, i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0), i32 9)
ret i8* %1
}

LLVM IR (-O2):
@.str = [197 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Pindar/common-data-structures-in-c/refs/heads/master/Code/Mug_tdd/tests/CppUTest/tests/AllocationInCFile.c\00"
define i8* @mallocAllocation() {
%1 = tail call i8* @cpputest_malloc_location(i64 10, i8* getelementptr inbounds ([197 x i8], [197 x i8]* @.str, i64 0, i64 0), i32 9)
ret i8* %1
}
/* Variables and functions */
int xyzzy(int);
int foo(int a) { return xyzzy(a); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <xyzzy@plt>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @xyzzy(i32 %0)
ret i32 %2
}
int comparInt(const void *p1, const void *p2) {
  return (*(const int *)p1 - *(const int *)p2);
}


x86 assembly (clang, -O0):
<comparInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparInt>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @comparInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comparInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void halt_and_catch_fire() {
  printk("SYSTEM HALTED!");
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<halt_and_catch_fire>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printk@plt>
jmp    1120 <halt_and_catch_fire+0x10>

x86 assembly (clang, -O2):
<halt_and_catch_fire>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
nopl   (%rax)
jmp    1120 <halt_and_catch_fire+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"SYSTEM HALTED!\00"
define void @halt_and_catch_fire() {
%1 = call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [15 x i8] c"SYSTEM HALTED!\00"
define void @halt_and_catch_fire() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d", INT_MAX);
  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    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@INT_MAX = global i32 0
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* @INT_MAX
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int Q921_ADD(int a, int b) { return (a + b) % 128; }


x86 assembly (clang, -O0):
<Q921_ADD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q921_ADD>:
lea    (%rsi,%rdi,1),%ecx
add    $0x7f,%ecx
mov    %esi,%eax
add    %edi,%eax
cmovns %eax,%ecx
and    $0xffffff80,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Q921_ADD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = srem i32 %7, 128
ret i32 %8
}

LLVM IR (-O2):
define i32 @Q921_ADD(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %3, 128
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main() {
  if (foo() != 15)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0xf,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0xf,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 15
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 15
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void myvm_vset(int val, struct myvm_vm *vm) {}


x86 assembly (clang, -O0):
<myvm_vset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.myvm_vm = type opaque
define void @myvm_vset(i32 %0, %struct.myvm_vm* %1) {
%3 = alloca i32
%4 = alloca %struct.myvm_vm*
store i32 %0, i32* %3
store %struct.myvm_vm* %1, %struct.myvm_vm** %4
ret void
}

LLVM IR (-O2):
%struct.myvm_vm = type opaque
define void @myvm_vset(i32 %0, %struct.myvm_vm* nocapture %1) {
ret void
}
void XR_memset(unsigned char *output, unsigned char data, unsigned int len) {
  if (len != 0) {
    do {
      *output++ = (unsigned char)data;
    } while (--len != 0);
  }
}


x86 assembly (clang, -O0):
<XR_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     114b <XR_memset+0x4b>
jmp    1120 <XR_memset+0x20>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jne    1120 <XR_memset+0x20>
jmp    114b <XR_memset+0x4b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<XR_memset>:
test   %edx,%edx
je     1124 <XR_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @XR_memset(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void yet_another_function() {
  printf("You have called yet_another_function\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"You have called yet_another_function\0A\00"
define void @yet_another_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"You have called yet_another_function\00"
define void @yet_another_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}