xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void crash_feof() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  feof(f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_feof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_feof>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <feof@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_feof() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @feof(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_feof() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @feof(i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
int MainLibLoad(char *name, char *shlib, void **ml, char **ermsg) {
  if (0) {
    name = name;
    shlib = shlib;
    ml = ml;
  }
  if (ermsg)
    *ermsg = "dynamic load supported not found";
  return -1;
}


x86 assembly (clang, -O0):
<MainLibLoad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     112d <MainLibLoad+0x2d>
mov    -0x20(%rbp),%rax
lea    0xed6(%rip),%rcx
mov    %rcx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MainLibLoad>:
test   %rcx,%rcx
je     110f <MainLibLoad+0xf>
lea    0xef4(%rip),%rax
mov    %rax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"dynamic load supported not found\00"
define i32 @MainLibLoad(i8* %0, i8* %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %8
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i8**, i8*** %8
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %12
br label %13
13: ; preds = %11, %4
ret i32 -1
}

LLVM IR (-O2):
@.str = [33 x i8] c"dynamic load supported not found\00"
define i32 @MainLibLoad(i8* nocapture readnone %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** writeonly %3) {
%5 = icmp eq i8** %3, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %4
ret i32 -1
}
/* Variables and functions */
scalar_t__ Char_3d_array(int, int, int);
int ***Int_3d_array(int i_size, int j_size, int k_size) {
  return ((int ***)Char_3d_array(i_size, j_size, k_size * sizeof(int)));
}


x86 assembly (clang, -O0):
<Int_3d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <Char_3d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_3d_array>:
shl    $0x2,%edx
jmp    1030 <Char_3d_array@plt>

LLVM IR (-O0):
define i32*** @Int_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @Char_3d_array(i32 %7, i32 %8, i32 %12)
%14 = inttoptr i64 %13 to i32***
ret i32*** %14
}

LLVM IR (-O2):
define i32*** @Int_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i64 @Char_3d_array(i32 %0, i32 %1, i32 %4)
%6 = inttoptr i64 %5 to i32***
ret i32*** %6
}
int ieee_p_3499444699_sub_1548073968174253783_3536714472(char *t1, int t2) {
  char t4[8];
  int t0;
  char *t5;
LAB0:
  t5 = (t4 + 4U);
  *((int *)t5) = t2;
  t0 = t2;
LAB1:
  return t0;
LAB2:;
}


x86 assembly (clang, -O0):
<ieee_p_3499444699_sub_1548073968174253783_3536714472>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee_p_3499444699_sub_1548073968174253783_3536714472>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ieee_p_3499444699_sub_1548073968174253783_3536714472(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [8 x i8]
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
br label %9
9: ; preds = %2
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 4
store i8* %11, i8** %8
%12 = load i32, i32* %5
%13 = load i8*, i8** %8
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
%15 = load i32, i32* %5
store i32 %15, i32* %7
br label %16
16: ; preds = %9
%17 = load i32, i32* %7
store i32 %17, i32* %3
br label %19
18: ; No predecessors!
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ieee_p_3499444699_sub_1548073968174253783_3536714472(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
__attribute((always_)) void a(int vm[g()][2]) {}


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

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

LLVM IR (-O0):
define void @a([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = call i32 (...) @g()
%4 = zext i32 %3 to i64
ret void
}

LLVM IR (-O2):
define void @a([2 x i32]* nocapture readnone %0) {
%2 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *ini_strncpy(char *dest, const char *src, size_t size) {
  strncpy(dest, src, size);
  dest[size - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<ini_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_strncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ini_strncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %0
}
short short_fetch_nand_seq_cst(short *ptr, int value) {
  return __atomic_fetch_nand(ptr, value, 5);
}


x86 assembly (clang, -O0):
<short_fetch_nand_seq_cst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
mov    %cx,-0xe(%rbp)
mov    -0xe(%rbp),%cx
mov    %cx,-0x14(%rbp)
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%ax
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x30(%rbp)
and    %esi,%edx
mov    %edx,-0x2c(%rbp)
not    %edx
mov    %edx,-0x28(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x22(%rbp)
test   $0x1,%cl
mov    %ax,-0x12(%rbp)
jne    1166 <short_fetch_nand_seq_cst+0x66>
jmp    1129 <short_fetch_nand_seq_cst+0x29>
mov    -0x22(%rbp),%ax
mov    %ax,-0x10(%rbp)
movswl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_fetch_nand_seq_cst>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
and    %esi,%ecx
not    %ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <short_fetch_nand_seq_cst+0x10>
ret

LLVM IR (-O0):
define signext i16 @short_fetch_nand_seq_cst(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %3
store i32 %1, i32* %4
%7 = load i16*, i16** %3
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i16, i16* %5
%11 = atomicrmw nand i16* %7, i16 %10 seq_cst
store i16 %11, i16* %6
%12 = load i16, i16* %6
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @short_fetch_nand_seq_cst(i16* nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = atomicrmw nand i16* %0, i16 %3 seq_cst
ret i16 %4
}
extern int TakeInt(int x) {
  if (x == 42)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<TakeInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jne    111d <TakeInt+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <TakeInt+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeInt>:
xor    %eax,%eax
cmp    $0x2a,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @TakeInt(i32 %0) {
%2 = icmp eq i32 %0, 42
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
void *memrchr(const void *s, int c, size_t n) {
  const unsigned char *src = (const unsigned char *)s + n - 1;
  unsigned char d = c;
  do {
    if (*src == d) {
      return (void *)src;
    }
  } while (src-- != s);
  return NULL;
}


x86 assembly (clang, -O0):
<memrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x29(%rbp)
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x29(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <memrchr+0x45>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <memrchr+0x6b>
jmp    114a <memrchr+0x4a>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    -0x10(%rbp),%rax
jne    1125 <memrchr+0x25>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %sil,-0x1(%rdi,%rdx,1)
je     111e <memrchr+0x1e>
add    $0xffffffffffffffff,%rdx
jne    1110 <memrchr+0x10>
ret
lea    (%rdi,%rdx,1),%rax
add    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i8* @memrchr(i8* %0, i32 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %2
%5 = trunc i32 %1 to i8
br label %6
6: ; preds = %11, %3
%7 = phi i8* [ %4, %3 ], [ %8, %11 ]
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %5
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = icmp eq i8* %8, %0
br i1 %12, label %13, label %6
13: ; preds = %11, %6
%14 = phi i8* [ %8, %6 ], [ null, %11 ]
ret i8* %14
}
unsigned long insert_bat(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{ return insn | (((insn >> 21) & 0x1f) << 16); }


x86 assembly (clang, -O0):
<insert_bat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x15,%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bat>:
mov    %rdi,%rax
shr    $0x5,%rax
and    $0x1f0000,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bat(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %4
%9 = lshr i64 %8, 21
%10 = and i64 %9, 31
%11 = shl i64 %10, 16
%12 = or i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @insert_bat(i64 %0, i64 %1, i8** nocapture readnone %2) {
%4 = lshr i64 %0, 5
%5 = and i64 %4, 2031616
%6 = or i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ solveBig();
int /*<<< orphan*/ solveSmall();
main() {
  solveSmall();
  solveBig();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <solveSmall@plt>
mov    $0x0,%al
call   1040 <solveBig@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @solveSmall()
%2 = call i32 (...) @solveBig()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @solveSmall()
%2 = tail call i32 (...) @solveBig()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ I2CBitDly();
int /*<<< orphan*/ I2CSCLHigh();
int /*<<< orphan*/ SCL_Down();
int /*<<< orphan*/ SDA_Down();
void I2CSendStart(void) {
  I2CSCLHigh();
  I2CBitDly();
  SDA_Down();
  I2CBitDly();
  SCL_Down();
  I2CBitDly();
}


x86 assembly (clang, -O0):
<I2CSendStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <I2CSCLHigh@plt>
mov    $0x0,%al
call   1030 <I2CBitDly@plt>
mov    $0x0,%al
call   1060 <SDA_Down@plt>
mov    $0x0,%al
call   1030 <I2CBitDly@plt>
mov    $0x0,%al
call   1050 <SCL_Down@plt>
mov    $0x0,%al
call   1030 <I2CBitDly@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSendStart>:
push   %rax
xor    %eax,%eax
call   1040 <I2CSCLHigh@plt>
xor    %eax,%eax
call   1030 <I2CBitDly@plt>
xor    %eax,%eax
call   1060 <SDA_Down@plt>
xor    %eax,%eax
call   1030 <I2CBitDly@plt>
xor    %eax,%eax
call   1050 <SCL_Down@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <I2CBitDly@plt>

LLVM IR (-O0):
define void @I2CSendStart() {
%1 = call i32 (...) @I2CSCLHigh()
%2 = call i32 (...) @I2CBitDly()
%3 = call i32 (...) @SDA_Down()
%4 = call i32 (...) @I2CBitDly()
%5 = call i32 (...) @SCL_Down()
%6 = call i32 (...) @I2CBitDly()
ret void
}

LLVM IR (-O2):
define void @I2CSendStart() {
%1 = tail call i32 (...) @I2CSCLHigh()
%2 = tail call i32 (...) @I2CBitDly()
%3 = tail call i32 (...) @SDA_Down()
%4 = tail call i32 (...) @I2CBitDly()
%5 = tail call i32 (...) @SCL_Down()
%6 = tail call i32 (...) @I2CBitDly()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _create_secret(char *, unsigned int, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void create_secret(char *secret, unsigned serial, char *key, char *header) {
  char buf[16];
  sprintf(buf, "%08x", (unsigned)time(NULL));
  _create_secret(secret, serial, key, header, buf);
}


x86 assembly (clang, -O0):
<create_secret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
lea    0xe9b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x30(%rbp),%r8
call   1030 <_create_secret@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_secret>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
lea    0xeab(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r12,%r8
call   1030 <_create_secret@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%08x\00"
define void @create_secret(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [16 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = call i64 @time(i32* null)
%12 = trunc i64 %11 to i32
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%19 = call i32 @_create_secret(i8* %14, i32 %15, i8* %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%08x\00"
define void @create_secret(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = tail call i64 @time(i32* null)
%8 = trunc i64 %7 to i32
%9 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @_create_secret(i8* %0, i32 %1, i8* %2, i8* %3, i8* %6)
ret void
}
unsigned char complementBit_fun_uchar(unsigned char x, unsigned i) {
  return x ^ 1 << i;
}


x86 assembly (clang, -O0):
<complementBit_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @complementBit_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @complementBit_fun_uchar(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = xor i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ e_cpy();
int /*<<< orphan*/ e_zp();
void e_cpy_zp() {
  e_zp();
  e_cpy();
}


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

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

LLVM IR (-O0):
define void @e_cpy_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_cpy()
ret void
}

LLVM IR (-O2):
define void @e_cpy_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_cpy()
ret void
}
int fz_idiv_up(int a, int b) { return a < 0 ? a / b : (a + b - 1) / b; }


x86 assembly (clang, -O0):
<fz_idiv_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1123 <fz_idiv_up+0x23>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1133 <fz_idiv_up+0x33>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz_idiv_up>:
test   %edi,%edi
lea    -0x1(%rdi,%rsi,1),%eax
cmovs  %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @fz_idiv_up(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
br label %18
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %4
%17 = sdiv i32 %15, %16
br label %18
18: ; preds = %11, %7
%19 = phi i32 [ %10, %7 ], [ %17, %11 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @fz_idiv_up(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = add i32 %0, -1
%5 = add i32 %4, %1
%6 = select i1 %3, i32 %0, i32 %5
%7 = sdiv i32 %6, %1
ret i32 %7
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ counts_get_normalised(struct hdr_histogram const *,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ counts_index_for(struct hdr_histogram const *,
                                    int /*<<< orphan*/);
int64_t hdr_count_at_value(const struct hdr_histogram *h, int64_t value) {
  return counts_get_normalised(h, counts_index_for(h, value));
}


x86 assembly (clang, -O0):
<hdr_count_at_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <counts_index_for@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <counts_get_normalised@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_count_at_value>:
push   %rbx
mov    %rdi,%rbx
call   1030 <counts_index_for@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <counts_get_normalised@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_count_at_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%7 = load i32, i32* %4
%8 = call i32 @counts_index_for(%struct.hdr_histogram* %6, i32 %7)
%9 = call i32 @counts_get_normalised(%struct.hdr_histogram* %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_count_at_value(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @counts_index_for(%struct.hdr_histogram* %0, i32 %1)
%4 = tail call i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t strtoint(char *string) {
  int dec = 0;
  while (*string) {
    dec = dec * 10 + (*string++ - '0');
  }
  return dec;
}


x86 assembly (clang, -O0):
<strtoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <strtoint+0x3f>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strtoint+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoint>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <strtoint+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strtoint+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strtoint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, -48
%12 = add i32 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int efclose(FILE *fp) {
  int retval = fclose(fp);
  if (retval < 0) {
    perror("Closing a file");
    exit(EXIT_FAILURE);
  }
  return retval;
}


x86 assembly (clang, -O0):
<efclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116c <efclose+0x3c>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efclose>:
push   %rax
call   1030 <fclose@plt>
test   %eax,%eax
js     113c <efclose+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Closing a file\00"
@EXIT_FAILURE = global i32 0
define i32 @efclose(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ add_items_to_menu();
int /*<<< orphan*/ show_menu(int);
int demo(void) {
  add_items_to_menu();
  show_menu(1);
  return 0;
}


x86 assembly (clang, -O0):
<demo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <add_items_to_menu@plt>
mov    $0x1,%edi
call   1040 <show_menu@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<demo>:
push   %rax
xor    %eax,%eax
call   1030 <add_items_to_menu@plt>
mov    $0x1,%edi
call   1040 <show_menu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @demo() {
%1 = call i32 (...) @add_items_to_menu()
%2 = call i32 @show_menu(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @demo() {
%1 = tail call i32 (...) @add_items_to_menu()
%2 = tail call i32 @show_menu(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x5b() {
  Assert_real((ispunct(91)),
              "/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_ispunct.c",
              460, ("ispunct should be 1 for ["));
}


x86 assembly (clang, -O0):
<t_ispunct_0x5b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5b,%edi
call   1030 <ispunct@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1cc,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1cc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for [\00"
define void @t_ispunct_0x5b() {
%1 = call i32 @ispunct(i32 91)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for [\00"
define void @t_ispunct_0x5b() {
%1 = tail call i32 @ispunct(i32 91)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgetc_test();
int /*<<< orphan*/ fread_test();
int /*<<< orphan*/ freadbig_test();
int /*<<< orphan*/ getc_unlocked_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sortie_test();
int /*<<< orphan*/ ungetc_fseek_test();
int /*<<< orphan*/ ungetc_ftell_test();
int /*<<< orphan*/ ungetc_test();
int stdio_test() {
  getc_unlocked_test();
  fgetc_test();
  ungetc_test();
  ungetc_ftell_test();
  ungetc_fseek_test();
  sortie_test();
  fread_test();
  freadbig_test();
  printf("STDIO TEST: DONE !!!!!!!!!!!!!!!!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<stdio_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getc_unlocked_test@plt>
mov    $0x0,%al
call   1050 <fgetc_test@plt>
mov    $0x0,%al
call   1060 <ungetc_test@plt>
mov    $0x0,%al
call   1080 <ungetc_ftell_test@plt>
mov    $0x0,%al
call   10a0 <ungetc_fseek_test@plt>
mov    $0x0,%al
call   1070 <sortie_test@plt>
mov    $0x0,%al
call   10b0 <fread_test@plt>
mov    $0x0,%al
call   1090 <freadbig_test@plt>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdio_test>:
push   %rax
xor    %eax,%eax
call   1030 <getc_unlocked_test@plt>
xor    %eax,%eax
call   1050 <fgetc_test@plt>
xor    %eax,%eax
call   1060 <ungetc_test@plt>
xor    %eax,%eax
call   1080 <ungetc_ftell_test@plt>
xor    %eax,%eax
call   10a0 <ungetc_fseek_test@plt>
xor    %eax,%eax
call   1070 <sortie_test@plt>
xor    %eax,%eax
call   10b0 <fread_test@plt>
xor    %eax,%eax
call   1090 <freadbig_test@plt>
lea    0xe30(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"STDIO TEST: DONE !!!!!!!!!!!!!!!!!\0A\00"
define i32 @stdio_test() {
%1 = call i32 (...) @getc_unlocked_test()
%2 = call i32 (...) @fgetc_test()
%3 = call i32 (...) @ungetc_test()
%4 = call i32 (...) @ungetc_ftell_test()
%5 = call i32 (...) @ungetc_fseek_test()
%6 = call i32 (...) @sortie_test()
%7 = call i32 (...) @fread_test()
%8 = call i32 (...) @freadbig_test()
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"STDIO TEST: DONE !!!!!!!!!!!!!!!!!\00"
define i32 @stdio_test() {
%1 = tail call i32 (...) @getc_unlocked_test()
%2 = tail call i32 (...) @fgetc_test()
%3 = tail call i32 (...) @ungetc_test()
%4 = tail call i32 (...) @ungetc_ftell_test()
%5 = tail call i32 (...) @ungetc_fseek_test()
%6 = tail call i32 (...) @sortie_test()
%7 = tail call i32 (...) @fread_test()
%8 = tail call i32 (...) @freadbig_test()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *string_to_utf8_alloc(const char *str) { return strdup(str); }


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

x86 assembly (clang, -O2):
<string_to_utf8_alloc>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @string_to_utf8_alloc(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int j;
  for (j = 1; j <= 255; j++) {
    printf("%d - %c\n", j, j);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int count_teens(int n) {
  switch (n) {
  case 10:
    return 3;
  case 11:
  case 12:
    return 6;
  case 15:
  case 16:
    return 7;
  case 13:
  case 14:
  case 18:
  case 19:
    return 8;
  case 17:
    return 9;
  default:
    assert(0);
  }
}


x86 assembly (clang, -O0):
<count_teens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     1180 <count_teens+0x70>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    1187 <count_teens+0x77>
movl   $0x6,-0x4(%rbp)
jmp    1187 <count_teens+0x77>
movl   $0x7,-0x4(%rbp)
jmp    1187 <count_teens+0x77>
movl   $0x8,-0x4(%rbp)
jmp    1187 <count_teens+0x77>
movl   $0x9,-0x4(%rbp)
jmp    1187 <count_teens+0x77>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_teens>:
push   %rax
add    $0xfffffff6,%edi
cmp    $0xa,%edi
jae    1128 <count_teens+0x18>
movslq %edi,%rax
lea    0xedd(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @count_teens(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 10, label %5
i32 11, label %6
i32 12, label %6
i32 15, label %7
i32 16, label %7
i32 13, label %8
i32 14, label %8
i32 18, label %8
i32 19, label %8
i32 17, label %9
]
5: ; preds = %1
store i32 3, i32* %2
br label %12
6: ; preds = %1, %1
store i32 6, i32* %2
br label %12
7: ; preds = %1, %1
store i32 7, i32* %2
br label %12
8: ; preds = %1, %1, %1, %1
store i32 8, i32* %2
br label %12
9: ; preds = %1
store i32 9, i32* %2
br label %12
10: ; preds = %1
%11 = call i32 @assert(i32 0)
br label %12
12: ; preds = %5, %6, %7, %8, %9, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.count_teens = [10 x i32] [i32 3, i32 6, i32 6, i32 8, i32 8, i32 7, i32 7, i32 9, i32 8, i32 8]
define i32 @count_teens(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 10
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @assert(i32 0)
br label %10
6: ; preds = %1
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.count_teens, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ undef, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
double asin(double);
double qASin(double a) { return asin(a); }


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

x86 assembly (clang, -O2):
<qASin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @qASin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
short f5(short a, short b) {
  unsigned c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswq -0x2(%rbp),%rdx
movswq -0x4(%rbp),%rax
imul   %rax,%rdx
xor    %eax,%eax
mov    %edx,%ecx
shr    $0x20,%rdx
and    $0x1,%edx
or     %dl,%al
mov    %ecx,-0x8(%rbp)
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
movslq %edi,%rcx
movslq %esi,%rax
imul   %rcx,%rax
shr    $0x20,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define signext i16 @f5(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = load i16, i16* %4
%8 = sext i16 %6 to i33
%9 = sext i16 %7 to i33
%10 = call { i33, i1 } @llvm.smul.with.overflow.i33(i33 %8, i33 %9)
%11 = extractvalue { i33, i1 } %10, 1
%12 = extractvalue { i33, i1 } %10, 0
%13 = trunc i33 %12 to i32
%14 = zext i32 %13 to i33
%15 = icmp ne i33 %12, %14
%16 = or i1 %11, %15
store i32 %13, i32* %5
%17 = zext i1 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @f5(i16 signext %0, i16 signext %1) {
%3 = sext i16 %0 to i33
%4 = sext i16 %1 to i33
%5 = mul nsw i33 %4, %3
%6 = lshr i33 %5, 32
%7 = trunc i33 %6 to i16
ret i16 %7
}
int cmp2(const void *a, const void *b) { return *(int *)b - *(int *)a; }


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

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

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

LLVM IR (-O2):
define i32 @cmp2(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ mtspr(int, int);
void cpu_perf_start(unsigned int conf) {
  mtspr(((7 << (11)) + 33), 0x1 | conf);
}


x86 assembly (clang, -O0):
<cpu_perf_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0x1,%esi
mov    $0x3821,%edi
call   1030 <mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_perf_start>:
mov    %edi,%esi
or     $0x1,%esi
mov    $0x3821,%edi
jmp    1030 <mtspr@plt>

LLVM IR (-O0):
define void @cpu_perf_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 1, %3
%5 = call i32 @mtspr(i32 14369, i32 %4)
ret void
}

LLVM IR (-O2):
define void @cpu_perf_start(i32 %0) {
%2 = or i32 %0, 1
%3 = tail call i32 @mtspr(i32 14369, i32 %2)
ret void
}
/* Variables and functions */
int ERR;
int getch();
int getin() {
  int ch = getch();
  if (ch == ERR)
    return -1;
  else
    return ch;
}


x86 assembly (clang, -O0):
<getin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%eax
jne    1140 <getin+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <getin+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getin>:
push   %rax
xor    %eax,%eax
call   1030 <getch@plt>
mov    0x2ec9(%rip),%rcx
cmp    (%rcx),%eax
mov    $0xffffffff,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ERR = global i32 0
define i32 @getin() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @ERR
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@ERR = global i32 0
define i32 @getin() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @ERR
%3 = icmp eq i32 %1, %2
%4 = select i1 %3, i32 -1, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print(unsigned char *hash, int hash_length) {
  int i;
  for (i = 0; i < hash_length; i++) {
    printf("%02x", hash[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<print>:
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    1158 <print+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02x\00"
define void @print(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 = %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %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
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print(i8* 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 i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %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
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checked_free(char *);
int /*<<< orphan*/ getCurrentLevelDir();
char *getPath2(int /*<<< orphan*/, char *);
char *getHelpTextFilename() {
  static char *filename = NULL;
  checked_free(filename);
  filename = getPath2(getCurrentLevelDir(), "helptext.conf");
  return filename;
}


x86 assembly (clang, -O0):
<getHelpTextFilename>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f05(%rip),%rdi
call   1040 <checked_free@plt>
mov    $0x0,%al
call   1050 <getCurrentLevelDir@plt>
mov    %eax,%edi
lea    0xeb0(%rip),%rsi
call   1030 <getPath2@plt>
mov    %rax,0x2ee4(%rip)
mov    0x2edd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHelpTextFilename>:
push   %rax
mov    0x2f08(%rip),%rdi
call   1040 <checked_free@plt>
xor    %eax,%eax
call   1050 <getCurrentLevelDir@plt>
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
call   1030 <getPath2@plt>
mov    %rax,0x2ee7(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getHelpTextFilename.filename = internal global i8* null
@.str = [14 x i8] c"helptext.conf\00"
define i8* @getHelpTextFilename() {
%1 = load i8*, i8** @getHelpTextFilename.filename
%2 = call i32 @checked_free(i8* %1)
%3 = call i32 (...) @getCurrentLevelDir()
%4 = call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getHelpTextFilename.filename
%5 = load i8*, i8** @getHelpTextFilename.filename
ret i8* %5
}

LLVM IR (-O2):
@getHelpTextFilename.filename = internal unnamed_addr global i8* null
@.str = [14 x i8] c"helptext.conf\00"
define i8* @getHelpTextFilename() {
%1 = load i8*, i8** @getHelpTextFilename.filename
%2 = tail call i32 @checked_free(i8* %1)
%3 = tail call i32 (...) @getCurrentLevelDir()
%4 = tail call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getHelpTextFilename.filename
ret i8* %4
}