xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ dump_ebb_hw_state();
int /*<<< orphan*/ dump_summary_ebb_state();
void term_handler(int signal) {
  dump_summary_ebb_state();
  dump_ebb_hw_state();
  abort();
}


x86 assembly (clang, -O0):
<term_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <dump_summary_ebb_state@plt>
mov    $0x0,%al
call   1040 <dump_ebb_hw_state@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<term_handler>:
push   %rax
xor    %eax,%eax
call   1050 <dump_summary_ebb_state@plt>
xor    %eax,%eax
call   1040 <dump_ebb_hw_state@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @term_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @dump_summary_ebb_state()
%4 = call i32 (...) @dump_ebb_hw_state()
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @term_handler(i32 %0) {
%2 = tail call i32 (...) @dump_summary_ebb_state()
%3 = tail call i32 (...) @dump_ebb_hw_state()
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gluLookAt(float, float, float, float, float, float, float,
                             float, float);
void LookAt(float p0, float p1, float p2, float l0, float l1, float l2,
            float u0, float u1, float u2) {
  gluLookAt(p0, p1, p2, l0, l1, l2, u0, u1, u2);
}


x86 assembly (clang, -O0):
<LookAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
movss  -0x1c(%rbp),%xmm6
movss  -0x20(%rbp),%xmm7
movss  0x10(%rbp),%xmm8
movss  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LookAt>:
jmp    1030 <gluLookAt@plt>

LLVM IR (-O0):
define void @LookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %10
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %13
%23 = load float, float* %14
%24 = load float, float* %15
%25 = load float, float* %16
%26 = load float, float* %17
%27 = load float, float* %18
%28 = call i32 @gluLookAt(float %19, float %20, float %21, float %22, float %23, float %24, float %25, float %26, float %27)
ret void
}

LLVM IR (-O2):
define void @LookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = tail call i32 @gluLookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8)
ret void
}
int bit_sat(int nbit, int val) {
  int pad = (1 << nbit) - 1;
  return (val + pad) & (~pad);
}


