xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ print_params(unsigned int);
unsigned int rand_init();
int main(int argc, char *argv[]) {
  unsigned int seed = rand_init();
  if (argc == 3) {
    print_params(seed);
  } else {
    perror("Bad arguments");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1167 <main+0x37>
mov    -0x14(%rbp),%edi
call   1040 <print_params@plt>
jmp    1173 <main+0x43>
lea    0xe92(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand_init@plt>
cmp    $0x3,%ebx
jne    114a <main+0x1a>
mov    %eax,%edi
call   1040 <print_params@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeaf(%rip),%rdi
call   1050 <perror@plt>
jmp    1146 <main+0x16>

LLVM IR (-O0):
@.str = [14 x i8] c"Bad arguments\00"
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
%7 = call i32 (...) @rand_init()
store i32 %7, i32* %6
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @print_params(i32 %11)
br label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Bad arguments\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand_init()
%4 = icmp eq i32 %0, 3
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @print_params(i32 %3)
br label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}
void mb(void) { asm volatile("lock; addl $0, 0(%%esp)" : : : "memory"); }


x86 assembly (clang, -O0):
<mb>:
push   %rbp
mov    %rsp,%rbp
lock addl $0x0,(%esp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb>:
lock addl $0x0,(%esp)
ret

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

LLVM IR (-O2):
define void @mb() {
tail call void asm sideeffect "lock; addl $$0, 0(%esp)", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gsl_test_rel(double const, double const, double const,
                                char *, char const *, char const *);
void penalty1_checksol(const double x[], const double sumsq,
                       const double epsrel, const char *sname,
                       const char *pname) {
  const double sumsq_exact = 7.08765146709037993e-05;
  gsl_test_rel(sumsq, sumsq_exact, epsrel, "%s/%s sumsq", sname, pname);
}


x86 assembly (clang, -O0):
<penalty1_checksol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  0xeab(%rip),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <gsl_test_rel@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<penalty1_checksol>:
movaps %xmm1,%xmm2
lea    0xeee(%rip),%rdi
movsd  0xede(%rip),%xmm1
jmp    1030 <gsl_test_rel@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty1_checksol(double* %0, double %1, double %2, i8* %3, i8* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double
store double* %0, double** %6
store double %1, double* %7
store double %2, double* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store double 0x3F12947140114CEB, double* %11
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @gsl_test_rel(double %12, double 0x3F12947140114CEB, double %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s/%s sumsq\00"
define void @penalty1_checksol(double* nocapture readnone %0, double %1, double %2, i8* %3, i8* %4) {
%6 = tail call i32 @gsl_test_rel(double %1, double 0x3F12947140114CEB, double %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}
char *savestr(s)
char *s;
{
  register char *p;
  p = ckmalloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <ckmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <ckmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ckmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @savestr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @ckmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
void ClearWinSock() {}


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

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

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

LLVM IR (-O2):
define void @ClearWinSock() {
ret void
}
void glUniform1ui(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform1ui() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_move_r(int /*<<< orphan*/, float, float);
void g2_move_r_(float *dev, float *dx, float *dy) {
  g2_move_r(dtoi(*dev), *dx, *dy);
}


x86 assembly (clang, -O0):
<g2_move_r_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1040 <g2_move_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_move_r_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r14),%xmm1
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <g2_move_r@plt>

LLVM IR (-O0):
define void @g2_move_r_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = call i32 @dtoi(float %8)
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = call i32 @g2_move_r(i32 %9, float %11, float %13)
ret void
}

LLVM IR (-O2):
define void @g2_move_r_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = tail call i32 @dtoi(float %4)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = tail call i32 @g2_move_r(i32 %5, float %6, float %7)
ret void
}
int C_Utils_compare_int_ptr(const int *item1, const int *item2) {
  int i1 = *item1;
  int i2 = *item2;
  if (i1 == i2)
    return 0;
  return i1 < i2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_int_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <C_Utils_compare_int_ptr+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114e <C_Utils_compare_int_ptr+0x4e>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_int_ptr>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_int_ptr(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
store i32 %9, i32* %6
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %22
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 -1, i32 1
store i32 %21, i32* %3
br label %22
22: ; preds = %16, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @C_Utils_compare_int_ptr(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    die("Failure to allocate %lu bytes\n", (unsigned long)size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Failure to allocate %lu bytes\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [31 x i8] c"Failure to allocate %lu bytes\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int ENXIO;
int nc_pm8xxx_mpp_config_digital_out(unsigned mpp, unsigned level,
                                     unsigned control) {
  return -ENXIO;
}


x86 assembly (clang, -O0):
<nc_pm8xxx_mpp_config_digital_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nc_pm8xxx_mpp_config_digital_out>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENXIO = global i32 0
define i32 @nc_pm8xxx_mpp_config_digital_out(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* @ENXIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENXIO = global i32 0
define i32 @nc_pm8xxx_mpp_config_digital_out(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENXIO
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void callee(int *arr) {
  arr[0] = 7;
  assert(arr[0] == 7);
}


x86 assembly (clang, -O0):
<callee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x7,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x7,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee>:
movl   $0x7,(%rdi)
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @callee(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 7, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @callee(i32* nocapture writeonly %0) {
store i32 7, i32* %0
%2 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_tohost(int);
void cputchar(int x) { do_tohost(0x0101000000000000 | (unsigned char)x); }


x86 assembly (clang, -O0):
<cputchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%eax
movabs $0x101000000000000,%rcx
or     %rcx,%rax
mov    %eax,%edi
call   1030 <do_tohost@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputchar>:
movzbl %dil,%edi
jmp    1030 <do_tohost@plt>

LLVM IR (-O0):
define void @cputchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i64
%6 = or i64 72339069014638592, %5
%7 = trunc i64 %6 to i32
%8 = call i32 @do_tohost(i32 %7)
ret void
}

LLVM IR (-O2):
define void @cputchar(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @do_tohost(i32 %2)
ret void
}
int do_694() { return 694; }


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

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

LLVM IR (-O0):
define i32 @do_694() {
ret i32 694
}

LLVM IR (-O2):
define i32 @do_694() {
ret i32 694
}
void SSMR3GetRCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetRCPtr() {
ret void
}
void segment_fault_handler(int signum) {
  printf("I am slain!\n");
  int *PC1 = (((char *)&signum) - sizeof(char *));
  int *PC2 = getOldPC(7);
  int bytes_to_jump = 97;
  *PC1 = (char *)*PC2 + bytes_to_jump;
}


x86 assembly (clang, -O0):
<segment_fault_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    $0x7,%edi
mov    $0x0,%al
call   1030 <getOldPC@plt>
cltq
mov    %rax,-0x18(%rbp)
movl   $0x61,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq (%rax),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<segment_fault_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <getOldPC@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"I am slain!\0A\00"
define void @segment_fault_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = bitcast i32* %2 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 -8
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @getOldPC to i32 (i32, ...)*)(i32 7)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %4
store i32 97, i32* %5
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = ptrtoint i8* %19 to i32
%21 = load i32*, i32** %3
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"I am slain!\00"
define void @segment_fault_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @getOldPC to i32 (i32, ...)*)(i32 7)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double monotime(void) {
  struct timespec ts;
  double t;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (double)ts.tv_sec + (double)ts.tv_nsec * 1E-9;
}


x86 assembly (clang, -O0):
<monotime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec3(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @monotime() {
%1 = alloca %struct.timespec
%2 = alloca double
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define double @monotime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 1.000000e-09, double %7)
ret double %11
}
int countBytes(unsigned int e) { return __builtin_popcount(e); }


x86 assembly (clang, -O0):
<countBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBytes>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @countBytes(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
long ConstExpression();
int /*<<< orphan*/ EnterAbsoluteMode(long);
int /*<<< orphan*/ Error(char *);
void DoOrg(void) {
  long PC = ConstExpression();
  if (PC < 0 || PC > 0xFFFFFF) {
    Error("Range error");
    return;
  }
  EnterAbsoluteMode(PC);
}


x86 assembly (clang, -O0):
<DoOrg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ConstExpression@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     115c <DoOrg+0x2c>
cmpq   $0xffffff,-0x8(%rbp)
jle    116d <DoOrg+0x3d>
lea    0xe9d(%rip),%rdi
call   1040 <Error@plt>
jmp    1176 <DoOrg+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <EnterAbsoluteMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoOrg>:
push   %rax
xor    %eax,%eax
call   1050 <ConstExpression@plt>
cmp    $0x1000000,%rax
jb     114d <DoOrg+0x1d>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1040 <Error@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <EnterAbsoluteMode@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"Range error\00"
define void @DoOrg() {
%1 = tail call i64 (...) @ConstExpression()
%2 = icmp ugt i64 %1, 16777215
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @Error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @EnterAbsoluteMode(i64 %1)
br label %7
7: ; preds = %5, %3
ret void
}
int gcd_rec(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd_rec(b, a % b);
  }
}


x86 assembly (clang, -O0):
<gcd_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd_rec+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd_rec+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd_rec@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_rec>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd_rec+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_rec+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd_rec(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcd_rec(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd_rec(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
void pvTrace(char *lpTraceMsg) { notify_pvcall("f"); }


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define void @pvTrace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define void @pvTrace(i8* nocapture readnone %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strnlen(const char *s, size_t n) {
  const char *start = s;
  while ((*s++) && (n--))
    ;
  return (s - 1) - start;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     114d <strnlen+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115d <strnlen+0x5d>
jmp    1162 <strnlen+0x62>
jmp    1114 <strnlen+0x14>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
neg    %rsi
mov    $0xffffffffffffffff,%rcx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
je     1127 <strnlen+0x27>
add    %rsi,%rcx
cmp    $0xffffffffffffffff,%rcx
mov    %rax,%rcx
jne    1110 <strnlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = add i64 %4, -1
%10 = icmp eq i64 %4, 0
%11 = select i1 %7, i1 true, i1 %10
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = ptrtoint i8* %5 to i64
%14 = ptrtoint i8* %0 to i64
%15 = sub i64 %13, %14
ret i64 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_to_bytes(uintptr_t, uintptr_t);
void fiat_p256_to_bytes(uint8_t out1[32], const uint64_t arg1[4]) {
  internal_fiat_p256_to_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_to_bytes>:
jmp    1030 <internal_fiat_p256_to_bytes@plt>

LLVM IR (-O0):
define void @fiat_p256_to_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_to_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_to_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_to_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_ch(int /*<<< orphan*/, int, char const);
void print(int x, int y, const char *str) {
  y = y % 8;
  for (; *str; ++str) {
    print_ch(x++, y, *str);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <print+0x58>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
call   1030 <print_ch@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <print+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
lea    0x7(%r14),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    (%rdx),%al
test   %al,%al
je     115b <print+0x4b>
mov    %rdx,%rbx
and    $0xfffffff8,%ecx
sub    %ecx,%r14d
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rdi),%ebp
movsbl %al,%edx
mov    %r14d,%esi
call   1030 <print_ch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
mov    %ebp,%edi
test   %al,%al
jne    1140 <print+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print(i32 %0, i32 %1, i8* nocapture %2) {
%4 = srem i32 %1, 8
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %3, %7
%8 = phi i8 [ %14, %7 ], [ %5, %3 ]
%9 = phi i8* [ %13, %7 ], [ %2, %3 ]
%10 = phi i32 [ %11, %7 ], [ %0, %3 ]
%11 = add nsw i32 %10, 1
%12 = tail call i32 @print_ch(i32 %10, i32 %4, i8 signext %8)
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %3
ret void
}
/* Variables and functions */
int kaijou(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int moto = 14;
  int result;
  result = kaijou(moto);
  printf("%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xe,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <kaijou@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 14, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @kaijou(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @kaijou(i32 14)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void bar(int *vla_ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @bar(i32* nocapture %0) {
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/callgraph.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 = [150 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/callgraph.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 ([150 x i8], [150 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 = [150 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/callgraph.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 ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
int arch_cpu_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @arch_cpu_init() {
ret i32 0
}
void gtk_clipboard_set_with_owner() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_set_with_owner() {
ret void
}
/* Variables and functions */
int a_cas(int volatile *, int, int);
int a_fetch_and(volatile int *p, int v) {
  int old;
  do
    old = *p;
  while (a_cas(p, old, old & v) != old);
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
and    -0xc(%rbp),%edx
call   1030 <a_cas@plt>
cmp    -0x10(%rbp),%eax
jne    111f <a_fetch_and+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_and>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%ebp
mov    %ebp,%edx
and    %r14d,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <a_cas@plt>
cmp    %ebp,%eax
jne    1120 <a_fetch_and+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @a_fetch_and(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = and i32 %4, %1
%6 = tail call i32 @a_cas(i32* %0, i32 %4, i32 %5)
%7 = icmp eq i32 %6, %4
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
__attribute__((no, optimize(3))) int func3(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<func3>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @func3(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int isAllDashes(char *s) {
  for (; *s != '\0'; s++) {
    if (*s != '-')
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isAllDashes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <isAllDashes+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1134 <isAllDashes+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1151 <isAllDashes+0x51>
jmp    1139 <isAllDashes+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isAllDashes+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAllDashes>:
movzbl (%rdi),%eax
cmp    $0x2d,%al
jne    110d <isAllDashes+0xd>
add    $0x1,%rdi
jmp    1100 <isAllDashes>
test   %al,%al
jne    1117 <isAllDashes+0x17>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isAllDashes(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %16, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 45
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 i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %4
19: ; preds = %4
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 @isAllDashes(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 45, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %9
}
int isprime(long long int n) {
  int flag = 0;
  long long int i, j, k;
  for (i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1160 <isprime+0x60>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x20(%rbp)
cmp    $0x0,%rdx
jne    114a <isprime+0x4a>
movl   $0x1,-0x14(%rbp)
jmp    1160 <isprime+0x60>
jmp    114f <isprime+0x4f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <isprime+0x17>
cmpl   $0x0,-0x14(%rbp)
jne    1176 <isprime+0x76>
movl   $0x1,-0x4(%rbp)
jmp    117d <isprime+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%eax
cmp    $0x4,%rdi
jl     1153 <isprime+0x53>
mov    $0x2,%ecx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1130 <isprime+0x30>
mov    %rdi,%rax
cqto
idiv   %rcx
test   %rdx,%rdx
jne    113b <isprime+0x3b>
jmp    114b <isprime+0x4b>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
test   %rdx,%rdx
je     114b <isprime+0x4b>
add    $0x1,%rcx
mov    %rcx,%rax
imul   %rcx,%rax
cmp    %rdi,%rax
jle    1110 <isprime+0x10>
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @isprime(i64 %0) {
%2 = icmp slt i64 %0, 4
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 2, %1 ]
%5 = srem i64 %0, %4
%6 = icmp eq i64 %5, 0
%7 = add nuw nsw i64 %4, 1
%8 = mul nsw i64 %7, %7
%9 = icmp sgt i64 %8, %0
%10 = select i1 %6, i1 true, i1 %9
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = xor i1 %6, true
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %11, %1
%15 = phi i32 [ 1, %1 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int Partition(int *, int, int);
void QuickSort(int arr[], int p, int r) {
  int q;
  if (p < r) {
    q = Partition(arr, p, r);
    QuickSort(arr, p, q - 1);
    QuickSort(arr, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <QuickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <QuickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <QuickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <QuickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @Partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QuickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void wav_skip_header(FILE *f) { fseek(f, 40, SEEK_CUR); }


x86 assembly (clang, -O0):
<wav_skip_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0x28,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wav_skip_header>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0x28,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @wav_skip_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_CUR
%5 = call i32 @fseek(i32* %3, i32 40, i32 %4)
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @wav_skip_header(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i32 @fseek(i32* %0, i32 40, i32 %2)
ret void
}
void benchSVML512_DPNontrig() {}


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

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

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

LLVM IR (-O2):
define void @benchSVML512_DPNontrig() {
ret void
}