xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *errorMessage) {
  perror(errorMessage);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ plcvm_get_u32(scalar_t__);
scalar_t__ plcvm_lpm_u8();
scalar_t__ plcvm_pop();
int /*<<< orphan*/ plcvm_push(int /*<<< orphan*/);
void cb_ldm_s4_cs8(void) {
  plcvm_push(plcvm_get_u32(plcvm_pop() + plcvm_lpm_u8()));
}


x86 assembly (clang, -O0):
<cb_ldm_s4_cs8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <plcvm_pop@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <plcvm_lpm_u8@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <plcvm_get_u32@plt>
mov    %eax,%edi
call   1050 <plcvm_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_ldm_s4_cs8>:
push   %rbx
xor    %eax,%eax
call   1030 <plcvm_pop@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <plcvm_lpm_u8@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <plcvm_get_u32@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <plcvm_push@plt>

LLVM IR (-O0):
define void @cb_ldm_s4_cs8() {
%1 = call i64 (...) @plcvm_pop()
%2 = call i64 (...) @plcvm_lpm_u8()
%3 = add nsw i64 %1, %2
%4 = call i32 @plcvm_get_u32(i64 %3)
%5 = call i32 @plcvm_push(i32 %4)
ret void
}

LLVM IR (-O2):
define void @cb_ldm_s4_cs8() {
%1 = tail call i64 (...) @plcvm_pop()
%2 = tail call i64 (...) @plcvm_lpm_u8()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @plcvm_get_u32(i64 %3)
%5 = tail call i32 @plcvm_push(i32 %4)
ret void
}
int sicmp(unsigned char a, unsigned char b) {
  if (a >= 'A' || a <= 'Z')
    a += 'a' - 'A';
  if (b >= 'A' || b <= 'Z')
    b += 'a' - 'A';
  return ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1));
}


