xunge/DecIR huggingface dataset:
void rpmv_(dx, dy, dz) float *dx, *dy, *dz;
{ rpmv(*dx, *dy, *dz); }


x86 assembly (clang, -O0):
<rpmv_>:
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
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <rpmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmv_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <rpmv@plt>

LLVM IR (-O0):
define void @rpmv_(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 = fpext float %8 to double
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %9, double %12, double %15)
ret void
}

LLVM IR (-O2):
define void @rpmv_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @rpmv to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trampoline_brk(uintptr_t);
uintptr_t __brk(uintptr_t newbrk) { return (uintptr_t)trampoline_brk(newbrk); }


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

x86 assembly (clang, -O2):
<__brk>:
push   %rax
call   1030 <trampoline_brk@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @__brk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @trampoline_brk(i64 %3)
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @__brk(i64 %0) {
%2 = tail call i32 @trampoline_brk(i64 %0)
%3 = sext i32 %2 to i64
ret i64 %3
}
void recfil_(mask, npix, nrast) float mask[];
int *npix, *nrast;
{ rectangle_fill(mask, *npix, *nrast); }


x86 assembly (clang, -O0):
<recfil_>:
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
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <rectangle_fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recfil_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
xor    %eax,%eax
jmp    1030 <rectangle_fill@plt>

LLVM IR (-O0):
define void @recfil_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @rectangle_fill to i32 (float*, i32, i32, ...)*)(float* %7, i32 %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @recfil_(float* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @rectangle_fill to i32 (float*, i32, i32, ...)*)(float* %0, i32 %4, i32 %5)
ret void
}
SP_CASE(imacro, imetamacro_at) {
  int i0 = 1;
  int i1 = 2;
  int i2 = 3;
  int i3 = 4;
  SP_TRUE(i0 == 1);
  SP_TRUE(i1 == 2);
  SP_TRUE(i2 == 3);
  SP_TRUE(i3 == 4);
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x1c(%rbp)
cmpl   $0x1,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
cmpl   $0x2,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
cmpl   $0x3,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
cmpl   $0x4,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
push   %rax
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <SP_TRUE@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <SP_TRUE@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <SP_TRUE@plt>
mov    $0x1,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 1, i32* %6
store i32 2, i32* %7
store i32 3, i32* %8
store i32 4, i32* %9
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %16)
%18 = load i32, i32* %8
%19 = icmp eq i32 %18, 3
%20 = zext i1 %19 to i32
%21 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %20)
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, 4
%24 = zext i1 %23 to i32
%25 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
struct bwb_line *bwb_QUIT(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  return bwb_SYSTEM(l);
}


x86 assembly (clang, -O0):
<bwb_QUIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <bwb_SYSTEM@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_QUIT>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <bwb_SYSTEM@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_QUIT = [9 x i8] c"bwb_QUIT\00"
define %struct.bwb_line* @bwb_QUIT(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.bwb_QUIT, i64 0, i64 0))
%4 = load %struct.bwb_line*, %struct.bwb_line** %2
%5 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_SYSTEM to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.bwb_line*
ret %struct.bwb_line* %7
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_QUIT = [9 x i8] c"bwb_QUIT\00"
define %struct.bwb_line* @bwb_QUIT(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.bwb_QUIT, i64 0, i64 0))
%3 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_SYSTEM to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bwb_line*
ret %struct.bwb_line* %5
}
/* Variables and functions */
void FREE_PTR(void *);
void lrtr_free(void *ptr) { return FREE_PTR(ptr); }


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

x86 assembly (clang, -O2):
<lrtr_free>:
jmp    1030 <FREE_PTR@plt>

