xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 1) {
    printf("Usage: meepmeep <in.txt>\n");
    exit(1);
  }
  printf("Meep meep!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1156 <main+0x36>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
test   %edi,%edi
jle    1135 <main+0x15>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: meepmeep <in.txt>\0A\00"
@.str.1 = [12 x i8] c"Meep meep!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Meep meep!\00"
@str.2 = [25 x i8] c"Usage: meepmeep <in.txt>\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_83uint32_mem(unsigned int *val) {
  return ((*val) & (0x83 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_83uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 131
%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_83uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 131
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double off_F(double x, double y, double z, double A, double B, double C,
             double D) {
  return (A * x + B * y + C * z + D);
}


x86 assembly (clang, -O0):
<off_F>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_F>:
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm6,%xmm0
ret

LLVM IR (-O0):
define double @off_F(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%15 = load double, double* %11
%16 = load double, double* %8
%17 = load double, double* %12
%18 = load double, double* %9
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = load double, double* %13
%22 = load double, double* %10
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %20)
%24 = load double, double* %14
%25 = fadd double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @off_F(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fmul double %1, %4
%9 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %9)
%11 = fadd double %10, %6
ret double %11
}
void interactive() {
  char s[255];
  printf("Enter text to rot13");
  scanf("%s", &s);
  char *p = &s;
  rotate_text(p);
  printf("Rotated text: %s\n", s);
}


x86 assembly (clang, -O0):
<interactive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
lea    -0x100(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
mov    $0x0,%al
call   1040 <rotate_text@plt>
lea    -0x100(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interactive>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <rotate_text@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter text to rot13\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"Rotated text: %s\0A\00"
define void @interactive() {
%1 = alloca [255 x i8]
%2 = alloca i8*
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [255 x i8]* %1)
%5 = bitcast [255 x i8]* %1 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @rotate_text to i32 (i8*, ...)*)(i8* %6)
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter text to rot13\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"Rotated text: %s\0A\00"
define void @interactive() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [255 x i8]* %1)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @rotate_text to i32 (i8*, ...)*)(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat4d_copy(double *, double const *);
int /*<<< orphan*/ mat4d_transpose(double *);
void mat4d_transpose_new(double dest[16], const double src[16]) {
  mat4d_copy(dest, src);
  mat4d_transpose(dest);
}


x86 assembly (clang, -O0):
<mat4d_transpose_new>:
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   1040 <mat4d_copy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <mat4d_transpose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_transpose_new>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mat4d_copy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mat4d_transpose@plt>

LLVM IR (-O0):
define void @mat4d_transpose_new(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call i32 @mat4d_copy(double* %5, double* %6)
%8 = load double*, double** %3
%9 = call i32 @mat4d_transpose(double* %8)
ret void
}

LLVM IR (-O2):
define void @mat4d_transpose_new(double* %0, double* %1) {
%3 = tail call i32 @mat4d_copy(double* %0, double* %1)
%4 = tail call i32 @mat4d_transpose(double* %0)
ret void
}
void myvm_vref(int val, struct myvm_vm *vm) {}


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

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

LLVM IR (-O0):
%struct.myvm_vm = type opaque
define void @myvm_vref(i32 %0, %struct.myvm_vm* %1) {
%3 = alloca i32
%4 = alloca %struct.myvm_vm*
store i32 %0, i32* %3
store %struct.myvm_vm* %1, %struct.myvm_vm** %4
ret void
}

LLVM IR (-O2):
%struct.myvm_vm = type opaque
define void @myvm_vref(i32 %0, %struct.myvm_vm* nocapture %1) {
ret void
}
/* Variables and functions */
int log(double);
int scaledLog(double val) { return ((int)((1000 * log(val)) + 0.5)); }


x86 assembly (clang, -O0):
<scaledLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
imul   $0x3e8,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaledLog>:
push   %rax
call   1030 <log@plt>
imul   $0x3e8,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xed5(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @scaledLog(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log(double %3)
%5 = mul nsw i32 1000, %4
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @scaledLog(double %0) {
%2 = tail call i32 @log(double %0)
%3 = mul nsw i32 %2, 1000
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}
char directory_getcurrent() {
  char *buf = malloc(256);
  getcwd(buf, 256);
  return buf;
}


x86 assembly (clang, -O0):
<directory_getcurrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x100,%esi
mov    $0x0,%al
call   1030 <getcwd@plt>
mov    -0x8(%rbp),%rax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_getcurrent>:
push   %rbx
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1030 <getcwd@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @directory_getcurrent() {
%1 = alloca i8*
%2 = call i8* @malloc(i64 256)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @getcwd to i32 (i8*, i32, ...)*)(i8* %3, i32 256)
%5 = load i8*, i8** %1
%6 = ptrtoint i8* %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @directory_getcurrent() {
%1 = tail call dereferenceable_or_null(256) i8* @malloc(i64 256)
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @getcwd to i32 (i8*, i32, ...)*)(i8* %1, i32 256)
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int *get_symbolic();
void test_index_below_symboloc() {
  int *buf = get_symbolic();
  buf[-1] = 0;
}


x86 assembly (clang, -O0):
<test_index_below_symboloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_symbolic@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,-0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_index_below_symboloc>:
push   %rax
xor    %eax,%eax
call   1030 <get_symbolic@plt>
movl   $0x0,-0x4(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test_index_below_symboloc() {
%1 = alloca i32*
%2 = call i32* (...) @get_symbolic()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 -1
store i32 0, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_index_below_symboloc() {
%1 = tail call i32* (...) @get_symbolic()
%2 = getelementptr inbounds i32, i32* %1, i64 -1
store i32 0, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void c_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<c_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @c_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void compute_seismograms_cuda_(long *Mesh_pointer_f, int *seismotypef,
                               double *sisux, double *sisuz,
                               int *seismo_currentf,
                               int *NSTEP_BETWEEN_OUTPUT_SEISMOSf,
                               int *ELASTIC_SIMULATION,
                               int *ACOUSTIC_SIMULATION,
                               int *USE_TRICK_FOR_BETTER_PRESSURE) {}


x86 assembly (clang, -O0):
<compute_seismograms_cuda_>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%rax
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)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @compute_seismograms_cuda_(i64* %0, i32* %1, double* %2, double* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8) {
%10 = alloca i64*
%11 = alloca i32*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
store i64* %0, i64** %10
store i32* %1, i32** %11
store double* %2, double** %12
store double* %3, double** %13
store i32* %4, i32** %14
store i32* %5, i32** %15
store i32* %6, i32** %16
store i32* %7, i32** %17
store i32* %8, i32** %18
ret void
}

LLVM IR (-O2):
define void @compute_seismograms_cuda_(i64* nocapture %0, i32* nocapture %1, double* nocapture %2, double* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6, i32* nocapture %7, i32* nocapture %8) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void global_deinit() { fprintf(stderr, "Running Global Init\n"); }


x86 assembly (clang, -O0):
<global_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_deinit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Running Global Init\0A\00"
define void @global_deinit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Running Global Init\0A\00"
define void @global_deinit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int do_473() { return 473; }


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

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

LLVM IR (-O0):
define i32 @do_473() {
ret i32 473
}

LLVM IR (-O2):
define i32 @do_473() {
ret i32 473
}
/* Variables and functions */
int __cxa_atexit(void (*)(void *), void *, void *);
int __aeabi_atexit(void *arg, void (*func)(void *), void *d) {
  return __cxa_atexit(func, arg, d);
}


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

x86 assembly (clang, -O2):
<__aeabi_atexit>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <__cxa_atexit@plt>

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

LLVM IR (-O2):
define i32 @__aeabi_atexit(i8* %0, void (i8*)* %1, i8* %2) {
%4 = tail call i32 @__cxa_atexit(void (i8*)* %1, i8* %0, i8* %2)
ret i32 %4
}
int DUMMY_Done(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @DUMMY_Done() {
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int FD_ISSET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
int stdin_ready() {
  struct timeval tv;
  fd_set fds;
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  FD_ZERO(&fds);
  FD_SET(0, &fds);
  select(1, &fds, NULL, NULL, &tv);
  return FD_ISSET(0, &fds);
}


x86 assembly (clang, -O0):
<stdin_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1060 <FD_SET@plt>
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rdx
call   1050 <select@plt>
xor    %edi,%edi
lea    -0x14(%rbp),%rsi
call   1030 <FD_ISSET@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdin_ready>:
push   %rbx
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <FD_SET@plt>
lea    0x10(%rsp),%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <select@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <FD_ISSET@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @stdin_ready() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
store i64 0, i64* %4
%5 = call i32 @FD_ZERO(i32* %2)
%6 = call i32 @FD_SET(i32 0, i32* %2)
%7 = call i32 @select(i32 1, i32* %2, i32* null, i32* null, %struct.timeval* %1)
%8 = call i32 @FD_ISSET(i32 0, i32* %2)
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @stdin_ready() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.timeval* %1 to i8*
%6 = call i32 @FD_ZERO(i32* %2)
%7 = call i32 @FD_SET(i32 0, i32* %2)
%8 = call i32 @select(i32 1, i32* %2, i32* null, i32* null, %struct.timeval* %1)
%9 = call i32 @FD_ISSET(i32 0, i32* %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char *, char *, unsigned int, char *);
void f1(void) {
  int x;
  int *p;
  int *__cil_tmp3;
  unsigned int __cil_tmp4;
  unsigned int __cil_tmp5;
  {
    p = &x;
    {
      __cil_tmp3 = (int *)0;
      __cil_tmp4 = (unsigned int)__cil_tmp3;
      __cil_tmp5 = (unsigned int)p;
      if (__cil_tmp5 != __cil_tmp4) {
      } else {
        __assert_fail("p != 0", "blast_array_1.c", 9U, "f1");
      }
    }
    return;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1147 <f1+0x37>
jmp    1166 <f1+0x56>
lea    0xeb2(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x9,%edx
lea    0xeb6(%rip),%rcx
call   1030 <__assert_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
lea    0x4(%rsp),%rax
test   %eax,%eax
je     111c <f1+0xc>
pop    %rax
ret
lea    0xedd(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xee6(%rip),%rcx
mov    $0x9,%edx
call   1030 <__assert_fail@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"p != 0\00"
@.str.1 = [16 x i8] c"blast_array_1.c\00"
@.str.2 = [3 x i8] c"f1\00"
define void @f1() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %1, i32** %2
store i32* null, i32** %3
%6 = load i32*, i32** %3
%7 = ptrtoint i32* %6 to i32
store i32 %7, i32* %4
%8 = load i32*, i32** %2
%9 = ptrtoint i32* %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %0
br label %16
14: ; preds = %0
%15 = call i32 @__assert_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %13
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"p != 0\00"
@.str.1 = [16 x i8] c"blast_array_1.c\00"
@.str.2 = [3 x i8] c"f1\00"
define void @f1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @__assert_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
ret void
}
double limit(double a) { return a < -1 ? -1 : (a > 1 ? 1 : a); }


x86 assembly (clang, -O0):
<limit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112e <limit+0x2e>
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116b <limit+0x6b>
movsd  -0x8(%rbp),%xmm0
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1157 <limit+0x57>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1161 <limit+0x61>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
cmpltsd %xmm2,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm1,%xmm3
andpd  %xmm2,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @limit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, -1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @limit(double %0) {
%2 = fcmp olt double %0, -1.000000e+00
%3 = fcmp ogt double %0, 1.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
int math_min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<math_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <math_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <math_min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @math_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int z() { z(); }


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

x86 assembly (clang, -O2):
<z>:
jmp    1100 <z>

LLVM IR (-O0):
define i32 @z() {
%1 = alloca i32
%2 = call i32 @z()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @z() {
br label %1
1: ; preds = %1, %0
br label %1
}
void gdk_display_get_event() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *msg) {
  fprintf(stderr, "[SHIM] Fatal error: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"[SHIM] Fatal error: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"[SHIM] Fatal error: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ AES128EncryptOneBlockStdcall(int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *);
void Spartan_cipher(uint8_t *out, uint8_t *in, uint8_t *w, uint8_t *sb) {
  AES128EncryptOneBlockStdcall(out, in, w, sb);
}


x86 assembly (clang, -O0):
<Spartan_cipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <AES128EncryptOneBlockStdcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spartan_cipher>:
jmp    1030 <AES128EncryptOneBlockStdcall@plt>

LLVM IR (-O0):
define void @Spartan_cipher(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @AES128EncryptOneBlockStdcall(i32* %9, i32* %10, i32* %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @Spartan_cipher(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @AES128EncryptOneBlockStdcall(i32* %0, i32* %1, i32* %2, i32* %3)
ret void
}
int PILI_RTMP_LibVersion() { return 0x020300; }


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

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

LLVM IR (-O0):
define i32 @PILI_RTMP_LibVersion() {
ret i32 131840
}

LLVM IR (-O2):
define i32 @PILI_RTMP_LibVersion() {
ret i32 131840
}
double radius(double x, double y) { return sqrt(((x) * (x)) + ((y) * (y))); }


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

x86 assembly (clang, -O2):
<radius>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <radius+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @radius(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @radius(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
double glb_prior(double x, double center, double sigma) {
  double tmp = (x - center) / sigma;
  return tmp * tmp;
}


x86 assembly (clang, -O0):
<glb_prior>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glb_prior>:
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @glb_prior(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = fdiv double %10, %11
store double %12, double* %7
%13 = load double, double* %7
%14 = load double, double* %7
%15 = fmul double %13, %14
ret double %15
}

LLVM IR (-O2):
define double @glb_prior(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fdiv double %4, %2
%6 = fmul double %5, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ vga_entry(char, int /*<<< orphan*/);
void putchar(char c, uint8_t color, unsigned int row, unsigned int column) {
  uint16_t *vidmem = (uint16_t *)0xB8000;
  unsigned int offset = row * 80 + column;
  vidmem[offset] = vga_entry(c, color);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
imul   $0x50,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movsbl %al,%edi
call   1030 <vga_entry@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
lea    (%rdx,%rdx,4),%ebx
shl    $0x4,%ebx
add    %ecx,%ebx
call   1030 <vga_entry@plt>
mov    %eax,0xb8000(,%rbx,4)
pop    %rbx
ret

LLVM IR (-O0):
define void @putchar(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32* inttoptr (i64 753664 to i32*), i32** %9
%11 = load i32, i32* %7
%12 = mul i32 %11, 80
%13 = load i32, i32* %8
%14 = add i32 %12, %13
store i32 %14, i32* %10
%15 = load i8, i8* %5
%16 = load i32, i32* %6
%17 = call i32 @vga_entry(i8 signext %15, i32 %16)
%18 = load i32*, i32** %9
%19 = load i32, i32* %10
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %2, 80
%6 = add i32 %5, %3
%7 = tail call i32 @vga_entry(i8 signext %0, i32 %1)
%8 = zext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* inttoptr (i64 753664 to i32*), i64 %8
store i32 %7, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _response(char const *);
void _stat_fail_450(void) {
  const char msg[] = "450 File operation failed.\r\n";
  _response(msg);
}


x86 assembly (clang, -O0):
<_stat_fail_450>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed4(%rip),%al
mov    %al,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <_response@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_fail_450>:
sub    $0x28,%rsp
movups 0xef2(%rip),%xmm0
movups %xmm0,0xd(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <_response@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const._stat_fail_450.msg = [29 x i8] c"450 File operation failed.\0D\0A\00"
define void @_stat_fail_450() {
%1 = alloca [29 x i8]
%2 = bitcast [29 x i8]* %1 to i8*
%3 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%4 = call i32 @_response(i8* %3)
ret void
}

LLVM IR (-O2):
@__const._stat_fail_450.msg = [29 x i8] c"450 File operation failed.\0D\0A\00"
define void @_stat_fail_450() {
%1 = alloca [29 x i8]
%2 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%3 = call i32 @_response(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_comige_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float *);
int determ_ge_float(uint32_t a, uint32_t b) {
  return !!_mm_comige_ss(_mm_load_ss((float *)&a), _mm_load_ss((float *)&b));
}


x86 assembly (clang, -O0):
<determ_ge_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <_mm_load_ss@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_comige_ss@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_ge_float>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_comige_ss@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @determ_ge_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = bitcast i32* %3 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = bitcast i32* %4 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = call i32 @_mm_comige_ss(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @determ_ge_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = bitcast i32* %3 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = bitcast i32* %4 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = call i32 @_mm_comige_ss(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
struct inode *igrab(struct inode *);
struct inode *vn_grab(struct inode *vp) {
  return igrab(vp);
}


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

x86 assembly (clang, -O2):
<vn_grab>:
jmp    1030 <igrab@plt>

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

LLVM IR (-O2):
%struct.inode = type { i32 }
define %struct.inode* @vn_grab(%struct.inode* %0) {
%2 = tail call %struct.inode* @igrab(%struct.inode* %0)
ret %struct.inode* %2
}
double to_mV(int a) { return a * 0.291748046875; }


x86 assembly (clang, -O0):
<to_mV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_mV>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @to_mV(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3FD2AC0000000000
ret double %5
}

LLVM IR (-O2):
define double @to_mV(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3FD2AC0000000000
ret double %3
}
int foo11(int c) {
  __attribute__((used)) static int local1, local2;
  local1 = 0;
  local2 += c;
  local1 = 2;
  local2++;
  return local1 + local2;
}


x86 assembly (clang, -O0):
<foo11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,0x2f13(%rip)
mov    -0x4(%rbp),%eax
add    0x2f0e(%rip),%eax
mov    %eax,0x2f08(%rip)
movl   $0x2,0x2efa(%rip)
mov    0x2ef8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eef(%rip)
mov    0x2ee5(%rip),%eax
add    0x2ee3(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo11>:
mov    0x2f22(%rip),%eax
movl   $0x2,0x2f14(%rip)
lea    (%rax,%rdi,1),%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0c(%rip)
add    %edi,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
@foo11.local1 = internal global i32 0
@foo11.local2 = internal global i32 0
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (i32* @foo11.local1 to i8*), i8* bitcast (i32* @foo11.local2 to i8*)], section "llvm.metadata"
define i32 @foo11(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* @foo11.local1
%3 = load i32, i32* %2
%4 = load i32, i32* @foo11.local2
%5 = add nsw i32 %4, %3
store i32 %5, i32* @foo11.local2
store i32 2, i32* @foo11.local1
%6 = load i32, i32* @foo11.local2
%7 = add nsw i32 %6, 1
store i32 %7, i32* @foo11.local2
%8 = load i32, i32* @foo11.local1
%9 = load i32, i32* @foo11.local2
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@foo11.local1 = internal global i32 0
@foo11.local2 = internal global i32 0
@llvm.compiler.used = appending global [2 x i8*] [i8* bitcast (i32* @foo11.local1 to i8*), i8* bitcast (i32* @foo11.local2 to i8*)], section "llvm.metadata"
define i32 @foo11(i32 %0) {
%2 = load i32, i32* @foo11.local2
%3 = add nsw i32 %2, %0
store i32 2, i32* @foo11.local1
%4 = add nsw i32 %3, 1
store i32 %4, i32* @foo11.local2
%5 = add nsw i32 %3, 3
ret i32 %5
}
/* Variables and functions */
char *__qunit_print_header(char *);
int /*<<< orphan*/ printf(char *, char *);
void qunit_print_header(void) {
  char outbuff[(1024 * 8)];
  printf("%s", __qunit_print_header(outbuff));
}


x86 assembly (clang, -O0):
<qunit_print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2000,%rsp
lea    -0x2000(%rbp),%rdi
call   1040 <__qunit_print_header@plt>
mov    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x2000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qunit_print_header>:
sub    $0x2008,%rsp
mov    %rsp,%rdi
call   1040 <__qunit_print_header@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x2008,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @qunit_print_header() {
%1 = alloca [8192 x i8]
%2 = getelementptr inbounds [8192 x i8], [8192 x i8]* %1, i64 0, i64 0
%3 = call i8* @__qunit_print_header(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void *test_anti_range_68(unsigned long n) {
  extern void *alloc_anti_range_68(unsigned long)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 12)
    n = 0 - 1;
  return alloc_anti_range_68(n);
}


x86 assembly (clang, -O0):
<test_anti_range_68>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
ja     113b <test_anti_range_68+0x2b>
cmpq   $0xc,-0x8(%rbp)
ja     113b <test_anti_range_68+0x2b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_68@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_68>:
cmp    $0xd,%rdi
mov    $0xffffffffffffffff,%rax
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_68@plt>

LLVM IR (-O0):
define i8* @test_anti_range_68(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ule i64 0, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp ule i64 %6, 12
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -1, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_68(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_68(i64 %0) {
%2 = icmp ult i64 %0, 13
%3 = select i1 %2, i64 -1, i64 %0
%4 = tail call i8* @alloc_anti_range_68(i64 %3)
ret i8* %4
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwhline_set(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwhline_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwhline_set+0x2a>
jmp    1170 <cmd_mvwhline_set+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwhline_set>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwhline_set+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwhline_set(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int IDLwrap() { return 1; }


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

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

LLVM IR (-O0):
define i32 @IDLwrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @IDLwrap() {
ret i32 1
}
/* Variables and functions */
char *strerror(int);
char *_glp_xstrerr(int errnum) { return strerror(errnum); }


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

x86 assembly (clang, -O2):
<_glp_xstrerr>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @_glp_xstrerr(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
char *ft_strcpy(char *dest, char *src) {
  char *tmp;
  tmp = dest;
  while ((*tmp++ = *src++))
    ;
  return (dest);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <ft_strcpy+0x43>
jmp    1114 <ft_strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}