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

/* Variables and functions */
int IPC_CREAT;
int /*<<< orphan*/ createKey();
int semget(int /*<<< orphan*/, int, int);
int createSem(int nsems, int permission) {
  int result = -1;
  int semid;
  key_t key = createKey();
  if (-1 != (semid = semget(key, nsems, permission | IPC_CREAT)))
    result = semid;
  return result;
}


x86 assembly (clang, -O0):
<createSem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    $0x0,%al
call   1040 <createKey@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    0x2e91(%rip),%rax
or     (%rax),%edx
call   1030 <semget@plt>
mov    %eax,%ecx
mov    %ecx,-0x10(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     116e <createSem+0x4e>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createSem>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <createKey@plt>
mov    0x2eab(%rip),%rcx
or     (%rcx),%ebx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <semget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @createSem(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%8 = call i32 (...) @createKey()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* @IPC_CREAT
%13 = or i32 %11, %12
%14 = call i32 @semget(i32 %9, i32 %10, i32 %13)
store i32 %14, i32* %6
%15 = icmp ne i32 -1, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i32, i32* %6
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @createSem(i32 %0, i32 %1) {
%3 = tail call i32 (...) @createKey()
%4 = load i32, i32* @IPC_CREAT
%5 = or i32 %4, %1
%6 = tail call i32 @semget(i32 %3, i32 %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgadd(void) { gen("addl\t%ecx,%eax"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"addl\09%ecx,%eax\00"
define void @cgadd() {
%1 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"addl\09%ecx,%eax\00"
define void @cgadd() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
double dleftlog(double x, double r) {
  return (r * (1.0 - (4.0 * x) + (3.0 * x * x)));
}


x86 assembly (clang, -O0):
<dleftlog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xee4(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xec8(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dleftlog>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xef4(%rip),%xmm2
movsd  0xef4(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dleftlog(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call double @llvm.fmuladd.f64(double -4.000000e+00, double %6, double 1.000000e+00)
%8 = load double, double* %3
%9 = fmul double 3.000000e+00, %8
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %9, double %10, double %7)
%12 = fmul double %5, %11
ret double %12
}

LLVM IR (-O2):
define double @dleftlog(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double -4.000000e+00, double 1.000000e+00)
%4 = fmul double %0, 3.000000e+00
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %3)
%6 = fmul double %5, %1
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int write_ppm_pixel(FILE *fp, unsigned char r, unsigned char g,
                    unsigned char b) {
  unsigned char ptr[16];
  ptr[0] = r;
  ptr[1] = g;
  ptr[2] = b;
  fwrite(ptr, 1, 3, fp);
  return 1;
}


x86 assembly (clang, -O0):
<write_ppm_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x20(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x1f(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0x1e(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x3,%edx
call   1030 <fwrite@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ppm_pixel>:
sub    $0x18,%rsp
mov    %rdi,%rax
mov    %sil,(%rsp)
mov    %dl,0x1(%rsp)
mov    %cl,0x2(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %rax,%rcx
call   1030 <fwrite@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @write_ppm_pixel(i32* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [16 x i8]
store i32* %0, i32** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %6
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i8, i8* %7
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i8, i8* %8
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%17 = load i32*, i32** %5
%18 = call i32 @fwrite(i8* %16, i32 1, i32 3, i32* %17)
ret i32 1
}

LLVM IR (-O2):
define i32 @write_ppm_pixel(i32* nocapture %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
store i8 %1, i8* %6
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 1
store i8 %2, i8* %7
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 2
store i8 %3, i8* %8
%9 = call i32 @fwrite(i8* %6, i32 1, i32 3, i32* %0)
ret i32 1
}
I0RX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (22 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzwl (%rax,%rcx,2),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     1144 <I0RX1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <I0RX1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0RX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpw   $0x16,(%r9,%rcx,2)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @I0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = icmp ugt i16 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int Call_C_Arg_Mem_L(int, int, char *, int);
int Call_C_Arg_Foreign_L(int offset, int adr_of, int index) {
  return Call_C_Arg_Mem_L(offset, adr_of, "pl_foreign_long", index);
}


x86 assembly (clang, -O0):
<Call_C_Arg_Foreign_L>:
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
mov    -0xc(%rbp),%ecx
lea    0xecf(%rip),%rdx
call   1030 <Call_C_Arg_Mem_L@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Call_C_Arg_Foreign_L>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <Call_C_Arg_Mem_L@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"pl_foreign_long\00"
define i32 @Call_C_Arg_Foreign_L(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 = call i32 @Call_C_Arg_Mem_L(i32 %7, i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [16 x i8] c"pl_foreign_long\00"
define i32 @Call_C_Arg_Foreign_L(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Call_C_Arg_Mem_L(i32 %0, i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %4
}
int is_prime(int n) {
  int i;
  for (i = 2; i != n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x2,%edi
je     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp eq i32 %0, 2
br i1 %2, label %10, label %5
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
int test_imm_38int64_lowword_mem(long long *val) {
  return ((*val) & (0x38 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_38int64_lowword_mem>:
testb  $0x38,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_38int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 56
%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_38int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 56
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, b, c;
  a = 5;
  b = 10;
  c = (a < b) ? a : b;
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1144 <main+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114a <main+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
int try_appdata_for_conf(void) {
  {
    log_prefix("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/"
               "refs/heads/master/src/cfg/config.c",
               __FUNCTION__, 387);
    log_msg("Entered into this function");
  };
  return 0;
}


x86 assembly (clang, -O0):
<try_appdata_for_conf>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf64(%rip),%rsi
mov    $0x183,%edx
mov    $0x0,%al
call   1030 <log_prefix@plt>
lea    0xf66(%rip),%rdi
mov    $0x0,%al
call   1040 <log_msg@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_appdata_for_conf>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf67(%rip),%rsi
mov    $0x183,%edx
xor    %eax,%eax
call   1030 <log_prefix@plt>
lea    0xf69(%rip),%rdi
xor    %eax,%eax
call   1040 <log_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/cfg/config.c\00"
@__FUNCTION__.try_appdata_for_conf = [21 x i8] c"try_appdata_for_conf\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_appdata_for_conf() {
%1 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.try_appdata_for_conf, i64 0, i64 0), i32 387)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/cfg/config.c\00"
@__FUNCTION__.try_appdata_for_conf = [21 x i8] c"try_appdata_for_conf\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_appdata_for_conf() {
%1 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.try_appdata_for_conf, i64 0, i64 0), i32 387)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c;
  while (c != EOF) {
    c = getchar();
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     1158 <main+0x38>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    (%r14),%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @putchar(i32 %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %2, %4
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/);
scalar_t__ bla();
int /*<<< orphan*/ strlen(char *);
void foo(int i) {
  char *s = "abcde";
  if (i) {
    s = "defgh";
    goto middle;
  }
start:
  bla();
middle:
  if (bla())
    goto start;
  bar(strlen(s));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1160 <foo+0x30>
lea    0xeaf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    116c <foo+0x3c>
jmp    1165 <foo+0x35>
mov    $0x0,%al
call   1050 <bla@plt>
mov    $0x0,%al
call   1050 <bla@plt>
cmp    $0x0,%rax
je     1182 <foo+0x52>
jmp    1165 <foo+0x35>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %r14
push   %rbx
push   %rax
lea    0xecb(%rip),%r14
lea    0xebe(%rip),%rbx
test   %edi,%edi
jne    1150 <foo+0x20>
xor    %eax,%eax
call   1050 <bla@plt>
mov    %rbx,%r14
xor    %eax,%eax
call   1050 <bla@plt>
test   %rax,%rax
je     1161 <foo+0x31>
mov    %r14,%rbx
jmp    1146 <foo+0x16>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <bar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [6 x i8] c"defgh\00"
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %10
7: ; preds = %1
br label %8
8: ; preds = %13, %7
%9 = call i64 (...) @bla()
br label %10
10: ; preds = %8, %6
%11 = call i64 (...) @bla()
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %8
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @bar(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [6 x i8] c"defgh\00"
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ]
%5 = tail call i64 (...) @bla()
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %1 ]
%8 = tail call i64 (...) @bla()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %6
%11 = tail call i32 @strlen(i8* %7)
%12 = tail call i32 @bar(i32 %11)
ret void
}
int atend(const char *const *const p) { return **p == '\0'; }


x86 assembly (clang, -O0):
<atend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atend>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @atend(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @atend(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long strtou(const char *str, const char **end) {
  unsigned long i;
  for (i = 0; *str >= '0' && *str <= '9'; ++str)
    i = i * 10 + *str - '0';
  *end = str;
  return i;
}


x86 assembly (clang, -O0):
<strtou>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x19(%rbp)
jl     1139 <strtou+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1149 <strtou+0x49>
jmp    1172 <strtou+0x72>
imul   $0xa,-0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strtou+0x14>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtou>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%eax
cmp    $0x9,%al
ja     1133 <strtou+0x33>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%rax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
lea    -0x30(%rcx),%edx
cmp    $0xa,%dl
jb     1110 <strtou+0x10>
mov    %rdi,(%rsi)
ret
xor    %eax,%eax
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i64 @strtou(i8* %0, i8** nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %2, %6
%7 = phi i8 [ %15, %6 ], [ %3, %2 ]
%8 = phi i64 [ %13, %6 ], [ 0, %2 ]
%9 = phi i8* [ %14, %6 ], [ %0, %2 ]
%10 = mul i64 %8, 10
%11 = zext i8 %7 to i64
%12 = add i64 %10, -48
%13 = add i64 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i8* [ %0, %2 ], [ %14, %6 ]
%20 = phi i64 [ 0, %2 ], [ %13, %6 ]
store i8* %19, i8** %1
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ NotifyBox(int, char *, int);
int /*<<< orphan*/ call(char *, char *);
int /*<<< orphan*/ gui_stop_menu();
void load_h264_ini() {
  gui_stop_menu();
  call("IVAParamMode", "ML/H264.ini");
  NotifyBox(2000, "%s", 0x4da10);
}


x86 assembly (clang, -O0):
<load_h264_ini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gui_stop_menu@plt>
lea    0xebe(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1050 <call@plt>
mov    $0x7d0,%edi
lea    0xebf(%rip),%rsi
mov    $0x4da10,%edx
call   1040 <NotifyBox@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_h264_ini>:
push   %rax
xor    %eax,%eax
call   1030 <gui_stop_menu@plt>
lea    0xec1(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <call@plt>
lea    0xec7(%rip),%rsi
mov    $0x7d0,%edi
mov    $0x4da10,%edx
pop    %rax
jmp    1040 <NotifyBox@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"IVAParamMode\00"
@.str.1 = [12 x i8] c"ML/H264.ini\00"
@.str.2 = [3 x i8] c"%s\00"
define void @load_h264_ini() {
%1 = call i32 (...) @gui_stop_menu()
%2 = call i32 @call(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @NotifyBox(i32 2000, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 317968)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"IVAParamMode\00"
@.str.1 = [12 x i8] c"ML/H264.ini\00"
@.str.2 = [3 x i8] c"%s\00"
define void @load_h264_ini() {
%1 = tail call i32 (...) @gui_stop_menu()
%2 = tail call i32 @call(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @NotifyBox(i32 2000, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 317968)
ret void
}
int max(int x, int y) {
  if (x <= y) {
    return (y);
  }
  return (x);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%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
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

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
}
void xf86UnblockSIGIO(int wasset) {}


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

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

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

LLVM IR (-O2):
define void @xf86UnblockSIGIO(i32 %0) {
ret void
}
/* Variables and functions */
double dfloor(double);
double sawtooth(double a) { return a - dfloor(a); }


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

x86 assembly (clang, -O2):
<sawtooth>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <dfloor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sawtooth(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @dfloor(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @sawtooth(double %0) {
%2 = tail call double @dfloor(double %0)
%3 = fsub double %0, %2
ret double %3
}
int __attribute__((no_sanitize_address)) main(void) {
  char *ptr;
  char *ptr2;
  {
    char my_char[9];
    ptr = &my_char[0];
    __builtin_memcpy(&ptr2, &ptr, sizeof(ptr2));
  }
  *(ptr2 + 9) = 'c';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x19(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x63,0x9(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
store i8* %4, i8** %1
%5 = bitcast i8** %2 to i8*
%6 = bitcast i8** %1 to i8*
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 9
store i8 99, i8* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fun349() { return 349; }


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

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

LLVM IR (-O0):
define i32 @fun349() {
ret i32 349
}

LLVM IR (-O2):
define i32 @fun349() {
ret i32 349
}
/* Variables and functions */
int /*<<< orphan*/ check_timers();
int /*<<< orphan*/ setup_timers();
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_waitsig();
int main(int argc, char **argv) {
  test_init(argc, argv);
  setup_timers();
  test_daemon();
  test_waitsig();
  check_timers();
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
mov    $0x0,%al
call   1040 <setup_timers@plt>
mov    $0x0,%al
call   1050 <test_daemon@plt>
mov    $0x0,%al
call   1070 <test_waitsig@plt>
mov    $0x0,%al
call   1060 <check_timers@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <setup_timers@plt>
xor    %eax,%eax
call   1050 <test_daemon@plt>
xor    %eax,%eax
call   1070 <test_waitsig@plt>
xor    %eax,%eax
call   1060 <check_timers@plt>
xor    %eax,%eax
pop    %rcx
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 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 (...) @setup_timers()
%10 = call i32 (...) @test_daemon()
%11 = call i32 (...) @test_waitsig()
%12 = call i32 (...) @check_timers()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @setup_timers()
%5 = tail call i32 (...) @test_daemon()
%6 = tail call i32 (...) @test_waitsig()
%7 = tail call i32 (...) @check_timers()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int stat(char *, struct stat *);
int getFileSize(char *name) {
  struct stat fileInfo;
  if (stat(name, &fileInfo) == -1) {
    do {
      perror("stat");
      exit(EXIT_FAILURE);
    } while (0);
  }
  return fileInfo.st_size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1171 <getFileSize+0x41>
jmp    1157 <getFileSize+0x27>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1143 <getFileSize+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [5 x i8] c"stat\00"
@EXIT_FAILURE = global i32 0
define i32 @getFileSize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
void najeResolveReferences() {}


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

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

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

LLVM IR (-O2):
define void @najeResolveReferences() {
ret void
}
/* Variables and functions */
double ceil(double);
double fabs(double);
double ceil_with_tolerance(double x, double tol) {
  double rounded;
  rounded = (double)(x + 0.5);
  if (fabs(rounded - x) <= tol)
    return (rounded);
  else
    return (ceil(x));
}


x86 assembly (clang, -O0):
<ceil_with_tolerance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xee6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xebb(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1167 <ceil_with_tolerance+0x57>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <ceil_with_tolerance+0x66>
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_with_tolerance>:
movsd  0xee8(%rip),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
andpd  0xee4(%rip),%xmm3
ucomisd %xmm3,%xmm1
jae    1137 <ceil_with_tolerance+0x27>
jmp    1030 <ceil@plt>
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ceil_with_tolerance(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fadd double %7, 5.000000e-01
store double %8, double* %6
%9 = load double, double* %6
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = call double @llvm.fabs.f64(double %11)
%13 = load double, double* %5
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load double, double* %6
store double %16, double* %3
br label %20
17: ; preds = %2
%18 = load double, double* %4
%19 = call double @llvm.ceil.f64(double %18)
store double %19, double* %3
br label %20
20: ; preds = %17, %15
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @ceil_with_tolerance(double %0, double %1) {
%3 = fadd double %0, 5.000000e-01
%4 = fsub double %3, %0
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ugt double %5, %1
%7 = tail call double @llvm.ceil.f64(double %0)
%8 = select i1 %6, double %7, double %3
ret double %8
}
void gdev_vsched_null_schedule_memory(struct gdev_sched_entity *se) {}


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

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

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

LLVM IR (-O2):
%struct.gdev_sched_entity = type opaque
define void @gdev_vsched_null_schedule_memory(%struct.gdev_sched_entity* nocapture %0) {
ret void
}
void ux500_ci_dbg_console_handle_ape_resume(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ux500_ci_dbg_console_handle_ape_resume() {
ret void
}
/* Variables and functions */
int idris2_isNull(void *ptr) { return (ptr == NULL); }


x86 assembly (clang, -O0):
<idris2_isNull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris2_isNull>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @idris2_isNull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @idris2_isNull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DieWithError(char *);
scalar_t__ send(int, unsigned char *, int, int /*<<< orphan*/);
void new_write(int sock, unsigned char *pkt_out, int struct_len) {
  if (send(sock, pkt_out, struct_len, 0) < 0)
    DieWithError("send() error");
}


x86 assembly (clang, -O0):
<new_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0x0,%rax
jge    1159 <new_write+0x39>
lea    0xeac(%rip),%rdi
call   1040 <DieWithError@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_write>:
push   %rax
xor    %ecx,%ecx
call   1030 <send@plt>
test   %rax,%rax
js     112f <new_write+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <DieWithError@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"send() error\00"
define void @new_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @DieWithError(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
unsigned long insert_rbs(unsigned long insn, long value __attribute__((unused)),
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  return insn | (((insn >> 21) & 0x1f) << 11);
}


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

x86 assembly (clang, -O2):
<insert_rbs>:
mov    %rdi,%rax
shr    $0xa,%rax
and    $0xf800,%eax
or     %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @insert_rbs(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = lshr i64 %0, 10
%6 = and i64 %5, 63488
%7 = or i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void fun() { puts("mock fun"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"mock fun\00"
define void @fun() {
%1 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mock fun\00"
define void @fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *Crealloc(void *, size_t);
void *Crecalloc(void *p, size_t nelem, size_t elsize) {
  return Crealloc(p, nelem * elsize);
}


x86 assembly (clang, -O0):
<Crecalloc>:
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
imul   -0x18(%rbp),%rsi
call   1030 <Crealloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Crecalloc>:
imul   %rdx,%rsi
jmp    1030 <Crealloc@plt>

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

LLVM IR (-O2):
define i8* @Crecalloc(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @Crealloc(i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
void check_valid_symmetric_key_item_size(int size) {
  if (size != 10 + 32)
    abort_crypto_lib("Illegal size for symmetric key item");
}


x86 assembly (clang, -O0):
<check_valid_symmetric_key_item_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2a,-0x4(%rbp)
je     1131 <check_valid_symmetric_key_item_size+0x21>
lea    0xed4(%rip),%rdi
call   1030 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_valid_symmetric_key_item_size>:
cmp    $0x2a,%edi
jne    1116 <check_valid_symmetric_key_item_size+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <abort_crypto_lib@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Illegal size for symmetric key item\00"
define void @check_valid_symmetric_key_item_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 42
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Illegal size for symmetric key item\00"
define void @check_valid_symmetric_key_item_size(i32 %0) {
%2 = icmp eq i32 %0, 42
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
int isgraph(int c) {
  if (isspace(c) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    1139 <isgraph+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <isgraph+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
push   %rax
call   1030 <isspace@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float const fabs(float const);
int /*<<< orphan*/ kdAssert(int, char const *);
void kdAssertFloatEquals(const float expected, const float actual,
                         const float delta, const char *message) {
  kdAssert(fabs(expected - actual) <= delta, message);
}


x86 assembly (clang, -O0):
<kdAssertFloatEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x18(%rbp),%rsi
call   1030 <kdAssert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kdAssertFloatEquals>:
mov    %rdi,%rsi
subss  %xmm1,%xmm0
andps  0xee2(%rip),%xmm0
xor    %edi,%edi
ucomiss %xmm0,%xmm2
setae  %dil
jmp    1030 <kdAssert@plt>

LLVM IR (-O0):
define void @kdAssertFloatEquals(float %0, float %1, float %2, i8* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i8*
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i8* %3, i8** %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fsub float %9, %10
%12 = call float @fabs(float %11)
%13 = load float, float* %7
%14 = fcmp ole float %12, %13
%15 = zext i1 %14 to i32
%16 = load i8*, i8** %8
%17 = call i32 @kdAssert(i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @kdAssertFloatEquals(float %0, float %1, float %2, i8* %3) {
%5 = fsub float %0, %1
%6 = tail call float @llvm.fabs.f32(float %5)
%7 = fcmp ole float %6, %2
%8 = zext i1 %7 to i32
%9 = tail call i32 @kdAssert(i32 %8, i8* %3)
ret void
}