LLVM IR (-O0):
define void @lrtr_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @lrtr_free(i8* %0) {
tail call void @FREE_PTR(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rpi2_gdb_trap();
void gdb_trap() { rpi2_gdb_trap(); }


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

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

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

LLVM IR (-O2):
define void @gdb_trap() {
%1 = tail call i32 (...) @rpi2_gdb_trap()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void destroyAlpha(double *alpha) {
  if (alpha != NULL)
    do {
      if (alpha) {
        free(alpha);
        alpha = 0;
      }
    } while (0);
}


x86 assembly (clang, -O0):
<destroyAlpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <destroyAlpha+0x42>
jmp    112c <destroyAlpha+0x1c>
cmpq   $0x0,-0x8(%rbp)
je     1148 <destroyAlpha+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    114d <destroyAlpha+0x3d>
jmp    1152 <destroyAlpha+0x42>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyAlpha>:
test   %rdi,%rdi
je     111a <destroyAlpha+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @destroyAlpha(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %14
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = load double*, double** %2
%8 = icmp ne double* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load double*, double** %2
%11 = call i32 @free(double* %10)
store double* null, double** %2
br label %12
12: ; preds = %9, %6
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
define void @destroyAlpha(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DoSimpleCommand(int);
void FCEU_QSimpleCommand(int cmd) { FCEU_DoSimpleCommand(cmd); }


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

x86 assembly (clang, -O2):
<FCEU_QSimpleCommand>:
jmp    1030 <FCEU_DoSimpleCommand@plt>

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

LLVM IR (-O2):
define void @FCEU_QSimpleCommand(i32 %0) {
%2 = tail call i32 @FCEU_DoSimpleCommand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void Void_0_io_1_print_2_Double(double value) { printf("%f", value); }


x86 assembly (clang, -O0):
<Void_0_io_1_print_2_Double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @Void_0_io_1_print_2_Double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ INT_MIN;
int main(void) {
  ~1;
  ~(INT_MAX - 1);
  -1;
  INT_MIN;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MAX
%3 = sub nsw i32 %2, 1
%4 = xor i32 %3, -1
%5 = load i32, i32* @INT_MIN
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define i32 @main() {
ret i32 0
}
int grid_y(int y) { return 48 - y - 1; }


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

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

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

LLVM IR (-O2):
define i32 @grid_y(i32 %0) {
%2 = sub i32 47, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ gen_age();
int main(int argc, char *argv[]) { gen_age(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gen_age@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @gen_age()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_state(int);
int /*<<< orphan*/ printf(char *);
void *secondary_return(void *arg) {
  (void)(arg);
  check_state(5);
  volatile int i = 0;
  while (i < 10000000L)
    i++;
  printf("Secondary return thread alive\n");
  check_state(6);
  return ((void *)0xBAADC0DE);
}


x86 assembly (clang, -O0):
<secondary_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   1030 <check_state@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltq
cmp    $0x989680,%rax
jge    115c <secondary_return+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <secondary_return+0x1d>
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x6,%edi
call   1030 <check_state@plt>
mov    $0xbaadc0de,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secondary_return>:
push   %rax
mov    $0x5,%edi
call   1040 <check_state@plt>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x98967f,%eax
jg     1150 <secondary_return+0x30>
xchg   %ax,%ax
addl   $0x1,0x4(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x989680,%eax
jl     1140 <secondary_return+0x20>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x6,%edi
call   1040 <check_state@plt>
mov    $0xbaadc0de,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Secondary return thread alive\0A\00"
define i8* @secondary_return(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @check_state(i32 5)
store volatile i32 0, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load volatile i32, i32* %3
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %8, 10000000
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load volatile i32, i32* %3
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %3
br label %6
13: ; preds = %6
%14 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @check_state(i32 6)
ret i8* inttoptr (i64 3131949278 to i8*)
}

LLVM IR (-O2):
@str = [30 x i8] c"Secondary return thread alive\00"
define i8* @secondary_return(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = tail call i32 @check_state(i32 5)
%4 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%5 = load volatile i32, i32* %2
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %12
7: ; preds = %1, %7
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, 1
store volatile i32 %9, i32* %2
%10 = load volatile i32, i32* %2
%11 = icmp slt i32 %10, 10000000
br i1 %11, label %7, label %12
12: ; preds = %7, %1
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @check_state(i32 6)
ret i8* inttoptr (i64 3131949278 to i8*)
}
/* Variables and functions */
int a(int);
int b(int);
int main() { return a(1) + b(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <a@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <b@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <a@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <b@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 1)
%2 = tail call i32 @b(i32 1)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read32be(void *buf) {
  uint8_t *p = buf;
  return p[3] | p[2] << 8 | p[1] << 16 | p[0] << 24;
}


x86 assembly (clang, -O0):
<read32be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32be>:
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0xc(%rdi),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @read32be(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = shl i32 %16, 16
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = shl i32 %21, 24
%23 = or i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @read32be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = getelementptr inbounds i8, i8* %0, i64 12
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32, i32* %2
%17 = shl i32 %16, 24
%18 = or i32 %15, %17
ret i32 %18
}
void gtk_stock_lookup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_stock_lookup() {
ret void
}
float VecSquaredLength3fv(const float v[3]) {
  return (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<VecSquaredLength3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSquaredLength3fv>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @VecSquaredLength3fv(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
ret float %23
}

LLVM IR (-O2):
define float @VecSquaredLength3fv(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("??=");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [4 x i8] c"??=\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"??=\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
void swap_ul(ulong *a, ulong *b) {
  ulong tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

LLVM IR (-O0):
define void @swap_ul(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 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_ul(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("clean up: %s\n", (char *)arg); }


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

x86 assembly (clang, -O2):
<cleanup>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"clean up: %s\0A\00"
define void @cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"clean up: %s\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
int ioctl(int, int /*<<< orphan*/, int *);
int cf_socket_bytes_to_read(int sd) {
  int bytes = 0;
  int result = -1;
  result = ioctl(sd, FIONREAD, &bytes);
  if (result) {
    return bytes;
  }
  return result;
}


x86 assembly (clang, -O0):
<cf_socket_bytes_to_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1156 <cf_socket_bytes_to_read+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <cf_socket_bytes_to_read+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_socket_bytes_to_read>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
test   %eax,%eax
je     1134 <cf_socket_bytes_to_read+0x24>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@FIONREAD = global i32 0
define i32 @cf_socket_bytes_to_read(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @FIONREAD
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ egetch();
int /*<<< orphan*/ move(int, int /*<<< orphan*/);
int /*<<< orphan*/ outs(char const *);
void presskeyfor(const char *msg, int x) {
  extern int showansi;
  showansi = 1;
  move(x, 0);
  clrtoeol();
  outs(msg);
  egetch();
  move(x, 0);
  clrtoeol();
}


x86 assembly (clang, -O0):
<presskeyfor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e8a(%rip),%rax
movl   $0x1,(%rax)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
mov    -0x8(%rbp),%rdi
call   1050 <outs@plt>
mov    $0x0,%al
call   1030 <egetch@plt>
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1060 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<presskeyfor>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2e90(%rip),%rax
movl   $0x1,(%rax)
mov    %esi,%edi
xor    %esi,%esi
call   1060 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
mov    %r14,%rdi
call   1050 <outs@plt>
xor    %eax,%eax
call   1030 <egetch@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1060 <move@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <clrtoeol@plt>

LLVM IR (-O0):
@showansi = external global i32
define void @presskeyfor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 1, i32* @showansi
%5 = load i32, i32* %4
%6 = call i32 @move(i32 %5, i32 0)
%7 = call i32 (...) @clrtoeol()
%8 = load i8*, i8** %3
%9 = call i32 @outs(i8* %8)
%10 = call i32 (...) @egetch()
%11 = load i32, i32* %4
%12 = call i32 @move(i32 %11, i32 0)
%13 = call i32 (...) @clrtoeol()
ret void
}

LLVM IR (-O2):
@showansi = external global i32
define void @presskeyfor(i8* %0, i32 %1) {
store i32 1, i32* @showansi
%3 = tail call i32 @move(i32 %1, i32 0)
%4 = tail call i32 (...) @clrtoeol()
%5 = tail call i32 @outs(i8* %0)
%6 = tail call i32 (...) @egetch()
%7 = tail call i32 @move(i32 %1, i32 0)
%8 = tail call i32 (...) @clrtoeol()
ret void
}
/* Variables and functions */
int write(int, void *, unsigned int);
int s_pipe_posix_write(int fd, void *buf, unsigned int count) {
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<s_pipe_posix_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_pipe_posix_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @s_pipe_posix_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @s_pipe_posix_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
unsigned long fibonacci(unsigned short n) {
  if (n == 0) {
    return 0;
  }
  if (n == 1) {
    return 1;
  }
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x0,%eax
jne    1139 <fibonacci+0x29>
movq   $0x0,-0x8(%rbp)
jmp    1183 <fibonacci+0x73>
movzwl -0xa(%rbp),%eax
cmp    $0x1,%eax
jne    1153 <fibonacci+0x43>
movq   $0x1,-0x8(%rbp)
jmp    1183 <fibonacci+0x73>
movzwl -0xa(%rbp),%eax
sub    $0x1,%eax
movzwl %ax,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sub    $0x2,%eax
movzwl %ax,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
test   %bx,%bx
je     113c <fibonacci+0x2c>
xchg   %ax,%ax
cmp    $0x1,%bx
je     1140 <fibonacci+0x30>
lea    -0x1(%rbx),%eax
movzwl %ax,%edi
call   1030 <fibonacci@plt>
add    %rax,%r14
add    $0xfffffffe,%ebx
test   %bx,%bx
jne    1120 <fibonacci+0x10>
xor    %eax,%eax
jmp    1145 <fibonacci+0x35>
mov    $0x1,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibonacci(i16 zeroext %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i64 [ 0, %1 ], [ %9, %5 ]
%4 = phi i16 [ %0, %1 ], [ %8, %5 ]
switch i16 %4, label %5 [
i16 0, label %10
i16 1, label %11
]
5: ; preds = %2
%6 = add i16 %4, -1
%7 = tail call i64 @fibonacci(i16 zeroext %6)
%8 = add i16 %4, -2
%9 = add i64 %7, %3
br label %2
10: ; preds = %2
br label %11
11: ; preds = %2, %10
%12 = phi i64 [ 0, %10 ], [ 1, %2 ]
%13 = add i64 %12, %3
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ umfpack_dl_symbolic(long, long, long *, long *, double *,
                                       void **, double *, double *);
void umf4sym(long *m, long *n, long Ap[], long Ai[], double Ax[],
             void **Symbolic, double Control[20], double Info[90]) {
  (void)umfpack_dl_symbolic(*m, *n, Ap, Ai, Ax, Symbolic, Control, Info);
}


x86 assembly (clang, -O0):
<umf4sym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <umfpack_dl_symbolic@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4sym>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <umfpack_dl_symbolic@plt>

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

LLVM IR (-O2):
define void @umf4sym(i64* nocapture %0, i64* nocapture %1, i64* %2, i64* %3, double* %4, i8** %5, double* %6, double* %7) {
%9 = load i64, i64* %0
%10 = load i64, i64* %1
%11 = tail call i32 @umfpack_dl_symbolic(i64 %9, i64 %10, i64* %2, i64* %3, double* %4, i8** %5, double* %6, double* %7)
ret void
}
/* Type definitions */
struct libinjection_sqli_state {
  int dummy;
};

/* Variables and functions */
size_t parse_qstring_core(struct libinjection_sqli_state *, int /*<<< orphan*/);
size_t parse_qstring(struct libinjection_sqli_state *sf) {
  return parse_qstring_core(sf, 0);
}


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

x86 assembly (clang, -O2):
<parse_qstring>:
xor    %esi,%esi
jmp    1030 <parse_qstring_core@plt>

LLVM IR (-O0):
%struct.libinjection_sqli_state = type { i32 }
define i64 @parse_qstring(%struct.libinjection_sqli_state* %0) {
%2 = alloca %struct.libinjection_sqli_state*
store %struct.libinjection_sqli_state* %0, %struct.libinjection_sqli_state** %2
%3 = load %struct.libinjection_sqli_state*, %struct.libinjection_sqli_state** %2
%4 = call i64 @parse_qstring_core(%struct.libinjection_sqli_state* %3, i32 0)
ret i64 %4
}

LLVM IR (-O2):
%struct.libinjection_sqli_state = type { i32 }
define i64 @parse_qstring(%struct.libinjection_sqli_state* %0) {
%2 = tail call i64 @parse_qstring_core(%struct.libinjection_sqli_state* %0, i32 0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ cc2420_set_tx_power(int);
void do_set_tx_power(int pow) { cc2420_set_tx_power(pow); }


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

x86 assembly (clang, -O2):
<do_set_tx_power>:
jmp    1030 <cc2420_set_tx_power@plt>

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

LLVM IR (-O2):
define void @do_set_tx_power(i32 %0) {
%2 = tail call i32 @cc2420_set_tx_power(i32 %0)
ret void
}
void set_tty() {}


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

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

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

LLVM IR (-O2):
define void @set_tty() {
ret void
}
int massive_case(int x) {
  switch (x) {
  case 1:
    return 1;
  case 2:
    return 2;
  case 10 ... 10000:
    return 3;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<massive_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     112c <massive_case+0x2c>
jmp    111b <massive_case+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1138 <massive_case+0x38>
jmp    1150 <massive_case+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1168 <massive_case+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <massive_case+0x68>
movl   $0x3,-0x4(%rbp)
jmp    1168 <massive_case+0x68>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
cmp    $0x2706,%eax
jbe    1144 <massive_case+0x44>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<massive_case>:
mov    %edi,%eax
cmp    $0x1,%edi
je     1122 <massive_case+0x22>
cmp    $0x2,%eax
jne    1112 <massive_case+0x12>
mov    $0x2,%eax
ret
add    $0xfffffff6,%eax
cmp    $0x2707,%eax
mov    $0x4,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @massive_case(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i32 1, i32* %2
br label %12
6: ; preds = %1
store i32 2, i32* %2
br label %12
7: ; preds = %8
store i32 3, i32* %2
br label %12
8: ; preds = %1
%9 = sub i32 %4, 10
%10 = icmp ule i32 %9, 9990
br i1 %10, label %7, label %11
11: ; preds = %8
store i32 4, i32* %2
br label %12
12: ; preds = %11, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @massive_case(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %7
i32 2, label %2
]
2: ; preds = %1
br label %7
3: ; preds = %1
%4 = add i32 %0, -10
%5 = icmp ult i32 %4, 9991
%6 = select i1 %5, i32 3, i32 4
br label %7
7: ; preds = %3, %1, %2
%8 = phi i32 [ 2, %2 ], [ %0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int y;
  assume(x < 0);
  assume(y > 0);
  assert((x ^ y) > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assume(i32 %6)
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assume(i32 %10)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = xor i32 %12, %13
%15 = icmp sgt i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
%2 = tail call i32 @assume(i32 0)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_rdev;
};
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
dev_t posix_stat_st_rdev(const struct stat *st) { return st->st_rdev; }


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_rdev(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_rdev(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_4Dint16_reg(short val) {
  return ((val) & (-0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffb3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Dint16_reg(i16 signext %0) {
%2 = and i16 %0, -77
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *strsignal(int);
void handler(int signal) {
  printf("Caught signal %d: %s\n", signal, strsignal(signal));
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strsignal@plt>
mov    -0x8(%rbp),%esi
mov    %rax,%rdx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
call   1040 <strsignal@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Caught signal %d: %s\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @strsignal(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Caught signal %d: %s\0A\00"
define void @handler(i32 %0) {
%2 = tail call i8* @strsignal(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ basic_test();
int /*<<< orphan*/ proj_tests();
int main(void) {
  basic_test();
  proj_tests();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1040 <proj_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @basic_test()
%3 = call i32 (...) @proj_tests()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_test()
%2 = tail call i32 (...) @proj_tests()
ret i32 0
}
void *xmalloc(unsigned int z) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x6a() {
  Assert_real((isdigit(106) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              535, ("isdigit should be 0 for j"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x6a>:
push   %rax
mov    $0x6a,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x217,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for j\00"
define void @t_isdigit_0x6a() {
%1 = tail call i64 @isdigit(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sin(double);
double f_of_x(double x) { return sin(x * x); }


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

x86 assembly (clang, -O2):
<f_of_x>:
mulsd  %xmm0,%xmm0
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @f_of_x(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @sin(double %2)
ret double %3
}