xunge/DecIR huggingface dataset:
int isasc(const int *a, int n) {
  register int i;
  for (i = 0; i < n - 1; i++) {
    if (*a > *(a + i))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isasc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1159 <isasc+0x59>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1146 <isasc+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1160 <isasc+0x60>
jmp    114b <isasc+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isasc+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isasc>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1134 <isasc+0x34>
add    $0xffffffff,%esi
mov    (%rdi),%r8d
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rdx,%rsi
je     1134 <isasc+0x34>
lea    0x1(%rdx),%rcx
cmp    (%rdi,%rdx,4),%r8d
mov    %rcx,%rdx
jle    1120 <isasc+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isasc(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = load i32, i32* %0
%7 = zext i32 %5 to i64
br label %8
8: ; preds = %4, %11
%9 = phi i64 [ 1, %4 ], [ %15, %11 ]
%10 = icmp eq i64 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = getelementptr inbounds i32, i32* %0, i64 %9
%13 = load i32, i32* %12
%14 = icmp sgt i32 %6, %13
%15 = add nuw nsw i64 %9, 1
br i1 %14, label %16, label %8
16: ; preds = %11, %8, %2
%17 = phi i32 [ 1, %2 ], [ 1, %8 ], [ 0, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ testshuf();
int main(int argc, char *argv[]) { testshuf(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testshuf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testshuf()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testshuf()
ret i32 0
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ verify(int *);
int main(int argc) {
  int array[100];
#pragma omp target
  {
    for (int i = 0; i < 100; i++) {
      int v = foo(i);
      array[i] = v;
    }
  }
  verify(array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    1185 <main+0x65>
mov    -0x1a4(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    113f <main+0x1f>
lea    -0x1a0(%rbp),%rdi
call   1040 <verify@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <foo@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1130 <main+0x10>
mov    %rsp,%rdi
call   1040 <verify@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 0, i32* %5
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %5
%12 = call i32 @foo(i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %7
20: ; preds = %7
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%22 = call i32 @verify(i32* %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = alloca [100 x i32]
%3 = bitcast [100 x i32]* %2 to i8*
br label %7
4: ; preds = %7
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%6 = call i32 @verify(i32* %5)
ret i32 0
7: ; preds = %1, %7
%8 = phi i64 [ 0, %1 ], [ %12, %7 ]
%9 = trunc i64 %8 to i32
%10 = tail call i32 @foo(i32 %9)
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, 100
br i1 %13, label %4, label %7
}
void flush_dcache_range(unsigned long start, unsigned long stop) {}


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

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

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

LLVM IR (-O2):
define void @flush_dcache_range(i64 %0, i64 %1) {
ret void
}
void cli_val_sparc_attr_deinit(struct cli_val_sparc_attr *a) {}


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

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

LLVM IR (-O0):
%struct.cli_val_sparc_attr = type opaque
define void @cli_val_sparc_attr_deinit(%struct.cli_val_sparc_attr* %0) {
%2 = alloca %struct.cli_val_sparc_attr*
store %struct.cli_val_sparc_attr* %0, %struct.cli_val_sparc_attr** %2
ret void
}

LLVM IR (-O2):
%struct.cli_val_sparc_attr = type opaque
define void @cli_val_sparc_attr_deinit(%struct.cli_val_sparc_attr* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test29(__m64 a, __m64 b) { return _mm_max_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test29>:
jmp    1030 <_mm_max_pi16@plt>

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

LLVM IR (-O2):
define i32 @test29(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pi16(i32 %0, i32 %1)
ret i32 %3
}
int int_index(int n, int *a, int size) {
  int i;
  for (i = 0; i < size; i++)
    if (n == a[i])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<int_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <int_index+0x53>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1140 <int_index+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <int_index+0x5a>
jmp    1145 <int_index+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <int_index+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_index>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <int_index+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edi,(%rsi,%rcx,4)
je     111f <int_index+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <int_index+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_index(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* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32*, i32** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %14, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @int_index(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ ds(int);
int main() {
  ds(40);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
call   1030 <ds@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ds(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ds(i32 40)
ret i32 0
}
int baz(int x) { return x++ + x++; }


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

x86 assembly (clang, -O2):
<baz>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fun(int a) {
  a = a + 5;
  printf("int: %20d\n", a);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0x5(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"int: %20d\0A\00"
define i32 @fun(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 5
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"int: %20d\0A\00"
define i32 @fun(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void othello_print_help(void) {
  printf("Usage: othello-server [-p | --port <port>] [-d | --daemon]\n");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: othello-server [-p | --port <port>] [-d | --daemon]\0A\00"
define void @othello_print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [59 x i8] c"Usage: othello-server [-p | --port <port>] [-d | --daemon]\00"
define void @othello_print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ populate_array(int *, int *, int);
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ selection_sort(int *, int);
int main() {
  int *A = malloc(100 * sizeof(int));
  int num_elements = 0;
  int array_size = 100;
  populate_array(A, &num_elements, array_size);
  selection_sort(A, num_elements);
  print_array(A, num_elements);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x64,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    -0xc(%rbp),%rsi
call   1060 <populate_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <selection_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x190,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
mov    $0x64,%edx
call   1060 <populate_array@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <selection_sort@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = call i32* @malloc(i32 400)
store i32* %4, i32** %1
store i32 0, i32* %2
store i32 100, i32* %3
%5 = load i32*, i32** %1
%6 = load i32, i32* %3
%7 = call i32 @populate_array(i32* %5, i32* %2, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32, i32* %2
%10 = call i32 @selection_sort(i32* %8, i32 %9)
%11 = load i32*, i32** %1
%12 = load i32, i32* %2
%13 = call i32 @print_array(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = tail call i32* @malloc(i32 400)
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = call i32 @populate_array(i32* %2, i32* %1, i32 100)
%5 = load i32, i32* %1
%6 = call i32 @selection_sort(i32* %2, i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @print_array(i32* %2, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ timer_t;
struct itimerspec {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int timerfd_settime(int /*<<< orphan*/, int /*<<< orphan*/, struct itimerspec *,
                    struct itimerspec *);
int main(void) {
  timer_t timerid = 0;
  struct itimerspec new = {0};
  struct itimerspec old = {0};
  return timerfd_settime(0, 0, &new, &old);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    %esi,%edi
call   1040 <timerfd_settime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <timerfd_settime@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.itimerspec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.itimerspec
%4 = alloca %struct.itimerspec
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast %struct.itimerspec* %3 to i8*
%6 = bitcast %struct.itimerspec* %4 to i8*
%7 = call i32 @timerfd_settime(i32 0, i32 0, %struct.itimerspec* %3, %struct.itimerspec* %4)
ret i32 %7
}

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
define i32 @main() {
%1 = alloca %struct.itimerspec
%2 = alloca %struct.itimerspec
%3 = bitcast %struct.itimerspec* %1 to i8*
%4 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %1, i64 0, i32 0
store i32 0, i32* %4
%5 = bitcast %struct.itimerspec* %2 to i8*
%6 = getelementptr inbounds %struct.itimerspec, %struct.itimerspec* %2, i64 0, i32 0
store i32 0, i32* %6
%7 = call i32 @timerfd_settime(i32 0, i32 0, %struct.itimerspec* %1, %struct.itimerspec* %2)
ret i32 %7
}
/* Type definitions */
struct Trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroyTrie(struct Trie *);
int /*<<< orphan*/ free(struct Trie *);
void deleteTrie(struct Trie *trie) {
  destroyTrie(trie);
  free(trie);
}


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

x86 assembly (clang, -O2):
<deleteTrie>:
push   %rbx
mov    %rdi,%rbx
call   1040 <destroyTrie@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Trie = type { i32 }
define void @deleteTrie(%struct.Trie* %0) {
%2 = alloca %struct.Trie*
store %struct.Trie* %0, %struct.Trie** %2
%3 = load %struct.Trie*, %struct.Trie** %2
%4 = call i32 @destroyTrie(%struct.Trie* %3)
%5 = load %struct.Trie*, %struct.Trie** %2
%6 = call i32 @free(%struct.Trie* %5)
ret void
}

LLVM IR (-O2):
%struct.Trie = type { i32 }
define void @deleteTrie(%struct.Trie* %0) {
%2 = tail call i32 @destroyTrie(%struct.Trie* %0)
%3 = tail call i32 @free(%struct.Trie* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ system_log(char *, char *, int, char *);
void sig_segv(int signo) {
  system_log("<F>",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/hfs/afd/refs/heads/master/src/init_afd/"
             "init_afd.c",
             2593, ("Aaarrrggh! Received SIGSEGV."));
  abort();
}


x86 assembly (clang, -O0):
<sig_segv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0xa21,%edx
lea    0xf4b(%rip),%rcx
call   1040 <system_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sig_segv>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf5a(%rip),%rcx
mov    $0xa21,%edx
call   1040 <system_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hfs/afd/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [29 x i8] c"Aaarrrggh! Received SIGSEGV.\00"
define void @sig_segv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 2593, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hfs/afd/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [29 x i8] c"Aaarrrggh! Received SIGSEGV.\00"
define void @sig_segv(i32 %0) {
%2 = tail call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 2593, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void XkbAllocGeomProps() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomProps() {
ret void
}
int extract(void *index, unsigned long from, unsigned long to,
            unsigned char **snippet, unsigned long *snippet_length) {
  return -1;
}


x86 assembly (clang, -O0):
<extract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @extract(i8* nocapture readnone %0, i64 %1, i64 %2, i8** nocapture readnone %3, i64* nocapture readnone %4) {
ret i32 -1
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int fstat(int, struct stat *);
int /*<<< orphan*/ perror(char *);
int filelength(int handle) {
  struct stat buf;
  if (fstat(handle, &buf) == -1) {
    perror("filelength");
    return -1;
  }
  return buf.st_size;
}


x86 assembly (clang, -O0):
<filelength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1158 <filelength+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <filelength+0x3e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filelength>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1133 <filelength+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [11 x i8] c"filelength\00"
define i32 @filelength(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ -1, %6 ], [ %10, %8 ]
ret i32 %12
}
float crop(float x, float lo, float hi) {
  if (x < lo)
    return lo;
  if (x > hi)
    return hi;
  return x;
}


x86 assembly (clang, -O0):
<crop>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <crop+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <crop+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <crop+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <crop+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<crop>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @crop(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
char *mount_config_opts(char *spec, char *mount_point, char *mount_opts) {
  return mount_opts;
}


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

x86 assembly (clang, -O2):
<mount_config_opts>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @mount_config_opts(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @mount_config_opts(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* readnone returned %2) {
ret i8* %2
}
fle(x, y) long long int x;
long long int y;
{
  if (x <= y)
    return 13;
  else
    return 140;
}


x86 assembly (clang, -O0):
<fle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1126 <fle+0x26>
movl   $0xd,-0x4(%rbp)
jmp    112d <fle+0x2d>
movl   $0x8c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fle>:
cmp    %rsi,%rdi
mov    $0x8c,%ecx
mov    $0xd,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fle(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sle i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 13, i32* %3
br label %11
10: ; preds = %2
store i32 140, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @fle(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i32 140, i32 13
ret i32 %4
}
int Operand_bt8_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0x1 << 3)) != 0;
  *valp = *valp >> 3;
  return error;
}


x86 assembly (clang, -O0):
<Operand_bt8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff7,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bt8_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   $0xfffffff7,%ecx
setne  %al
shr    $0x3,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_bt8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -9
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_bt8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, -9
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = lshr i32 %2, 3
store i32 %6, i32* %0
ret i32 %5
}
void glStencilOp(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glStencilOp() {
ret void
}
/* Variables and functions */
unsigned int COLOR_PAIR(int);
unsigned int wrap_COLOR_PAIR(int n) { return COLOR_PAIR(n); }


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

x86 assembly (clang, -O2):
<wrap_COLOR_PAIR>:
jmp    1030 <COLOR_PAIR@plt>

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

LLVM IR (-O2):
define i32 @wrap_COLOR_PAIR(i32 %0) {
%2 = tail call i32 @COLOR_PAIR(i32 %0)
ret i32 %2
}
int main() {
  signed long a = 4L;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
double log(double);
double ftom(double freq) {
  return log(freq) * (17.312340490667548) - (36.37631656229583);
}


x86 assembly (clang, -O0):
<ftom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftom>:
push   %rax
call   1030 <log@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ftom(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = call double @llvm.fmuladd.f64(double %4, double 0x40314FF58BE0A23B, double 0xC042302B2420007A)
ret double %5
}

LLVM IR (-O2):
define double @ftom(double %0) {
%2 = tail call double @log(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x40314FF58BE0A23B, double 0xC042302B2420007A)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void set_up_bank() {
  FILE *flag_file = fopen(
      "/home/tripathy/Documents/CTF_Problems/Binaries/Bank/flag.txt", "r");
  char flag[37];
  fgets(flag, 37, flag_file);
  printf("%s\n", flag);
}


x86 assembly (clang, -O0):
<set_up_bank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    0xef7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x25,%esi
call   1040 <fgets@plt>
lea    -0x30(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_up_bank>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
lea    0xefa(%rip),%rsi
call   1050 <fopen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x25,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
lea    0xedd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [61 x i8] c"/home/tripathy/Documents/CTF_Problems/Binaries/Bank/flag.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @set_up_bank() {
%1 = alloca i32*
%2 = alloca [37 x i8]
%3 = call i32* @fopen(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 0
%5 = load i32*, i32** %1
%6 = call i32 @fgets(i8* %4, i32 37, i32* %5)
%7 = getelementptr inbounds [37 x i8], [37 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"/home/tripathy/Documents/CTF_Problems/Binaries/Bank/flag.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @set_up_bank() {
%1 = alloca [37 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [37 x i8], [37 x i8]* %1, i64 0, i64 0
%4 = call i32 @fgets(i8* %3, i32 37, i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
long long sin(long long);
long long internal_sin_l(long long value) { return sin(value); }


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

x86 assembly (clang, -O2):
<internal_sin_l>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define i64 @internal_sin_l(i64 %0) {
%2 = tail call i64 @sin(i64 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int16_t read_int16(FILE *fp) {
  int16_t v;
  fread(&v, 2, 1, fp);
  return v;
}


x86 assembly (clang, -O0):
<read_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int16>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read_int16(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 2, i32 1, i32* %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int unlink(char *);
int unlink_old() {
  int flag =
      unlink("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK");
  if (flag != 0) {
    perror("/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK");
  }
  return flag;
}


x86 assembly (clang, -O0):
<unlink_old>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <unlink_old+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_old>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1137 <unlink_old+0x17>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec2(%rip),%rdi
call   1040 <perror@plt>
jmp    1133 <unlink_old+0x13>

LLVM IR (-O0):
@.str = [64 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK\00"
define i32 @unlink_old() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [64 x i8] c"/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK\00"
define i32 @unlink_old() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ c2_pulse();
int /*<<< orphan*/ gpio_set(int, int, int);
void c2_send(uint32_t value, int bits) {
  int i;
  for (i = 0; i != bits; i++) {
    gpio_set(4, 13, (value >> i) & 1);
    c2_pulse();
  }
}


x86 assembly (clang, -O0):
<c2_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1170 <c2_send+0x50>
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
sar    %cl,%edx
and    $0x1,%edx
mov    $0x4,%edi
mov    $0xd,%esi
call   1040 <gpio_set@plt>
mov    $0x0,%al
call   1030 <c2_pulse@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <c2_send+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2_send>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1157 <c2_send+0x37>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ebp,%ebp
nop
mov    %r14d,%edx
mov    %ebp,%ecx
shr    %cl,%edx
and    $0x1,%edx
mov    $0x4,%edi
mov    $0xd,%esi
call   1040 <gpio_set@plt>
xor    %eax,%eax
call   1030 <c2_pulse@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <c2_send+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @c2_send(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = lshr i32 %0, %5
%7 = and i32 %6, 1
%8 = tail call i32 @gpio_set(i32 4, i32 13, i32 %7)
%9 = tail call i32 (...) @c2_pulse()
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
void xhci_controller_init(void) {}


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

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

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

LLVM IR (-O2):
define void @xhci_controller_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
char *strstr(char *, char *);
void strstr_end() {
  char *string = "TestString";
  Assert_real((strstr(string, "ing") == string + 7),
              "/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/string/strstr.c",
              29, ("String should be found at end"));
}


x86 assembly (clang, -O0):
<strstr_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
mov    -0x8(%rbp),%rcx
add    $0x7,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeae(%rip),%rsi
mov    $0x1d,%edx
lea    0xf45(%rip),%rcx
call   1030 <Assert_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr_end>:
lea    0xee9(%rip),%rsi
lea    0xf85(%rip),%rcx
mov    $0x1,%edi
mov    $0x1d,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"TestString\00"
@.str.1 = [4 x i8] c"ing\00"
@.str.2 = [163 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/string/strstr.c\00"
@.str.3 = [30 x i8] c"String should be found at end\00"
define void @strstr_end() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i8* @strstr(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = icmp eq i8* %3, %5
%7 = zext i1 %6 to i32
%8 = call i32 @Assert_real(i32 %7, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [163 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/string/strstr.c\00"
@.str.3 = [30 x i8] c"String should be found at end\00"
define void @strstr_end() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str.2, i64 0, i64 0), i32 29, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void uninitvar_fgets(void) {
  char *buffer;
  int n;
  FILE *stream;
  (void)fgets(buffer, n, stream);
}


x86 assembly (clang, -O0):
<uninitvar_fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fgets>:
jmp    1030 <fgets@plt>

LLVM IR (-O0):
define void @uninitvar_fgets() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32*
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
%7 = call i32 @fgets(i8* %4, i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fgets() {
%1 = tail call i32 @fgets(i8* undef, i32 undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void getText(char a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    scanf("%c", &a[i]);
  return;
}


x86 assembly (clang, -O0):
<getText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <getText+0x47>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <getText+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getText>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <getText+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <getText+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @getText(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @getText(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glutSolidTeapot(double);
void drawTeapot(void) {
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
  glutSolidTeapot(2.0);
}


x86 assembly (clang, -O0):
<drawTeapot>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
movsd  0xeb8(%rip),%xmm0
call   1030 <glutSolidTeapot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawTeapot>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <glEnable@plt>
movsd  0xebb(%rip),%xmm0
pop    %rax
jmp    1030 <glutSolidTeapot@plt>

LLVM IR (-O0):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @drawTeapot() {
%1 = load i32, i32* @GL_LIGHTING
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = call i32 @glEnable(i32 %3)
%5 = call i32 @glutSolidTeapot(double 2.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @drawTeapot() {
%1 = load i32, i32* @GL_LIGHTING
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHT0
%4 = tail call i32 @glEnable(i32 %3)
%5 = tail call i32 @glutSolidTeapot(double 2.000000e+00)
ret void
}