xunge/DecIR huggingface dataset:
int main() {
  int i;
  int res = 0;
  goto L1;
  for (i = 0; i < 10; i++) {
  L2:
    res++;
    if (i > 100) {
    L1:
      i = 0;
      goto L2;
      break;
    }
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    113e <main+0x3e>
cmpl   $0xa,-0x8(%rbp)
jge    115d <main+0x5d>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    114a <main+0x4a>
jmp    113e <main+0x3e>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x26>
jmp    114f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int getnextline(char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strlen(char *);
int main() {
  char ret[32000];
  while (getnextline(ret) != -1) {
    if (strlen(ret) > 0)
      printf("%s\n", ret);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7d10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7d10(%rbp),%rdi
call   1050 <getnextline@plt>
cmp    $0xffffffff,%eax
je     1185 <main+0x55>
lea    -0x7d10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1180 <main+0x50>
lea    -0x7d10(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7d10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d08,%rsp
mov    %rsp,%rdi
call   1050 <getnextline@plt>
cmp    $0xffffffff,%eax
je     1187 <main+0x57>
mov    %rsp,%rbx
lea    0xeaf(%rip),%r14
jmp    116d <main+0x3d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1050 <getnextline@plt>
cmp    $0xffffffff,%eax
je     1187 <main+0x57>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1160 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x7d08,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [32000 x i8]
%2 = getelementptr inbounds [32000 x i8], [32000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getnextline(i8* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %13, label %5
5: ; preds = %0, %10
%6 = call i64 @strlen(i8* %2)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getnextline(i8* %2)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %5
13: ; preds = %10, %0
ret i32 0
}
/* Type definitions */
struct set {
  int dummy;
};

/* Variables and functions */
int set_remove(struct set *, void *, scalar_t__);
scalar_t__ strlen(char *);
int set_remove_string(struct set *t, char *s) {
  return set_remove(t, (void *)s, strlen(s) + 1);
}


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

x86 assembly (clang, -O2):
<set_remove_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <set_remove@plt>

LLVM IR (-O0):
%struct.set = type { i32 }
define i32 @set_remove_string(%struct.set* %0, i8* %1) {
%3 = alloca %struct.set*
%4 = alloca i8*
store %struct.set* %0, %struct.set** %3
store i8* %1, i8** %4
%5 = load %struct.set*, %struct.set** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @set_remove(%struct.set* %5, i8* %6, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.set = type { i32 }
define i32 @set_remove_string(%struct.set* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @set_remove(%struct.set* %0, i8* %1, i64 %4)
ret i32 %5
}
max(a, b) int a, b;
{ return (a > b ? a : b); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sendbyte(int);
void sendack() { sendbyte(0xc0); }


x86 assembly (clang, -O0):
<sendack>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc0,%edi
call   1030 <sendbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendack>:
mov    $0xc0,%edi
jmp    1030 <sendbyte@plt>

LLVM IR (-O0):
define void @sendack() {
%1 = call i32 @sendbyte(i32 192)
ret void
}

LLVM IR (-O2):
define void @sendack() {
%1 = tail call i32 @sendbyte(i32 192)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conversion_test(char);
void test_conversions(void) {
  conversion_test('E');
  conversion_test('e');
}


x86 assembly (clang, -O0):
<test_conversions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
call   1030 <conversion_test@plt>
mov    $0x65,%edi
call   1030 <conversion_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_conversions>:
push   %rax
mov    $0x45,%edi
call   1030 <conversion_test@plt>
mov    $0x65,%edi
pop    %rax
jmp    1030 <conversion_test@plt>

LLVM IR (-O0):
define void @test_conversions() {
%1 = call i32 @conversion_test(i8 signext 69)
%2 = call i32 @conversion_test(i8 signext 101)
ret void
}

LLVM IR (-O2):
define void @test_conversions() {
%1 = tail call i32 @conversion_test(i8 signext 69)
%2 = tail call i32 @conversion_test(i8 signext 101)
ret void
}
/* Variables and functions */
long hash(char *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  scanf("%s", word);
  long hash_counter;
  hash_counter = hash(&word[0]);
  printf("%ld", hash_counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %4)
ret i32 0
}
void gtk_editable_insert_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_editable_insert_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb7() {
  Assert_real((isodigit(183) == 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_isodigit.c",
              920, ("isodigit should be 0 for 0xb7"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb7\00"
define void @t_isodigit_0xb7() {
%1 = tail call i64 @isodigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void CRYPTO_free_locked(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_free_locked() {
ret void
}
void testdivd_(double *z, double *x, double *y) { *z = *x / *y; }


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

x86 assembly (clang, -O2):
<testdivd_>:
movsd  (%rsi),%xmm0
divsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @testdivd_(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = load double*, double** %6
%10 = load double, double* %9
%11 = fdiv double %8, %10
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @testdivd_(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fdiv double %4, %5
store double %6, double* %0
ret void
}
void RTTestIValueV(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestIValueV() {
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_ino;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void file__print_inode(struct stat *st) { printf("%6d ", (int)st->st_ino); }


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

x86 assembly (clang, -O2):
<file__print_inode>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [5 x i8] c"%6d \00"
define void @file__print_inode(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [5 x i8] c"%6d \00"
define void @file__print_inode(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void debug(long *a, int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    printf("%ld ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <debug+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <debug+0x1d>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <debug+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <debug+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%ld \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @debug(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i64*, i64** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* %11, i64 %13
%15 = load i64, i64* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %15)
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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%ld \00"
define void @debug(i64* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t max) {
  size_t len = 0;
  while (len < max && *s) {
    len++;
    s++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1137 <strnlen+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <strnlen+0x47>
jmp    1164 <strnlen+0x64>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <strnlen+0x10>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br i1 %16, label %17, label %22
17: ; preds = %15
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %6
22: ; preds = %15
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = phi i8* [ %11, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = icmp eq i64 %10, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %2
%14 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %14
}
/* Variables and functions */
scalar_t__ unlink(char const *);
int main(int argc, const char *argv[]) {
  if (argc < 2)
    return (64);
  return (unlink(argv[1]) == 0 ? 0 : 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x40,-0x4(%rbp)
jmp    115d <main+0x4d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <unlink@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x40,%eax
cmp    $0x2,%edi
jl     1133 <main+0x23>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 64, i32* %3
br label %17
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @unlink(i8* %12)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @unlink(i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 64, %2 ]
ret i32 %11
}
extern unsigned short ip_compute_csum(unsigned char *buff, int len) {
  return 0;
}


x86 assembly (clang, -O0):
<ip_compute_csum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @ip_compute_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @ip_compute_csum(i8* nocapture readnone %0, i32 %1) {
ret i16 0
}
int crypt_init(void) { return (0); }


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

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

LLVM IR (-O0):
define i32 @crypt_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @crypt_init() {
ret i32 0
}
int test_imm_67int64_midword_reg(long long val) {
  return ((val >> 16) & (0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x67,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67int64_midword_reg>:
test   $0x670000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 103
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_67int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6750208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_48() {
  Assert_real((isqrt(48) == 6),
              "/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/stdlib/isqrt.c",
              245, ("Integer square root of 48 should be 6"));
}


x86 assembly (clang, -O0):
<t_sqrt_48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <isqrt@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0xf5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_48>:
push   %rax
mov    $0x30,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xf5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 48 should be 6\00"
define void @t_sqrt_48() {
%1 = call i32 @isqrt(i32 48)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 48 should be 6\00"
define void @t_sqrt_48() {
%1 = tail call i32 @isqrt(i32 48)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char **realloc(char **, int);
char **strlist_insert(char **strlist, char *str, const size_t len) {
  strlist = realloc(strlist, sizeof(char **) * len);
  strlist[len - 1] = str;
  return strlist;
}


x86 assembly (clang, -O0):
<strlist_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlist_insert>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
lea    0x0(,%rdx,8),%esi
call   1030 <realloc@plt>
mov    %r14,-0x8(%rax,%rbx,8)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8** @strlist_insert(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i64, i64* %6
%9 = mul i64 8, %8
%10 = trunc i64 %9 to i32
%11 = call i8** @realloc(i8** %7, i32 %10)
store i8** %11, i8*** %4
%12 = load i8*, i8** %5
%13 = load i8**, i8*** %4
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
store i8* %12, i8** %16
%17 = load i8**, i8*** %4
ret i8** %17
}

LLVM IR (-O2):
define i8** @strlist_insert(i8** %0, i8* %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = shl i32 %4, 3
%6 = tail call i8** @realloc(i8** %0, i32 %5)
%7 = add i64 %2, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 %7
store i8* %1, i8** %8
ret i8** %6
}
int srem(int X, int Y) { return X % Y; }


x86 assembly (clang, -O0):
<srem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<srem>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @srem(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isalpha(int /*<<< orphan*/);
int iswalpha(wint_t c) { return isalpha(c); }


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

x86 assembly (clang, -O2):
<iswalpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @iswalpha(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ find_song(char *, char *);
int /*<<< orphan*/ free_node(int /*<<< orphan*/);
void delete_song(char *song_name, char *song_artist) {
  free_node(find_song(song_name, song_artist));
}


x86 assembly (clang, -O0):
<delete_song>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <find_song@plt>
mov    %eax,%edi
call   1040 <free_node@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_song>:
push   %rax
call   1030 <find_song@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <free_node@plt>

LLVM IR (-O0):
define void @delete_song(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @find_song(i8* %5, i8* %6)
%8 = call i32 @free_node(i32 %7)
ret void
}

LLVM IR (-O2):
define void @delete_song(i8* %0, i8* %1) {
%3 = tail call i32 @find_song(i8* %0, i8* %1)
%4 = tail call i32 @free_node(i32 %3)
ret void
}
int rdp_min(const int a, const int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<rdp_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <rdp_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <rdp_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @rdp_min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @rdp_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void pcp_print_net_udp_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_udp_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_flipper_free_world();
void CClinkern_flipper_free_world() { test_flipper_free_world(); }


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

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

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

LLVM IR (-O2):
define void @CClinkern_flipper_free_world() {
%1 = tail call i32 (...) @test_flipper_free_world()
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t enbyte(uint16_t x) { return x & 0x00ff; }


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

x86 assembly (clang, -O2):
<enbyte>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @enbyte(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: sigratetest nsec_delay\n");
  exit(EX_USAGE);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: sigratetest nsec_delay\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: sigratetest nsec_delay\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void bring_back_filename(char *b) {
  uint32_t i = 0;
  while (b[i])
    ++i;
  b[i] = '/';
}


x86 assembly (clang, -O0):
<bring_back_filename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <bring_back_filename+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <bring_back_filename+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bring_back_filename>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <bring_back_filename>
movb   $0x2f,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @bring_back_filename(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 47, i8* %9
ret void
}
void mm_additional_dump(struct CalculationInfo *info, char **dump) {}


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

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

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

LLVM IR (-O2):
%struct.CalculationInfo = type opaque
define void @mm_additional_dump(%struct.CalculationInfo* nocapture %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
char *GetEnvVar(char const *);
int atoi(char const *);
int GetEnvVarBool(const char *name, int *b, int def) {
  const char *s = GetEnvVar(name);
  *b = s ? atoi(s) : def;
  if (*b)
    *b = 1;
  return s != NULL;
}


x86 assembly (clang, -O0):
<GetEnvVarBool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GetEnvVar@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115c <GetEnvVarBool+0x3c>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    1162 <GetEnvVarBool+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     1182 <GetEnvVarBool+0x62>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEnvVarBool>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
call   1030 <GetEnvVar@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1140 <GetEnvVarBool+0x20>
mov    %rbx,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
xor    %ecx,%ecx
test   %ebp,%ebp
setne  %cl
mov    %ecx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetEnvVarBool(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i8* @GetEnvVar(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = call i32 @atoi(i8* %13)
br label %17
15: ; preds = %3
%16 = load i32, i32* %6
br label %17
17: ; preds = %15, %12
%18 = phi i32 [ %14, %12 ], [ %16, %15 ]
%19 = load i32*, i32** %5
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = load i32*, i32** %5
store i32 1, i32* %24
br label %25
25: ; preds = %23, %17
%26 = load i8*, i8** %7
%27 = icmp ne i8* %26, null
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @GetEnvVarBool(i8* %0, i32* nocapture writeonly %1, i32 %2) {
%4 = tail call i8* @GetEnvVar(i8* %0)
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ %2, %3 ]
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %1
%12 = zext i1 %5 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void error_bad_quantum(void) {
  printf("Invalid time quantum: expected integer in range [1,2^31-1].\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<error_bad_quantum>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_bad_quantum>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"Invalid time quantum: expected integer in range [1,2^31-1].\0A\00"
define void @error_bad_quantum() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"Invalid time quantum: expected integer in range [1,2^31-1].\00"
define void @error_bad_quantum() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int test(int);
int main(int argc, char **argv) {
  do {
    if ((test(25)) == -1) {
      perror("test(25)");
      exit(-1);
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x19,%edi
call   1050 <test@plt>
cmp    $0xffffffff,%eax
jne    116f <main+0x3f>
lea    0xea0(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
jmp    1174 <main+0x44>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x19,%edi
call   1050 <test@plt>
cmp    $0xffffffff,%eax
je     1144 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"test(25)\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i32 25)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fat(int);
int /*<<< orphan*/ fat2(int);
int myprint(int, int /*<<< orphan*/);
int main() {
  int ret;
  ret = myprint(7, fat2(7));
  ret = myprint(7, fat(7));
  ret = myprint(12, fat2(12));
  ret = myprint(12, fat(12));
  return (ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1050 <fat2@plt>
mov    %eax,%esi
mov    $0x7,%edi
call   1030 <myprint@plt>
mov    %eax,-0x8(%rbp)
mov    $0x7,%edi
call   1040 <fat@plt>
mov    %eax,%esi
mov    $0x7,%edi
call   1030 <myprint@plt>
mov    %eax,-0x8(%rbp)
mov    $0xc,%edi
call   1050 <fat2@plt>
mov    %eax,%esi
mov    $0xc,%edi
call   1030 <myprint@plt>
mov    %eax,-0x8(%rbp)
mov    $0xc,%edi
call   1040 <fat@plt>
mov    %eax,%esi
mov    $0xc,%edi
call   1030 <myprint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <fat2@plt>
mov    $0x7,%edi
mov    %eax,%esi
call   1030 <myprint@plt>
mov    $0x7,%edi
call   1040 <fat@plt>
mov    $0x7,%edi
mov    %eax,%esi
call   1030 <myprint@plt>
mov    $0xc,%edi
call   1050 <fat2@plt>
mov    $0xc,%edi
mov    %eax,%esi
call   1030 <myprint@plt>
mov    $0xc,%edi
call   1040 <fat@plt>
mov    $0xc,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <myprint@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @fat2(i32 7)
%4 = call i32 @myprint(i32 7, i32 %3)
store i32 %4, i32* %2
%5 = call i32 @fat(i32 7)
%6 = call i32 @myprint(i32 7, i32 %5)
store i32 %6, i32* %2
%7 = call i32 @fat2(i32 12)
%8 = call i32 @myprint(i32 12, i32 %7)
store i32 %8, i32* %2
%9 = call i32 @fat(i32 12)
%10 = call i32 @myprint(i32 12, i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fat2(i32 7)
%2 = tail call i32 @myprint(i32 7, i32 %1)
%3 = tail call i32 @fat(i32 7)
%4 = tail call i32 @myprint(i32 7, i32 %3)
%5 = tail call i32 @fat2(i32 12)
%6 = tail call i32 @myprint(i32 12, i32 %5)
%7 = tail call i32 @fat(i32 12)
%8 = tail call i32 @myprint(i32 12, i32 %7)
ret i32 %8
}
int local_index2global_index(int index) {
  return (-(index + ((0 - 1) * (-1) + ((- -1)))));
}


x86 assembly (clang, -O0):
<local_index2global_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_index2global_index>:
mov    $0xfffffffe,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @local_index2global_index(i32 %0) {
%2 = sub i32 -2, %0
ret i32 %2
}
int csolve_assume(int p) {
  while (!p) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<csolve_assume>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    111d <csolve_assume+0x1d>
jmp    1122 <csolve_assume+0x22>
jmp    1107 <csolve_assume+0x7>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<csolve_assume>:
test   %edi,%edi
je     1110 <csolve_assume+0x10>
xor    %eax,%eax
ret
nopw   0x0(%rax,%rax,1)
jmp    1110 <csolve_assume+0x10>

LLVM IR (-O0):
define i32 @csolve_assume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @csolve_assume(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LexInteractiveClear(int /*<<< orphan*/);
void LexCleanup() { LexInteractiveClear(0); }


x86 assembly (clang, -O0):
<LexCleanup>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LexInteractiveClear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LexCleanup>:
xor    %edi,%edi
jmp    1030 <LexInteractiveClear@plt>

LLVM IR (-O0):
define void @LexCleanup() {
%1 = call i32 @LexInteractiveClear(i32 0)
ret void
}

LLVM IR (-O2):
define void @LexCleanup() {
%1 = tail call i32 @LexInteractiveClear(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ds2770_init();
int /*<<< orphan*/ skipROM();
int /*<<< orphan*/ writeByte(int);
void refresh() {
  ds2770_init();
  skipROM();
  writeByte(0x63);
}


x86 assembly (clang, -O0):
<refresh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ds2770_init@plt>
mov    $0x0,%al
call   1040 <skipROM@plt>
mov    $0x63,%edi
call   1050 <writeByte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<refresh>:
push   %rax
xor    %eax,%eax
call   1030 <ds2770_init@plt>
xor    %eax,%eax
call   1040 <skipROM@plt>
mov    $0x63,%edi
pop    %rax
jmp    1050 <writeByte@plt>

LLVM IR (-O0):
define void @refresh() {
%1 = call i32 (...) @ds2770_init()
%2 = call i32 (...) @skipROM()
%3 = call i32 @writeByte(i32 99)
ret void
}

LLVM IR (-O2):
define void @refresh() {
%1 = tail call i32 (...) @ds2770_init()
%2 = tail call i32 (...) @skipROM()
%3 = tail call i32 @writeByte(i32 99)
ret void
}