xunge/DecIR huggingface dataset:
/* Type definitions */
struct SPort {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SerialFlush(struct SPort *);
void SerialWait(struct SPort *sp) { SerialFlush(sp); }


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

x86 assembly (clang, -O2):
<SerialWait>:
jmp    1030 <SerialFlush@plt>

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

LLVM IR (-O2):
%struct.SPort = type { i32 }
define void @SerialWait(%struct.SPort* %0) {
%2 = tail call i32 @SerialFlush(%struct.SPort* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t len) {
  void *new = realloc(p, len);
  if (!new)
    die("realloc() failed (len=%d)\n", len);
  return new;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115c <xrealloc+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"realloc() failed (len=%d)\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ maxHeapify(int *, int, int);
void buidMaxHeap(int A[], int n) {
  int i;
  for (i = n / 2; i > 0; i--) {
    maxHeapify(A, n, i);
  }
}


x86 assembly (clang, -O0):
<buidMaxHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1154 <buidMaxHeap+0x44>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <buidMaxHeap+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buidMaxHeap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1146 <buidMaxHeap+0x36>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <maxHeapify@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <buidMaxHeap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @buidMaxHeap(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* %4
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @maxHeapify(i32* %12, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @buidMaxHeap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @maxHeapify(i32* %0, i32 %1, i32 %7)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int pci_disable_pcie_error_reporting(struct pci_dev *dev) { return -EINVAL; }


x86 assembly (clang, -O0):
<pci_disable_pcie_error_reporting>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_disable_pcie_error_reporting(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
@EINVAL = global i32 0
define i32 @pci_disable_pcie_error_reporting(%struct.pci_dev* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void *d2cp(void *key) {
  double *newkey = malloc(sizeof(double) * 2);
  newkey[0] = ((double *)key)[0];
  newkey[1] = ((double *)key)[1];
  return newkey;
}


x86 assembly (clang, -O0):
<d2cp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2cp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x10,%edi
call   1030 <malloc@plt>
movups (%rbx),%xmm0
movups %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @d2cp(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = call i8* @malloc(i64 16)
%5 = bitcast i8* %4 to double*
store double* %5, double** %3
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to double*
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load i8*, i8** %2
%13 = bitcast i8* %12 to double*
%14 = getelementptr inbounds double, double* %13, i64 1
%15 = load double, double* %14
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 1
store double %15, double* %17
%18 = load double*, double** %3
%19 = bitcast double* %18 to i8*
ret i8* %19
}

LLVM IR (-O2):
define noalias i8* @d2cp(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(16) i8* @malloc(i64 16)
%3 = bitcast i8* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast i8* %2 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t const);
void explicit_bzero(void *s, const size_t n) { memset(s, 0, n); }


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

x86 assembly (clang, -O2):
<explicit_bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
void hal_io_int_disable() {
  __asm__ __volatile__("cli\n");
  return;
}


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

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

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

LLVM IR (-O2):
define void @hal_io_int_disable() {
tail call void asm sideeffect "cli\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_close_fd();
void test_close(void) { test_close_fd(); }


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

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

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

LLVM IR (-O2):
define void @test_close() {
%1 = tail call i32 (...) @test_close_fd()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff(int);
int /*<<< orphan*/ may_call_free(void *);
void test(void *ptr) {
  do_stuff(1);
  may_call_free(ptr);
  do_stuff(2);
  may_call_free(ptr);
  do_stuff(3);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <do_stuff@plt>
mov    -0x8(%rbp),%rdi
call   1030 <may_call_free@plt>
mov    $0x2,%edi
call   1040 <do_stuff@plt>
mov    -0x8(%rbp),%rdi
call   1030 <may_call_free@plt>
mov    $0x3,%edi
call   1040 <do_stuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <do_stuff@plt>
mov    %rbx,%rdi
call   1030 <may_call_free@plt>
mov    $0x2,%edi
call   1040 <do_stuff@plt>
mov    %rbx,%rdi
call   1030 <may_call_free@plt>
mov    $0x3,%edi
pop    %rbx
jmp    1040 <do_stuff@plt>

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

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = tail call i32 @do_stuff(i32 1)
%3 = tail call i32 @may_call_free(i8* %0)
%4 = tail call i32 @do_stuff(i32 2)
%5 = tail call i32 @may_call_free(i8* %0)
%6 = tail call i32 @do_stuff(i32 3)
ret void
}
void caller_1_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_2_2_1_2_1() {
ret void
}
/* Variables and functions */
double sqrt(double);
double judge(double x1, double y1, double z1, double x2, double y2, double z2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) +
              (z1 - z2) * (z1 - z2));
}


x86 assembly (clang, -O0):
<judge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
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  -0x8(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<judge>:
subsd  %xmm3,%xmm0
subsd  %xmm4,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm5,%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1142 <judge+0x32>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
ret
movapd %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @judge(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = fsub double %13, %14
%16 = load double, double* %7
%17 = load double, double* %10
%18 = fsub double %16, %17
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fsub double %19, %20
%22 = load double, double* %8
%23 = load double, double* %11
%24 = fsub double %22, %23
%25 = fmul double %21, %24
%26 = call double @llvm.fmuladd.f64(double %15, double %18, double %25)
%27 = load double, double* %9
%28 = load double, double* %12
%29 = fsub double %27, %28
%30 = load double, double* %9
%31 = load double, double* %12
%32 = fsub double %30, %31
%33 = call double @llvm.fmuladd.f64(double %29, double %32, double %26)
%34 = call double @sqrt(double %33)
ret double %34
}

LLVM IR (-O2):
define double @judge(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fsub double %0, %3
%8 = fsub double %1, %4
%9 = fmul double %8, %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %7, double %9)
%11 = fsub double %2, %5
%12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %10)
%13 = tail call double @sqrt(double %12)
ret double %13
}
void g_markup_escape_text() {}


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

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

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

LLVM IR (-O2):
define void @g_markup_escape_text() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_draw_pixel(int, int, int);
void lcd_clear_screen(int color) {
  int i, j;
  for (i = 0; i < (479 + 1); i++)
    for (j = 0; j < (799 + 1); j++) {
      lcd_draw_pixel(i, j, color);
    }
  return;
}


x86 assembly (clang, -O0):
<lcd_clear_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e0,-0x8(%rbp)
jge    1172 <lcd_clear_screen+0x62>
movl   $0x0,-0xc(%rbp)
cmpl   $0x320,-0xc(%rbp)
jge    115f <lcd_clear_screen+0x4f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1030 <lcd_draw_pixel@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <lcd_clear_screen+0x26>
jmp    1164 <lcd_clear_screen+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <lcd_clear_screen+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_clear_screen>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <lcd_draw_pixel@plt>
add    $0x1,%ebx
cmp    $0x320,%ebx
jne    1130 <lcd_clear_screen+0x20>
add    $0x1,%ebp
cmp    $0x1e0,%ebp
jne    1120 <lcd_clear_screen+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lcd_clear_screen(i32 %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i32 [ 0, %1 ], [ %10, %9 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %7, %4 ]
%6 = tail call i32 @lcd_draw_pixel(i32 %3, i32 %5, i32 %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 800
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 480
br i1 %11, label %12, label %2
12: ; preds = %9
ret void
}
/* Variables and functions */
int *malloc(int);
int **createMemory() {
  int **ptr;
  for (int i = 0; i < 4; i++) {
    ptr[i] = malloc(sizeof(int) * 4);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<createMemory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1150 <createMemory+0x40>
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <createMemory+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32** @createMemory() {
%1 = alloca i32**
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 4
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i32* @malloc(i32 16)
%8 = load i32**, i32*** %1
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32*, i32** %8, i64 %10
store i32* %7, i32** %11
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = load i32**, i32*** %1
ret i32** %16
}

LLVM IR (-O2):
void coda_sysctl_clean(void) {}


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

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

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

LLVM IR (-O2):
define void @coda_sysctl_clean() {
ret void
}
/* Variables and functions */
scalar_t__ toint32(double);
unsigned int touint32(double d) { return (unsigned int)toint32(d); }


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

x86 assembly (clang, -O2):
<touint32>:
jmp    1030 <toint32@plt>

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

LLVM IR (-O2):
define i32 @touint32(double %0) {
%2 = tail call i64 @toint32(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *__fconv(int /*<<< orphan*/);
int /*<<< orphan*/ concat(char *, char const *, char const *);
__attribute__((unused)) char *fconcat(char *catbuff, const char *a,
                                      const char *b) {
  return __fconv(concat(catbuff, a, b));
}


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

x86 assembly (clang, -O2):
<fconcat>:
push   %rax
call   1030 <concat@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <__fconv@plt>

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

LLVM IR (-O2):
define i8* @fconcat(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @concat(i8* %0, i8* %1, i8* %2)
%5 = tail call i8* @__fconv(i32 %4)
ret i8* %5
}
/* Variables and functions */
int round(int);
int makeGuess(int low, int high) { return round((low + high) / 2); }


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

x86 assembly (clang, -O2):
<makeGuess>:
add    %esi,%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %eax,%edi
sar    %edi
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @makeGuess(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sdiv i32 %7, 2
%9 = call i32 @round(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @makeGuess(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sdiv i32 %3, 2
%5 = tail call i32 @round(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execSysCall(int, int, char *, int);
void putChar(char c) { execSysCall(0x04, 1, &c, 1); }


x86 assembly (clang, -O0):
<putChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4,%edi
mov    $0x1,%ecx
lea    -0x1(%rbp),%rdx
mov    %ecx,%esi
call   1030 <execSysCall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putChar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x1,%ecx
call   1030 <execSysCall@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @execSysCall(i32 4, i32 1, i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @putChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @execSysCall(i32 4, i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int print_title(char *version) {
  printf("\n"
         "    _____      _____\n"
         "   / __\\ \\ /\\ / / __|\n"
         "   \\__ \\\\ V  V /\\__ \\\n"
         "   |___/ \\_/\\_/ |___/\n"
         "                     @author Eric Buss\n"
         "                     @version %s\n"
         "\n"
         "  A Simple Web Server. Developed as part of the University of "
         "Victoria's CSC\n"
         "  361 Computer Networks course.\n\n",
         version);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<print_title>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [272 x i8] c"\0A _____ _____\0A / __\\ \\ /\\ / / __|\0A \\__ \\\\ V V /\\__ \\\0A |___/ \\_/\\_/ |___/\0A @author Eric Buss\0A @version %s\0A\0A A Simple Web Server. Developed as part of the University of Victoria's CSC\0A 361 Computer Networks course.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_title(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [272 x i8] c"\0A _____ _____\0A / __\\ \\ /\\ / / __|\0A \\__ \\\\ V V /\\__ \\\0A |___/ \\_/\\_/ |___/\0A @author Eric Buss\0A @version %s\0A\0A A Simple Web Server. Developed as part of the University of Victoria's CSC\0A 361 Computer Networks course.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_title(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int);
void init_filename_generator(void) { srandom(1); }


x86 assembly (clang, -O0):
<init_filename_generator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_filename_generator>:
mov    $0x1,%edi
jmp    1030 <srandom@plt>

LLVM IR (-O0):
define void @init_filename_generator() {
%1 = call i32 @srandom(i32 1)
ret void
}

LLVM IR (-O2):
define void @init_filename_generator() {
%1 = tail call i32 @srandom(i32 1)
ret void
}
unsigned short mus_big_endian_unsigned_short(unsigned char *inp) {
  unsigned short o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  return (o);
}


x86 assembly (clang, -O0):
<mus_big_endian_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_big_endian_unsigned_short>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @mus_big_endian_unsigned_short(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i16* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @mus_big_endian_unsigned_short(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %2 to i16
%8 = or i16 %6, %7
ret i16 %8
}
/* Variables and functions */
int coord2diagrl(size_t x, size_t y) { return 8 - 1 - (x - y); }


x86 assembly (clang, -O0):
<coord2diagrl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
sub    -0x10(%rbp),%rcx
mov    $0x7,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<coord2diagrl>:
sub    %edi,%esi
lea    0x7(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @coord2diagrl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %5, %6
%8 = sub i64 7, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @coord2diagrl(i64 %0, i64 %1) {
%3 = sub i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 7
ret i32 %5
}
/* Variables and functions */
int strcspn(char *, char const *);
char *split(char *str, const char *spl) {
  char *pos = str + strcspn(str, spl);
  if (*pos == '\0')
    return NULL;
  *pos = '\0';
  return pos + 1;
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcspn@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1162 <split+0x52>
movq   $0x0,-0x8(%rbp)
jmp    1175 <split+0x65>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcspn@plt>
cltq
cmpb   $0x0,(%rbx,%rax,1)
je     112d <split+0x1d>
add    %rax,%rbx
movb   $0x0,(%rbx)
add    $0x1,%rbx
jmp    112f <split+0x1f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @split(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strcspn(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
store i8 0, i8* %5
%9 = getelementptr inbounds i8, i8* %5, i64 1
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %9, %8 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
int const rand();
int random_int(const int min, const int max) {
  return rand() % (max - min) + min;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void main() {
  char *video_memory = (char *)0xb8000;
  *video_memory = 'Kernel Running';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x67,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x67,0xb8000
67
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
store i8* inttoptr (i64 753664 to i8*), i8** %1
%2 = load i8*, i8** %1
store i8 103, i8* %2
ret void
}

LLVM IR (-O2):
define void @main() {
store i8 103, i8* inttoptr (i64 753664 to i8*)
ret void
}
int IsBlank(char C) { return (C == ' ' || C == '\t'); }


x86 assembly (clang, -O0):
<IsBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <IsBlank+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBlank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsBlank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsBlank(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void scalar_butterfly_with_negated_b(float a[restrict 1], float b[restrict 1]) {
  const float new_a = *a - *b;
  const float new_b = *a + *b;
  *a = new_a;
  *b = new_b;
}


x86 assembly (clang, -O0):
<scalar_butterfly_with_negated_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar_butterfly_with_negated_b>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
addss  %xmm1,%xmm0
movss  %xmm2,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @scalar_butterfly_with_negated_b(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
%6 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%7 = load float*, float** %3
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = fsub float %8, %10
store float %11, float* %5
%12 = load float*, float** %3
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = load float, float* %14
%16 = fadd float %13, %15
store float %16, float* %6
%17 = load float, float* %5
%18 = load float*, float** %3
store float %17, float* %18
%19 = load float, float* %6
%20 = load float*, float** %4
store float %19, float* %20
ret void
}

LLVM IR (-O2):
define void @scalar_butterfly_with_negated_b(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fsub float %3, %4
%6 = fadd float %3, %4
store float %5, float* %0
store float %6, float* %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void put_uint32_le(unsigned char *ptr, uint32_t data) {
  ptr[0] = data & 0xff;
  ptr[1] = (data >> 8) & 0xff;
  ptr[2] = (data >> 16) & 0xff;
  ptr[3] = (data >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_uint32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_uint32_le>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @put_uint32_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put_uint32_le(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
char *get_token(char const *, char *, char *, int);
int get_type(const char *line, int index) {
  const char *head;
  const char *type;
  head = get_token(line, ";", ";\n", index);
  type = get_token(head, ":", "", 2);
  return type[0] - '0';
}


x86 assembly (clang, -O0):
<get_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rsi
lea    0xece(%rip),%rdx
call   1030 <get_token@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xebd(%rip),%rsi
lea    0xeb5(%rip),%rdx
mov    $0x2,%ecx
call   1030 <get_token@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_type>:
push   %rax
mov    %esi,%ecx
lea    0xee6(%rip),%rsi
lea    0xee1(%rip),%rdx
call   1030 <get_token@plt>
lea    0xed8(%rip),%rsi
lea    0xed0(%rip),%rdx
mov    %rax,%rdi
mov    $0x2,%ecx
call   1030 <get_token@plt>
movsbl (%rax),%eax
add    $0xffffffd0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
@.str.1 = [3 x i8] c";\0A\00"
@.str.2 = [2 x i8] c":\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @get_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @get_token(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i8* @get_token(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 2)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
@.str.1 = [3 x i8] c";\0A\00"
@.str.2 = [2 x i8] c":\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @get_type(i8* %0, i32 %1) {
%3 = tail call i8* @get_token(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%4 = tail call i8* @get_token(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, -48
ret i32 %7
}
char const *skip_ws(char const *c) {
  while (*c == ' ' || *c == '\t' || *c == '\n')
    ++c;
  return c;
}


x86 assembly (clang, -O0):
<skip_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1142 <skip_ws+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     1142 <skip_ws+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <skip_ws+0x52>
jmp    1163 <skip_ws+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip_ws+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws>:
mov    %rdi,%rax
movabs $0x100000600,%rcx
nopl   (%rax)
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1125 <skip_ws+0x25>
bt     %rdx,%rcx
jae    1125 <skip_ws+0x25>
add    $0x1,%rax
jmp    1110 <skip_ws+0x10>
ret

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

LLVM IR (-O2):
define i8* @skip_ws(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
int xfuse_deinit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xfuse_deinit() {
ret i32 0
}
/* Variables and functions */
int putchar(int const);
__attribute__((__unused__)) int(cheat_unwrapped_putchar)(int const character) {
  return putchar(character);
}


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

x86 assembly (clang, -O2):
<cheat_unwrapped_putchar>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @cheat_unwrapped_putchar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
void g_array_insert_vals() {}


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

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

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

LLVM IR (-O2):
define void @g_array_insert_vals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
void output(int *array, size_t len) {
  int i;
  for (i = 0; i < len; i++) {
    printf("%2i,", array[i]);
  }
  puts("");
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116a <output+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <output+0x17>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <output+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <output+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%2i,\00"
@.str.1 = [1 x i8] zeroinitializer
define void @output(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2i,\00"
define void @output(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ M_PI_4;
double exp(double);
double pow(double, int /*<<< orphan*/);
double f(double t) { return pow(t, M_PI_4) * exp(-t); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xeb5(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@M_PI_4 = global i32 0
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI_4
%5 = call double @pow(double %3, i32 %4)
%6 = load double, double* %2
%7 = fneg double %6
%8 = call double @exp(double %7)
%9 = fmul double %5, %8
ret double %9
}

LLVM IR (-O2):
@M_PI_4 = global i32 0
define double @f(double %0) {
%2 = load i32, i32* @M_PI_4
%3 = tail call double @pow(double %0, i32 %2)
%4 = fneg double %0
%5 = tail call double @exp(double %4)
%6 = fmul double %3, %5
ret double %6
}