x86 assembly (clang, -O0):
<sicmp>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jge    112a <sicmp+0x2a>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1134 <sicmp+0x34>
movzbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jge    114e <sicmp+0x4e>
movzbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1158 <sicmp+0x58>
movzbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    1175 <sicmp+0x75>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <sicmp+0x8c>
movzbl -0x1(%rbp),%edx
movzbl -0x2(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sicmp>:
lea    0x20(%rdi),%eax
lea    0x20(%rsi),%ecx
xor    %edx,%edx
cmp    %sil,%dil
setne  %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovbe %edx,%eax
ret

LLVM IR (-O0):
define i32 @sicmp(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp sge i32 %6, 65
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %17
12: ; preds = %8, %2
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = add nsw i32 %14, 32
%16 = trunc i32 %15 to i8
store i8 %16, i8* %3
br label %17
17: ; preds = %12, %8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %30
25: ; preds = %21, %17
%26 = load i8, i8* %4
%27 = zext i8 %26 to i32
%28 = add nsw i32 %27, 32
%29 = trunc i32 %28 to i8
store i8 %29, i8* %4
br label %30
30: ; preds = %25, %21
%31 = load i8, i8* %3
%32 = zext i8 %31 to i32
%33 = load i8, i8* %4
%34 = zext i8 %33 to i32
%35 = icmp sgt i32 %32, %34
br i1 %35, label %36, label %37
36: ; preds = %30
br label %45
37: ; preds = %30
%38 = load i8, i8* %3
%39 = zext i8 %38 to i32
%40 = load i8, i8* %4
%41 = zext i8 %40 to i32
%42 = icmp eq i32 %39, %41
%43 = zext i1 %42 to i64
%44 = select i1 %42, i32 0, i32 -1
br label %45
45: ; preds = %37, %36
%46 = phi i32 [ 1, %36 ], [ %44, %37 ]
ret i32 %46
}

LLVM IR (-O2):
define i32 @sicmp(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %0, 32
%4 = add i8 %1, 32
%5 = icmp ugt i8 %3, %4
%6 = icmp ne i8 %0, %1
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testLesEqual() { printf("%d <= %d = %d\n", 10, 4, 10 <= 4); }


x86 assembly (clang, -O0):
<testLesEqual>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLesEqual>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d <= %d = %d\0A\00"
define void @testLesEqual() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d <= %d = %d\0A\00"
define void @testLesEqual() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ square(int);
unsigned long total() {
  unsigned long long sum = 0;
  for (int i = 1; i < 65; ++i)
    sum += square(i);
  return sum;
}


x86 assembly (clang, -O0):
<total>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jge    114f <total+0x3f>
mov    -0xc(%rbp),%edi
call   1030 <square@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <total+0x17>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<total>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <square@plt>
add    %rax,%rbx
add    $0x1,%ebp
cmp    $0x41,%ebp
jne    1120 <total+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @total() {
%1 = alloca i64
%2 = alloca i32
store i64 0, i64* %1
store i32 1, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 65
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i64 @square(i32 %7)
%9 = load i64, i64* %1
%10 = add i64 %9, %8
store i64 %10, i64* %1
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @total() {
br label %2
1: ; preds = %2
ret i64 %6
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %7, %2 ]
%4 = phi i64 [ 0, %0 ], [ %6, %2 ]
%5 = tail call i64 @square(i32 %3)
%6 = add i64 %5, %4
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 65
br i1 %8, label %1, label %2
}
/* Variables and functions */
int luaO_fb2int(int x) {
  int e = (x >> 3) & 0x1f;
  if (e == 0)
    return x;
  else
    return ((x & 7) + 8) << (e - 1);
}


x86 assembly (clang, -O0):
<luaO_fb2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1128 <luaO_fb2int+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113c <luaO_fb2int+0x3c>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
add    $0x8,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaO_fb2int>:
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1f,%edx
lea    -0x1(%rdx),%ecx
mov    %edi,%eax
and    $0x7,%eax
or     $0x8,%eax
shl    %cl,%eax
cmp    $0x1,%edx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @luaO_fb2int(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 31
%4 = icmp eq i32 %3, 0
%5 = and i32 %0, 7
%6 = or i32 %5, 8
%7 = add nsw i32 %3, -1
%8 = shl i32 %6, %7
%9 = select i1 %4, i32 %0, i32 %8
ret i32 %9
}
void acpi_video_unregister(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_video_unregister() {
ret void
}
void FlashMassEraseNonBlocking() {
  (*((volatile unsigned long *)(0x400FD000 + 0x00000014))) =
      (0x00000001 | 0x00000200 | 0x00000800);
  (*((volatile unsigned long *)(0x400FD000 + 0x00000008))) =
      0xA4420000 | 0x00000004;
}


x86 assembly (clang, -O0):
<FlashMassEraseNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fd014,%eax
movq   $0xa01,(%rax)
mov    $0x400fd008,%eax
mov    $0xa4420004,%ecx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashMassEraseNonBlocking>:
movq   $0xa01,0x400fd014
mov    $0xa4420004,%eax
mov    %rax,0x400fd008
40
ret

LLVM IR (-O0):
define void @FlashMassEraseNonBlocking() {
store volatile i64 2561, i64* inttoptr (i64 1074778132 to i64*)
store volatile i64 2755788804, i64* inttoptr (i64 1074778120 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashMassEraseNonBlocking() {
store volatile i64 2561, i64* inttoptr (i64 1074778132 to i64*)
store volatile i64 2755788804, i64* inttoptr (i64 1074778120 to i64*)
ret void
}
double QuadraticEaseOut(double p) { return -(p * (p - 2)); }


x86 assembly (clang, -O0):
<QuadraticEaseOut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee5(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuadraticEaseOut>:
movsd  0xef8(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  0xefc(%rip),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @QuadraticEaseOut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 2.000000e+00
%6 = fmul double %3, %5
%7 = fneg double %6
ret double %7
}

LLVM IR (-O2):
define double @QuadraticEaseOut(double %0) {
%2 = fadd double %0, -2.000000e+00
%3 = fneg double %2
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ test_numbers();
void run_tests() { test_numbers(); }


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

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

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

LLVM IR (-O2):
define void @run_tests() {
%1 = tail call i32 (...) @test_numbers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: mtree [-LPUcdeinqruxw] [-f spec] [-f spec] [-K "
                        "key] [-k key] [-p path] [-s seed]\n"
                        "\t[-X excludes]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [104 x i8] c"usage: mtree [-LPUcdeinqruxw] [-f spec] [-f spec] [-K key] [-k key] [-p path] [-s seed]\0A\09[-X excludes]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [104 x i8] c"usage: mtree [-LPUcdeinqruxw] [-f spec] [-f spec] [-K key] [-k key] [-p path] [-s seed]\0A\09[-X excludes]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float ceilf(float const);
void glmCeil3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = ceilf(x[i]);
}


x86 assembly (clang, -O0):
<glmCeil3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmCeil3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <ceilf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmCeil3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmCeil3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <ceilf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmCeil3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @llvm.ceil.f32(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmCeil3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.ceil.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.ceil.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @llvm.ceil.f32(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Type definitions */
struct jx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ jx_insert(struct jx *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ jx_string(char const *);
void jx_insert_string(struct jx *j, const char *key, const char *value) {
  jx_insert(j, jx_string(key), jx_string(value));
}


x86 assembly (clang, -O0):
<jx_insert_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <jx_string@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <jx_string@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
call   1030 <jx_insert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jx_insert_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <jx_string@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <jx_string@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <jx_insert@plt>

LLVM IR (-O0):
%struct.jx = type { i32 }
define void @jx_insert_string(%struct.jx* %0, i8* %1, i8* %2) {
%4 = alloca %struct.jx*
%5 = alloca i8*
%6 = alloca i8*
store %struct.jx* %0, %struct.jx** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.jx*, %struct.jx** %4
%8 = load i8*, i8** %5
%9 = call i32 @jx_string(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @jx_string(i8* %10)
%12 = call i32 @jx_insert(%struct.jx* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.jx = type { i32 }
define void @jx_insert_string(%struct.jx* %0, i8* %1, i8* %2) {
%4 = tail call i32 @jx_string(i8* %1)
%5 = tail call i32 @jx_string(i8* %2)
%6 = tail call i32 @jx_insert(%struct.jx* %0, i32 %4, i32 %5)
ret void
}
int sign(double x) {
  if (x < 0.0)
    return (-1);
  else if (x > 0.0)
    return (+1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1123 <sign+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <sign+0x48>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1141 <sign+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sign+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 -1, i32 %4
ret i32 %5
}
short donothing(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @donothing() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @donothing() {
ret i16 0
}
/* Variables and functions */
int memcmp_timec(void const *, void const *, size_t);
int tc_memcmp(const void *s1, const void *s2, size_t n) {
  return memcmp_timec(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<tc_memcmp>:
jmp    1030 <memcmp_timec@plt>

LLVM IR (-O0):
define i32 @tc_memcmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp_timec(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @tc_memcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcmp_timec(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
void UI_dup_info_string(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_dup_info_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, unsigned long);
void eeh_memset_io(void *addr, int c, unsigned long n) {
  void *vaddr =
      (void *)((((unsigned long)(addr)) & 0xFFFFFFFF) | (0xEUL << 60));
  memset(vaddr, c, n);
}


x86 assembly (clang, -O0):
<eeh_memset_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
movabs $0xe000000000000000,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeh_memset_io>:
mov    %edi,%eax
movabs $0xe000000000000000,%rdi
or     %rax,%rdi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @eeh_memset_io(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, 4294967295
%11 = or i64 %10, -2305843009213693952
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i32, i32* %5
%15 = load i64, i64* %6
%16 = call i32 @memset(i8* %13, i32 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @eeh_memset_io(i8* %0, i32 %1, i64 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = and i64 %4, 4294967295
%6 = or i64 %5, -2305843009213693952
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memset(i8* %7, i32 %1, i64 %2)
ret void
}
const char *Resize_Definition(void) {
  return "struct Resize {\n"
         "  void (*resize)(var, size_t);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<Resize_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Resize_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [51 x i8] c"struct Resize {\0A void (*resize)(var, size_t);\0A};\0A\00"
define i8* @Resize_Definition() {
ret i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [51 x i8] c"struct Resize {\0A void (*resize)(var, size_t);\0A};\0A\00"
define i8* @Resize_Definition() {
ret i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
long even(long);
long odd(long x) {
  if (x == 0)
    return 0;
  return even(x - 1);
}


x86 assembly (clang, -O0):
<odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <odd+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1145 <odd+0x35>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <even@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd>:
test   %rdi,%rdi
je     111e <odd+0xe>
add    $0xffffffffffffffff,%rdi
jmp    1030 <even@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @odd(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %11
7: ; preds = %1
%8 = load i64, i64* %3
%9 = sub nsw i64 %8, 1
%10 = call i64 @even(i64 %9)
store i64 %10, i64* %2
br label %11
11: ; preds = %7, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @odd(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i64 %0, -1
%5 = tail call i64 @even(i64 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i64 [ %5, %3 ], [ 0, %1 ]
ret i64 %7
}
int hal_init() { return 42; }


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

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

LLVM IR (-O0):
define i32 @hal_init() {
ret i32 42
}

LLVM IR (-O2):
define i32 @hal_init() {
ret i32 42
}
double test_linear_model_2(double *p, double h) { return p[0] + p[1] * h; }


x86 assembly (clang, -O0):
<test_linear_model_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_linear_model_2>:
mulsd  0x8(%rdi),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @test_linear_model_2(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = load double, double* %4
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @test_linear_model_2(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %1, double %3)
ret double %6
}
int Limit(int in, int min, int max) {
  if (in > max)
    return (max);
  if (in < min)
    return (min);
  return (in);
}


x86 assembly (clang, -O0):
<Limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1124 <Limit+0x24>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Limit+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <Limit+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <Limit+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Limit>:
mov    %esi,%eax
cmp    %esi,%edi
cmovge %edi,%eax
cmp    %edx,%edi
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Limit(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int f12_handler(char **save) {
  write_instr(0x00);
  write_imm(0x45);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<f12_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x45,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x45,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f12_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 69)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @f12_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 69)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
void resizehandler(sig) int sig;
{ get_screen_size(); }


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

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

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

LLVM IR (-O2):
define void @resizehandler(i32 %0) {
%2 = tail call i32 (...) @get_screen_size()
ret void
}
int get_bitsperpixel(file_name, bitsperpixel)
char *file_name;
long *bitsperpixel;
{}


x86 assembly (clang, -O0):
<get_bitsperpixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_bitsperpixel(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  volatile double x = 1.0;
  double y = x + x;
  printf("%e\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
movsd  (%rsp),%xmm0
addsd  (%rsp),%xmm0
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store volatile double 1.000000e+00, double* %2
%4 = load volatile double, double* %2
%5 = load volatile double, double* %2
%6 = fadd double %4, %5
store double %6, double* %3
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 1.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = load volatile double, double* %1
%5 = fadd double %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
void av_audio_fifo_free() {}


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

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

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

LLVM IR (-O2):
define void @av_audio_fifo_free() {
ret void
}
int sorthelp(const void *a, const void *b) {
  const int *oa, *ob;
  oa = a;
  ob = b;
  if (*oa > *ob)
    return 1;
  if (*oa < *ob)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sorthelp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <sorthelp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <sorthelp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <sorthelp+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <sorthelp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sorthelp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sorthelp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello xmake!\n");
  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)
lea    0xed3(%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 = [14 x i8] c"hello xmake!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello xmake!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void function_empty_id() { write("csv-task.csv", ",", NULL); }


x86 assembly (clang, -O0):
<function_empty_id>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_empty_id>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_id() {
%1 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_id() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alloc_dcache(int /*<<< orphan*/ *, void *);
void *alloc_kmem_fn(void *arg) {
  alloc_dcache(NULL, (void *)100);
  return NULL;
}


x86 assembly (clang, -O0):
<alloc_kmem_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x64,%esi
call   1030 <alloc_dcache@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_kmem_fn>:
push   %rax
mov    $0x64,%esi
xor    %edi,%edi
call   1030 <alloc_dcache@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @alloc_kmem_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @alloc_dcache(i32* null, i8* inttoptr (i64 100 to i8*))
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @alloc_kmem_fn(i8* nocapture readnone %0) {
%2 = tail call i32 @alloc_dcache(i32* null, i8* inttoptr (i64 100 to i8*))
ret i8* null
}
unsigned int f4(unsigned int arg) { return arg; }


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

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f4(i32 returned %0) {
ret i32 %0
}
int strcmp(s1, s2)
register const char *s1, *s2;
{
  while (*s1 == *s2++)
    if (*s1++ == 0)
      return (0);
  return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116d <strcmp+0x6d>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 0, i32* %3
br label %32
22: ; preds = %15
br label %6
23: ; preds = %6
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i64 -1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = sub nsw i32 %26, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %23, %21
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = zext i8 %6 to i32
%15 = zext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ AddrSpac_Init();
scalar_t__ ROM_Init();
scalar_t__ RTC_Init();
int InitEmulation(void) {
  if (RTC_Init())
    if (ROM_Init())
      if (AddrSpac_Init()) {
        return 1;
      }
  return 0;
}


x86 assembly (clang, -O0):
<InitEmulation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <RTC_Init@plt>
cmp    $0x0,%rax
je     1181 <InitEmulation+0x51>
mov    $0x0,%al
call   1050 <ROM_Init@plt>
cmp    $0x0,%rax
je     117c <InitEmulation+0x4c>
mov    $0x0,%al
call   1040 <AddrSpac_Init@plt>
cmp    $0x0,%rax
je     1177 <InitEmulation+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1188 <InitEmulation+0x58>
jmp    117c <InitEmulation+0x4c>
jmp    1181 <InitEmulation+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitEmulation>:
push   %rax
xor    %eax,%eax
call   1030 <RTC_Init@plt>
test   %rax,%rax
je     115f <InitEmulation+0x2f>
xor    %eax,%eax
call   1050 <ROM_Init@plt>
test   %rax,%rax
je     115f <InitEmulation+0x2f>
xor    %eax,%eax
call   1040 <AddrSpac_Init@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     115f <InitEmulation+0x2f>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @InitEmulation() {
%1 = alloca i32
%2 = call i64 (...) @RTC_Init()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %0
%5 = call i64 (...) @ROM_Init()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i64 (...) @AddrSpac_Init()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %1
br label %14
11: ; preds = %7
br label %12
12: ; preds = %11, %4
br label %13
13: ; preds = %12, %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @InitEmulation() {
%1 = tail call i64 (...) @RTC_Init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i64 (...) @ROM_Init()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 (...) @AddrSpac_Init()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %6, %0
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
int check_val_CA_SPAWN_CMDint(int v) { return v; }


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

x86 assembly (clang, -O2):
<check_val_CA_SPAWN_CMDint>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @check_val_CA_SPAWN_CMDint(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fib(unsigned long long);
int /*<<< orphan*/ printf(char *, unsigned long long, int /*<<< orphan*/);
int main() {
  unsigned long long int a = 0;
  for (;;) {
    printf("F_%llu = %llu\n", a + 1, fib(a));
    a++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fib@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
lea    0xed3(%rip),%r14
nopl   (%rax)
lea    0x1(%rdi),%rbx
call   1040 <fib@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"F_%llu = %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %3, %0
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = load i64, i64* %2
%7 = call i32 @fib(i64 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %7)
%9 = load i64, i64* %2
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"F_%llu = %llu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %3, %1 ]
%3 = add i64 %2, 1
%4 = tail call i32 @fib(i64 %2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %3, i32 %4)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x3b() {
  Assert_real((isxdigit(59) == 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_isxdigit.c",
              300, ("isxdigit should be 0 for ;"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x3b>:
push   %rax
mov    $0x3b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x12c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ;\00"
define void @t_isxdigit_0x3b() {
%1 = call i64 @isxdigit(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for ;\00"
define void @t_isxdigit_0x3b() {
%1 = tail call i64 @isxdigit(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}