xunge/DecIR huggingface dataset:
int compare_samples(const void *s1, const void *s2) {
  float rms1 = *(float *)s1;
  float rms2 = *(float *)s2;
  if (rms1 > rms2)
    return -1;
  else if (rms1 < rms2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_samples>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    1141 <compare_samples+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <compare_samples+0x6c>
movss  -0x1c(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1160 <compare_samples+0x60>
movl   $0x1,-0x4(%rbp)
jmp    116c <compare_samples+0x6c>
jmp    1165 <compare_samples+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_samples>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
ucomiss %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_samples(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void swag2() { printf("SWAG2!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"SWAG2!\00"
define void @swag2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int fun316() { return 316; }


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

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

LLVM IR (-O0):
define i32 @fun316() {
ret i32 316
}

LLVM IR (-O2):
define i32 @fun316() {
ret i32 316
}
/* Variables and functions */
int /*<<< orphan*/ executeCommand(char **);
char **parseInput(char *);
int /*<<< orphan*/ printPrompt();
int /*<<< orphan*/ printf(char *);
char *readInput();
int main(int argc, char **argv) {
  char *line, **arguments;
  printf("WELCOME TO MY SHELL!\n");
  while (1) {
    printPrompt();
    line = readInput();
    arguments = parseInput(line);
    executeCommand(arguments);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <printPrompt@plt>
mov    $0x0,%al
call   1070 <readInput@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <parseInput@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <executeCommand@plt>
jmp    1172 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1060 <printPrompt@plt>
xor    %eax,%eax
call   1070 <readInput@plt>
mov    %rax,%rdi
call   1050 <parseInput@plt>
mov    %rax,%rdi
call   1030 <executeCommand@plt>
jmp    1160 <main+0x10>

LLVM IR (-O0):
@.str = [22 x i8] c"WELCOME TO MY SHELL!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %9
%10 = call i32 (...) @printPrompt()
%11 = call i8* (...) @readInput()
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = call i8** @parseInput(i8* %12)
store i8** %13, i8*** %7
%14 = load i8**, i8*** %7
%15 = call i32 @executeCommand(i8** %14)
br label %9
}

LLVM IR (-O2):
@str = [21 x i8] c"WELCOME TO MY SHELL!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @printPrompt()
%6 = tail call i8* (...) @readInput()
%7 = tail call i8** @parseInput(i8* %6)
%8 = tail call i32 @executeCommand(i8** %7)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("Usage:");
  puts("  install --help");
  puts("  install [-m mode] ifile ofile");
  puts("  install [-m mode] [-d dir] [file ...]");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [17 x i8] c" install --help\00"
@.str.2 = [32 x i8] c" install [-m mode] ifile ofile\00"
@.str.3 = [40 x i8] c" install [-m mode] [-d dir] [file ...]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Usage:\00"
@.str.1 = [17 x i8] c" install --help\00"
@.str.2 = [32 x i8] c" install [-m mode] ifile ofile\00"
@.str.3 = [40 x i8] c" install [-m mode] [-d dir] [file ...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}
float ctof(int c) { return c * (9.0 / 5.0) + 32.0; }


x86 assembly (clang, -O0):
<ctof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctof>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ctof(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 1.800000e+00, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @ctof(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int partition(char **, int const, int const);
void quicksort(char *array[], const int low, const int high) {
  int part;
  if (low < high) {
    part = partition(array, low, high);
    quicksort(array, low, part - 1);
    quicksort(array, part + 1, high);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i8** %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i8** %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int get_stcsbb2(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_stcsbb2(int a, int b, int mask) {
  int f, r;
  f = get_stcsbb2(a, b, &r);
  f &= mask;
  printf("stcsbb"
         " 2"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_stcsbb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_stcsbb2@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stcsbb2>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_stcsbb2@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"stcsbb 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcsbb2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_stcsbb2(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"stcsbb 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcsbb2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_stcsbb2(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
void selectionSort(int arr[], int size) {}


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

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

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

LLVM IR (-O2):
define void @selectionSort(i32* nocapture %0, i32 %1) {
ret void
}
void predrain_fence_empty(void) {}


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

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

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

LLVM IR (-O2):
define void @predrain_fence_empty() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeVars(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 2;
  int y = 5;
  printf("Before changeVars(): x:%d y:%d \n", x, y);
  changeVars(&x, y);
  printf("Before changeVars(): x:%d y:%d \n", x, y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x2,0xc(%rsp)
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
lea    0xc(%rsp),%rdi
mov    $0x5,%esi
call   1030 <changeVars@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
mov    $0x5,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Before changeVars(): x:%d y:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @changeVars(i32* %2, i32 %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Before changeVars(): x:%d y:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 2, i32 5)
%4 = call i32 @changeVars(i32* %1, i32 5)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ interface_exit();
void close_jtag_hardware() { interface_exit(); }


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

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

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

LLVM IR (-O2):
define void @close_jtag_hardware() {
%1 = tail call i32 (...) @interface_exit()
ret void
}
choose(a, aptr, b, bptr) int a, b;
char *aptr, *bptr;
{
  printf("\nSelect \'a\' or \'b\' :\n");
  printf(" a - %s.\n b - %s.\n", aptr, bptr);
  if (get_char() == 'a')
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <get_char@plt>
cmp    $0x61,%eax
jne    1175 <choose+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <choose+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeab(%rip),%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <get_char@plt>
cmp    $0x61,%eax
cmovne %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0ASelect 'a' or 'b' :\0A\00"
@.str.1 = [19 x i8] c" a - %s.\0A b - %s.\0A\00"
define i32 @choose(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
%12 = load i8*, i8** %9
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = call i32 (...) @get_char()
%15 = icmp eq i32 %14, 97
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = load i32, i32* %6
store i32 %17, i32* %5
br label %20
18: ; preds = %4
%19 = load i32, i32* %8
store i32 %19, i32* %5
br label %20
20: ; preds = %18, %16
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c" a - %s.\0A b - %s.\0A\00"
@str = [21 x i8] c"\0ASelect 'a' or 'b' :\00"
define i32 @choose(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %3)
%7 = tail call i32 (...) @get_char()
%8 = icmp eq i32 %7, 97
%9 = select i1 %8, i32 %0, i32 %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ USB1_NEEDCLK_DriverIRQHandler();
__attribute__((weak)) void USB1_NEEDCLK_IRQHandler(void) {
  USB1_NEEDCLK_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @USB1_NEEDCLK_IRQHandler() {
%1 = call i32 (...) @USB1_NEEDCLK_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB1_NEEDCLK_IRQHandler() {
%1 = tail call i32 (...) @USB1_NEEDCLK_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t ses_config_enclosure_descriptor_num_type_descriptors(uint8_t *data) {
  return data[2];
}


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

x86 assembly (clang, -O2):
<ses_config_enclosure_descriptor_num_type_descriptors>:
mov    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ses_config_enclosure_descriptor_num_type_descriptors(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct hdhomerun_device_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
hdhomerun_device_set_tuner_target(struct hdhomerun_device_t *, char *);
void hdhomerun_device_stream_stop(struct hdhomerun_device_t *hd) {
  hdhomerun_device_set_tuner_target(hd, "none");
}


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

x86 assembly (clang, -O2):
<hdhomerun_device_stream_stop>:
lea    0xee9(%rip),%rsi
jmp    1030 <hdhomerun_device_set_tuner_target@plt>

LLVM IR (-O0):
%struct.hdhomerun_device_t = type { i32 }
@.str = [5 x i8] c"none\00"
define void @hdhomerun_device_stream_stop(%struct.hdhomerun_device_t* %0) {
%2 = alloca %struct.hdhomerun_device_t*
store %struct.hdhomerun_device_t* %0, %struct.hdhomerun_device_t** %2
%3 = load %struct.hdhomerun_device_t*, %struct.hdhomerun_device_t** %2
%4 = call i32 @hdhomerun_device_set_tuner_target(%struct.hdhomerun_device_t* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.hdhomerun_device_t = type { i32 }
@.str = [5 x i8] c"none\00"
define void @hdhomerun_device_stream_stop(%struct.hdhomerun_device_t* %0) {
%2 = tail call i32 @hdhomerun_device_set_tuner_target(%struct.hdhomerun_device_t* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(double, double);
double pow_d(double a, double ad, double b, double *c) {
  double cd;
  c[0] = pow(a, b);
  cd = b * ad * pow(a, (b - 1.0));
  return cd;
}


x86 assembly (clang, -O0):
<pow_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <pow@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_d>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
movaps %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  0xeac(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @pow_d(double %0, double %1, double %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double* %3, double** %8
%10 = load double, double* %5
%11 = load double, double* %7
%12 = call double @pow(double %10, double %11)
%13 = load double*, double** %8
%14 = getelementptr inbounds double, double* %13, i64 0
store double %12, double* %14
%15 = load double, double* %7
%16 = load double, double* %6
%17 = fmul double %15, %16
%18 = load double, double* %5
%19 = load double, double* %7
%20 = fsub double %19, 1.000000e+00
%21 = call double @pow(double %18, double %20)
%22 = fmul double %17, %21
store double %22, double* %9
%23 = load double, double* %9
ret double %23
}

LLVM IR (-O2):
define double @pow_d(double %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = tail call double @pow(double %0, double %2)
store double %5, double* %3
%6 = fmul double %1, %2
%7 = fadd double %2, -1.000000e+00
%8 = tail call double @pow(double %0, double %7)
%9 = fmul double %6, %8
ret double %9
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_AY_AI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_ai(void) {
  m68ki_write_8(EA_AY_AI_8(), COND_GE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sge_8_ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_AI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_ai>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_AI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_ai() {
%1 = call i32 (...) @EA_AY_AI_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_ai() {
%1 = tail call i32 (...) @EA_AY_AI_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int realbay_help_usage(int argc, const char **argv) {
  puts(" USAGE: realbay <command> [...] \n"
       " \n"
       " COMMANDS \n"
       "    help           Read help text on a specific command \n"
       "    createindex    Create a new index from a CSV file \n"
       "    verify         Verify which pieces of an index are valid \n"
       "    findpieces     Search for pieces by keyword \n"
       "    findrecords    Find all records in valid pieces by keyword \n"
       "    hashes         Outputs all the hashes in an index \n"
       " \n"
       " For specific information on a command use: \n"
       " \n"
       "    realbay help verify  # Gives you help the verify command \n"
       " \n"
       " Please file bugs at https://github.com/realbay/realbay \n");
  return 0;
}


x86 assembly (clang, -O0):
<realbay_help_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [559 x i8] c" USAGE: realbay <command> [...] \0A \0A COMMANDS \0A help Read help text on a specific command \0A createindex Create a new index from a CSV file \0A verify Verify which pieces of an index are valid \0A findpieces Search for pieces by keyword \0A findrecords Find all records in valid pieces by keyword \0A hashes Outputs all the hashes in an index \0A \0A For specific information on a command use: \0A \0A realbay help verify # Gives you help the verify command \0A \0A Please file bugs at https://github.com/realbay/realbay \0A\00"
define i32 @realbay_help_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([559 x i8], [559 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [559 x i8] c" USAGE: realbay <command> [...] \0A \0A COMMANDS \0A help Read help text on a specific command \0A createindex Create a new index from a CSV file \0A verify Verify which pieces of an index are valid \0A findpieces Search for pieces by keyword \0A findrecords Find all records in valid pieces by keyword \0A hashes Outputs all the hashes in an index \0A \0A For specific information on a command use: \0A \0A realbay help verify # Gives you help the verify command \0A \0A Please file bugs at https://github.com/realbay/realbay \0A\00"
define i32 @realbay_help_usage(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([559 x i8], [559 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int key_t;

/* Variables and functions */
int ftok(char const *, char);
int /*<<< orphan*/ perror(char *);
key_t get_key(const char *path) {
  key_t key;
  key = ftok(path, 'R');
  if (key == -1)
    perror("ftok");
  return key;
}


x86 assembly (clang, -O0):
<get_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x52,%esi
call   1040 <ftok@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1153 <get_key+0x33>
lea    0xeb2(%rip),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key>:
push   %rbx
mov    $0x52,%esi
call   1040 <ftok@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1136 <get_key+0x16>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec3(%rip),%rdi
call   1030 <perror@plt>
jmp    1132 <get_key+0x12>

LLVM IR (-O0):
@.str = [5 x i8] c"ftok\00"
define i32 @get_key(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ftok(i8* %4, i8 signext 82)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"ftok\00"
define i32 @get_key(i8* %0) {
%2 = tail call i32 @ftok(i8* %0, i8 signext 82)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ border_pixmap;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
unsigned long get_XSetWindowAttributes_border_pixmap(void *_p) {
  return (unsigned long)((XSetWindowAttributes *)_p)->border_pixmap;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSetWindowAttributes_border_pixmap(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
char c_tolower(int c) { return c > 64 && c < 91 ? c + 32 : c; }


x86 assembly (clang, -O0):
<c_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jle    1129 <c_tolower+0x29>
cmpl   $0x5b,-0x4(%rbp)
jge    1129 <c_tolower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <c_tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_tolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%eax
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @c_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 64
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 91
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @c_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
%6 = trunc i32 %5 to i8
ret i8 %6
}
void av_demuxer_iterate() {}


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

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

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

LLVM IR (-O2):
define void @av_demuxer_iterate() {
ret void
}
__attribute__((no, noclone)) float ceilf(float x) { return x; }


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

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

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

LLVM IR (-O2):
define float @ceilf(float returned %0) {
ret float %0
}
void ___sl_break(const char *msg) { (void)msg; }


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

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

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

LLVM IR (-O2):
define void @___sl_break(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void sprint_xrl_data_to_direct(char *str, uint8_t direct, uint8_t data) {
  sprintf(str,
          "XRL   "
          "0x%02X"
          ", #"
          "0x%02X"
          "               ",
          direct, data);
}


x86 assembly (clang, -O0):
<sprint_xrl_data_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_xrl_data_to_direct>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"XRL 0x%02X,x%02X \00"
define void @sprint_xrl_data_to_direct(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"XRL 0x%02X,x%02X \00"
define void @sprint_xrl_data_to_direct(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x65() {
  Assert_real((isspace(101) == 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_isspace.c",
              510, ("isspace should be 0 for e"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for e\00"
define void @t_isspace_0x65() {
%1 = tail call i64 @isspace(i32 101)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char numberFromNumber(int n) { return (char)(n + '0'); }


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

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

LLVM IR (-O0):
define signext i8 @numberFromNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @numberFromNumber(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ append_data_to_file(int, void *, size_t);
int /*<<< orphan*/ resize_file(int, int);
void write_data_to_file(int inum, void *data, size_t size, int offset) {
  resize_file(inum, offset);
  append_data_to_file(inum, data, size);
}


x86 assembly (clang, -O0):
<write_data_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1030 <resize_file@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <append_data_to_file@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data_to_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ecx,%esi
call   1030 <resize_file@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <append_data_to_file@plt>

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

LLVM IR (-O2):
define void @write_data_to_file(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @resize_file(i32 %0, i32 %3)
%6 = tail call i32 @append_data_to_file(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ stat(char *, struct stat *);
int main(void) {
  struct stat buf;
  return (0 > stat("/dev/sydbox/off", &buf)) ? EXIT_FAILURE : EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    114e <main+0x3e>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    115a <main+0x4a>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jns    112e <main+0x1e>
mov    0x2eb4(%rip),%rax
jmp    1135 <main+0x25>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [16 x i8] c"/dev/sydbox/off\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
store i32 0, i32* %1
%3 = call i64 @stat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp sgt i64 0, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
br label %9
7: ; preds = %0
%8 = load i32, i32* @EXIT_SUCCESS
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [16 x i8] c"/dev/sydbox/off\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ emitXFileEpilogue();
int /*<<< orphan*/ emitYFileEpilogue();
int /*<<< orphan*/ emitZFileEpilogue();
void emitEpilogue(void) {
  emitXFileEpilogue();
  emitYFileEpilogue();
  emitZFileEpilogue();
}


x86 assembly (clang, -O0):
<emitEpilogue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <emitXFileEpilogue@plt>
mov    $0x0,%al
call   1050 <emitYFileEpilogue@plt>
mov    $0x0,%al
call   1040 <emitZFileEpilogue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitEpilogue>:
push   %rax
xor    %eax,%eax
call   1030 <emitXFileEpilogue@plt>
xor    %eax,%eax
call   1050 <emitYFileEpilogue@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <emitZFileEpilogue@plt>

LLVM IR (-O0):
define void @emitEpilogue() {
%1 = call i32 (...) @emitXFileEpilogue()
%2 = call i32 (...) @emitYFileEpilogue()
%3 = call i32 (...) @emitZFileEpilogue()
ret void
}

LLVM IR (-O2):
define void @emitEpilogue() {
%1 = tail call i32 (...) @emitXFileEpilogue()
%2 = tail call i32 (...) @emitYFileEpilogue()
%3 = tail call i32 (...) @emitZFileEpilogue()
ret void
}
char *strcpy(char *dest, const char *src) {
  char *p = dest;
  while (*p++ = *src++)
    ;
  return (dest);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void TMTimerGet(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerGet() {
ret void
}
int trelease() {}


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

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

LLVM IR (-O0):
define i32 @trelease() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @trelease() {
ret i32 undef
}
void ceph_readpage_to_fscache(struct inode *inode, struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
%struct.page = type opaque
define void @ceph_readpage_to_fscache(%struct.inode* nocapture %0, %struct.page* nocapture %1) {
ret void
}