x86 assembly (clang, -O0):
<bit_sat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_sat>:
mov    %edi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%eax
not    %eax
add    %esi,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @bit_sat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = xor i32 %12, -1
%14 = and i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bit_sat(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %0
%4 = xor i32 %3, -1
%5 = add nsw i32 %4, %1
%6 = and i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ calloc(int, long);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stderr;
float *fvec_new_0(long n) {
  float *ret = (float *)calloc(sizeof(*ret), n);
  if (!ret) {
    fprintf(stderr, "fvec_new_0 %ld : out of memory\n", n);
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<fvec_new_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <fvec_new_0+0x49>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_new_0>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     1148 <fvec_new_0+0x18>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"fvec_new_0 %ld : out of memory\0A\00"
define float* @fvec_new_0(i64 %0) {
%2 = alloca i64
%3 = alloca float*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @calloc(i32 4, i64 %4)
%6 = inttoptr i64 %5 to float*
store float* %6, float** %3
%7 = load float*, float** %3
%8 = icmp ne float* %7, null
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i64, i64* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
%15 = load float*, float** %3
ret float* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"fvec_new_0 %ld : out of memory\0A\00"
define float* @fvec_new_0(i64 %0) {
%2 = tail call i64 @calloc(i32 4, i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to float*
ret float* %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ldvector(long double *V, long n0, long N) {
  free((char *)(V + n0 - 1));
}


x86 assembly (clang, -O0):
<free_ldvector>:
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),%rax
shl    $0x4,%rax
add    %rax,%rdi
add    $0xfffffffffffffff0,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ldvector>:
shl    $0x4,%rsi
add    %rsi,%rdi
add    $0xfffffffffffffff0,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ldvector(x86_fp80* %0, i64 %1, i64 %2) {
%4 = alloca x86_fp80*
%5 = alloca i64
%6 = alloca i64
store x86_fp80* %0, x86_fp80** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load x86_fp80*, x86_fp80** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds x86_fp80, x86_fp80* %7, i64 %8
%10 = getelementptr inbounds x86_fp80, x86_fp80* %9, i64 -1
%11 = bitcast x86_fp80* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_ldvector(x86_fp80* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 %1
%5 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 -1
%6 = bitcast x86_fp80* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
unsigned npot32(unsigned k) {
  if (k == 0)
    return 1;
  k--;
  k = k | (k >> 1);
  k = k | (k >> 2);
  k = k | (k >> 4);
  k = k | (k >> 8);
  k = k | (k >> 16);
  return k + 1;
}


x86 assembly (clang, -O0):
<npot32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <npot32+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1175 <npot32+0x75>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<npot32>:
test   %edi,%edi
je     112d <npot32+0x2d>
add    $0xffffffff,%edi
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
or     %ecx,%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @npot32(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = lshr i32 %4, 1
%6 = or i32 %5, %4
%7 = lshr i32 %6, 2
%8 = or i32 %7, %6
%9 = lshr i32 %8, 4
%10 = or i32 %9, %8
%11 = lshr i32 %10, 8
%12 = or i32 %11, %10
%13 = lshr i32 %12, 16
%14 = or i32 %13, %12
%15 = add i32 %14, 1
br label %16
16: ; preds = %1, %3
%17 = phi i32 [ %15, %3 ], [ 1, %1 ]
ret i32 %17
}
void getKSdata(double *V, long ntests) {
  int nprocs, myid, i, nsets;
  long first, last;
}


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

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

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

LLVM IR (-O2):
define void @getKSdata(double* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
ssize_t async_write_stdout(const char *buffer) {
  return write(STDOUT_FILENO, buffer, strlen(buffer));
}


x86 assembly (clang, -O0):
<async_write_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<async_write_stdout>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec3(%rip),%rax
mov    (%rax),%ebp
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @async_write_stdout(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 %3, i8* %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @async_write_stdout(i8* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %2, i8* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int hcf(int, int);
int lcm(int a, int b) { return (a / hcf(a, b)) * b; }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <hcf@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <hcf@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
imul   %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @hcf(i32 %6, i32 %7)
%9 = sdiv i32 %5, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = tail call i32 @hcf(i32 %0, i32 %1)
%4 = sdiv i32 %0, %3
%5 = mul nsw i32 %4, %1
ret i32 %5
}
int jump_label_text_reserved(void *start, void *end) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @jump_label_text_reserved(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, world");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ get_current();
unsigned long task_rlimit(int /*<<< orphan*/, unsigned int);
__attribute__((always_)) unsigned long rlimit(unsigned int limit) {
  return task_rlimit(get_current(), limit);
}


x86 assembly (clang, -O0):
<rlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_current@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <task_rlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlimit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_current@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <task_rlimit@plt>

LLVM IR (-O0):
define i64 @rlimit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get_current()
%4 = load i32, i32* %2
%5 = call i64 @task_rlimit(i32 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @rlimit(i32 %0) {
%2 = tail call i32 (...) @get_current()
%3 = tail call i64 @task_rlimit(i32 %2, i32 %0)
ret i64 %3
}
__attribute__((weak)) void
fd_nrf8001_get_temperature_success(float temperature __attribute__((unused))) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_get_temperature_success(float %0) {
ret void
}
/* Variables and functions */
int *realloc(int *, int);
int main(void) {
  int *x = realloc(NULL, 400);
  int *y;
  x = realloc(x, 400);
  x = realloc(x, 200);
  x = realloc(x, 600);
  y = realloc(x + 10, 800);
  x = realloc(x, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc8,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x258,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x28,%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x190,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0xc8,%esi
call   1030 <realloc@plt>
mov    %rax,%rdi
mov    $0x258,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
lea    0x28(%rax),%rdi
mov    $0x320,%esi
call   1030 <realloc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <realloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @realloc(i32* null, i32 400)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32* @realloc(i32* %5, i32 400)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32* @realloc(i32* %7, i32 200)
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32* @realloc(i32* %9, i32 600)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 10
%13 = call i32* @realloc(i32* %12, i32 800)
store i32* %13, i32** %3
%14 = load i32*, i32** %2
%15 = call i32* @realloc(i32* %14, i32 0)
store i32* %15, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @realloc(i32* null, i32 400)
%2 = tail call i32* @realloc(i32* %1, i32 400)
%3 = tail call i32* @realloc(i32* %2, i32 200)
%4 = tail call i32* @realloc(i32* %3, i32 600)
%5 = getelementptr inbounds i32, i32* %4, i64 10
%6 = tail call i32* @realloc(i32* %5, i32 800)
%7 = tail call i32* @realloc(i32* %4, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_suppress_invalid_specifier() {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-invalid-specifier"
  printf("%@", 12);
#pragma clang diagnostic pop
}


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

x86 assembly (clang, -O2):
<test_suppress_invalid_specifier>:
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%@\00"
define void @test_suppress_invalid_specifier() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}
int main(int argc, char **argv) {
  int val;
  val = 13;
  val += 37;
  return val;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xd,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x25,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 13, i32* %6
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 37
store i32 %8, i32* %6
%9 = load i32, i32* %6
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 50
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int json_pluck();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char **argv) {
  setlocale(LC_ALL, "");
  return json_pluck();
}


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    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <setlocale@plt>
mov    $0x0,%al
call   1030 <json_pluck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <setlocale@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <json_pluck@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
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* @LC_ALL
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @json_pluck()
ret i32 %8
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @json_pluck()
ret i32 %5
}
/* Variables and functions */
char *str2case(char *, char, char, int);
char *str2lower(char *str) { return str2case(str, 'A', 'Z', 32); }


x86 assembly (clang, -O0):
<str2lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x20,%ecx
call   1030 <str2case@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2lower>:
mov    $0x41,%esi
mov    $0x5a,%edx
mov    $0x20,%ecx
jmp    1030 <str2case@plt>

LLVM IR (-O0):
define i8* @str2lower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @str2case(i8* %3, i8 signext 65, i8 signext 90, i32 32)
ret i8* %4
}

LLVM IR (-O2):
define i8* @str2lower(i8* %0) {
%2 = tail call i8* @str2case(i8* %0, i8 signext 65, i8 signext 90, i32 32)
ret i8* %2
}
void ExttUserTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttUserTypeAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_list(int *pList, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    printf("%d ", pList[i]);
  }
  printf("\n");
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @show_list(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
char *strchr(const char *p, int ch) {
  char c;
  c = ch;
  for (;; ++p) {
    if (*p == c)
      return ((char *)p);
    if (*p == '\0')
      return (NULL);
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strchr+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <strchr+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <strchr+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1164 <strchr+0x64>
jmp    1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int, int);
void IF_about(void) {
  char Lib[8];
  *Lib = '\0';
  printf("nife (Networking Industrial Forth-like Environment) - version "
         "%s%s-%ld/%ld\n\t (c) S.E.R.I.A.N.E. 2009-13\n",
         Lib, "0.44", sizeof(long) * 8, sizeof(double) * 8);
}


x86 assembly (clang, -O0):
<IF_about>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
lea    0xf3b(%rip),%rdx
mov    $0x40,%r8d
mov    %r8d,%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_about>:
push   %rax
movb   $0x0,(%rsp)
lea    0xee4(%rip),%rdi
lea    0xf46(%rip),%rdx
mov    %rsp,%rsi
mov    $0x40,%ecx
mov    $0x40,%r8d
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [105 x i8] c"nife (Networking Industrial Forth-like Environment) - version %s%s-%ld/%ld\0A\09 (c) S.E.R.I.A.N.E. 2009-13\0A\00"
@.str.1 = [5 x i8] c"0.44\00"
define void @IF_about() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 64)
ret void
}

LLVM IR (-O2):
@.str = [105 x i8] c"nife (Networking Industrial Forth-like Environment) - version %s%s-%ld/%ld\0A\09 (c) S.E.R.I.A.N.E. 2009-13\0A\00"
@.str.1 = [5 x i8] c"0.44\00"
define void @IF_about() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 64)
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/iter.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/iter.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/iter.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
double vecvec(double *first1, double *last1, double *first2) {
  double p = 1.0;
  while (first1 < last1) {
    p += *first1 * *first2;
    ++first1;
    ++first2;
  }
  return p;
}


x86 assembly (clang, -O0):
<vecvec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116a <vecvec+0x6a>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <vecvec+0x1d>
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecvec>:
movsd  0xef8(%rip),%xmm0
cmp    %rsi,%rdi
jae    1129 <vecvec+0x29>
nopl   (%rax)
movsd  (%rdi),%xmm1
mulsd  (%rdx),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rdi
add    $0x8,%rdx
cmp    %rsi,%rdi
jb     1110 <vecvec+0x10>
ret

LLVM IR (-O0):
define double @vecvec(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
store double 1.000000e+00, double* %7
br label %8
8: ; preds = %12, %3
%9 = load double*, double** %4
%10 = load double*, double** %5
%11 = icmp ult double* %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double*, double** %6
%16 = load double, double* %15
%17 = load double, double* %7
%18 = call double @llvm.fmuladd.f64(double %14, double %16, double %17)
store double %18, double* %7
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i32 1
store double* %20, double** %4
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i32 1
store double* %22, double** %6
br label %8
23: ; preds = %8
%24 = load double, double* %7
ret double %24
}

LLVM IR (-O2):
define double @vecvec(double* %0, double* readnone %1, double* nocapture %2) {
%4 = icmp ult double* %0, %1
br i1 %4, label %5, label %15
5: ; preds = %3, %5
%6 = phi double [ %11, %5 ], [ 1.000000e+00, %3 ]
%7 = phi double* [ %13, %5 ], [ %2, %3 ]
%8 = phi double* [ %12, %5 ], [ %0, %3 ]
%9 = load double, double* %8
%10 = load double, double* %7
%11 = tail call double @llvm.fmuladd.f64(double %9, double %10, double %6)
%12 = getelementptr inbounds double, double* %8, i64 1
%13 = getelementptr inbounds double, double* %7, i64 1
%14 = icmp ult double* %12, %1
br i1 %14, label %5, label %15
15: ; preds = %5, %3
%16 = phi double [ 1.000000e+00, %3 ], [ %11, %5 ]
ret double %16
}
unsigned int foo(unsigned short x) { return x ? __builtin_ctz(x) : 16U; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
je     1127 <foo+0x27>
movzwl -0x2(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <foo+0x34>
mov    $0x10,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <foo+0x34>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     110c <foo+0xc>
bsf    %di,%ax
movzwl %ax,%eax
ret
mov    $0x10,%ax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @foo(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = call i32 @llvm.cttz.i32(i32 %8, i1 true)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 16, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i16 zeroext %0) {
%2 = tail call i16 @llvm.cttz.i16(i16 %0, i1 false)
%3 = zext i16 %2 to i32
ret i32 %3
}
dramfreq_register_notifier(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @dramfreq_register_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
void sd_version(int *ver_major, int *ver_minor, int *ver_revision) {
  *ver_major = 1;
  *ver_minor = 16;
  *ver_revision = 0;
}


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

x86 assembly (clang, -O2):
<sd_version>:
movl   $0x1,(%rdi)
movl   $0x10,(%rsi)
movl   $0x0,(%rdx)
ret

LLVM IR (-O0):
define void @sd_version(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
store i32 1, i32* %7
%8 = load i32*, i32** %5
store i32 16, i32* %8
%9 = load i32*, i32** %6
store i32 0, i32* %9
ret void
}

LLVM IR (-O2):
define void @sd_version(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
store i32 16, i32* %1
store i32 0, i32* %2
ret void
}
int wexitstatus(int stat_val) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @wexitstatus(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  printf("Int: %d\n", sizeof(int));
  printf("Float: %d\n", sizeof(float));
  printf("Char: %d\n", sizeof(char));
  printf("Double: %d\n", sizeof(double));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x8,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Int: %d\0A\00"
@.str.1 = [11 x i8] c"Float: %d\0A\00"
@.str.2 = [10 x i8] c"Char: %d\0A\00"
@.str.3 = [12 x i8] c"Double: %d\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Int: %d\0A\00"
@.str.1 = [11 x i8] c"Float: %d\0A\00"
@.str.2 = [10 x i8] c"Char: %d\0A\00"
@.str.3 = [12 x i8] c"Double: %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret void
}
void qdxFinal() {}


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

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

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

LLVM IR (-O2):
define void @qdxFinal() {
ret void
}
void addVector(double *v, double *d) {
  v[0] += d[0];
  v[1] += d[1];
  v[2] += d[2];
}


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

x86 assembly (clang, -O2):
<addVector>:
movsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @addVector(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 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fadd double %10, %7
store double %11, double* %9
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
%17 = load double, double* %16
%18 = fadd double %17, %14
store double %18, double* %16
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %3
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = fadd double %24, %21
store double %25, double* %23
ret void
}

LLVM IR (-O2):
define void @addVector(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = fadd double %3, %4
store double %5, double* %0
%6 = getelementptr inbounds double, double* %1, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fadd double %7, %9
store double %10, double* %8
%11 = getelementptr inbounds double, double* %1, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = fadd double %12, %14
store double %15, double* %13
ret void
}
int do_985() { return 985; }


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

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

LLVM IR (-O0):
define i32 @do_985() {
ret i32 985
}

LLVM IR (-O2):
define i32 @do_985() {
ret i32 985
}