xunge/DecIR huggingface dataset:
int getQuantity(int want, int available) {
  if (want == 1 || available == 1)
    return 1;
  if (available > want)
    return want;
  return available - 1;
}


x86 assembly (clang, -O0):
<getQuantity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     111e <getQuantity+0x1e>
cmpl   $0x1,-0xc(%rbp)
jne    112a <getQuantity+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114a <getQuantity+0x4a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1141 <getQuantity+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <getQuantity+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getQuantity>:
lea    -0x1(%rsi),%eax
cmp    %edi,%esi
cmovg  %edi,%eax
cmp    $0x1,%esi
cmove  %esi,%eax
cmp    $0x1,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @getQuantity(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 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 1, i32* %3
br label %21
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %4
store i32 %17, i32* %3
br label %21
18: ; preds = %12
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %16, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @getQuantity(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp eq i32 %1, 1
%5 = or i1 %3, %4
%6 = icmp sgt i32 %1, %0
%7 = add nsw i32 %1, -1
%8 = select i1 %6, i32 %0, i32 %7
%9 = select i1 %5, i32 1, i32 %8
ret i32 %9
}
int f17(int x, int y) {
  if (y < -13 || y > -4)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffff3,-0xc(%rbp)
jl     111e <f17+0x1e>
cmpl   $0xfffffffc,-0xc(%rbp)
jle    1131 <f17+0x31>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1138 <f17+0x38>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
lea    0x3(%rsi),%ecx
mov    $0x22,%eax
cmp    $0xfffffff5,%ecx
ja     1116 <f17+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f17(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, -13
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, -4
br i1 %10, label %11, label %16
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
%15 = srem i32 %12, %14
store i32 %15, i32* %3
br label %17
16: ; preds = %8
store i32 34, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @f17(i32 %0, i32 %1) {
%3 = add i32 %1, 3
%4 = icmp ult i32 %3, -10
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = sub nsw i32 0, %1
%7 = srem i32 %0, %6
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ 34, %2 ]
ret i32 %9
}
int add_range(int low, int high) {
  int i = 0, sum = 0;
  for (i = low; i <= high; i++)
    sum = sum + i;
  return sum;
}


x86 assembly (clang, -O0):
<add_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1141 <add_range+0x41>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <add_range+0x1e>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_range>:
xor    %eax,%eax
mov    %esi,%ecx
sub    %edi,%ecx
jl     111f <add_range+0x1f>
lea    0x1(%rdi),%eax
imul   %ecx,%eax
add    %edi,%eax
not    %edi
add    %esi,%edi
imul   %rdi,%rcx
shr    %rcx
add    %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @add_range(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = sub i32 %1, %0
%6 = add i32 %0, 1
%7 = mul i32 %5, %6
%8 = xor i32 %0, -1
%9 = add i32 %8, %1
%10 = zext i32 %9 to i33
%11 = zext i32 %5 to i33
%12 = mul i33 %10, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = add i32 %7, %0
%16 = add i32 %15, %14
br label %17
17: ; preds = %4, %2
%18 = phi i32 [ 0, %2 ], [ %16, %4 ]
ret i32 %18
}
int loopy(int a, int b) {
  if (a) {
    return 0;
  }
  while (b) {
    b++;
  }
  for (;;) {
    b++;
  }
  for (;; (b++))
    b++;
  for (b = 0;;) {
    b++;
  }
  for (; a;) {
    return b;
  }
}


x86 assembly (clang, -O0):
<loopy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1118 <loopy+0x18>
xor    %eax,%eax
pop    %rbp
ret
jmp    111d <loopy+0x1d>
cmpl   $0x0,-0x8(%rbp)
je     1135 <loopy+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <loopy+0x1d>
jmp    113a <loopy+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    113a <loopy+0x3a>

x86 assembly (clang, -O2):
<loopy>:
test   %edi,%edi
je     1110 <loopy+0x10>
xor    %eax,%eax
ret
nopw   0x0(%rax,%rax,1)
jmp    1110 <loopy+0x10>

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

LLVM IR (-O2):
define i32 @loopy(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %2
ret i32 0
5: ; preds = %2, %5
br label %5
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    return c | 0x20;
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ constructs_destroy();
int destroy_tests(void) {
  constructs_destroy();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @destroy_tests() {
%1 = call i32 (...) @constructs_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @destroy_tests() {
%1 = tail call i32 (...) @constructs_destroy()
ret i32 0
}
void handle(c) char *c;
{
  if (isused(*c))
    *c = 0377;
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <isused@plt>
cmp    $0x0,%eax
je     113a <handle+0x2a>
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
xor    %eax,%eax
call   1030 <isused@plt>
test   %eax,%eax
je     1125 <handle+0x15>
movb   $0xff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @handle(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = call i32 (i32, ...) bitcast (i32 (...)* @isused to i32 (i32, ...)*)(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
store i8 -1, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @handle(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @isused to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 -1, i8* %0
br label %7
7: ; preds = %6, %1
ret void
}
/* Variables and functions */
int floor(float);
int /*<<< orphan*/ printf(char *, float, float);
void roundToTenths(float number) {
  float rounded = floor(number * 10 + .5) / 10;
  printf("original = %f  Rounded to Tenth = %.1f\n", number, rounded);
}


x86 assembly (clang, -O0):
<roundToTenths>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1040 <floor@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundToTenths>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,0x4(%rsp)
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xec6(%rip),%xmm0
call   1040 <floor@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
lea    0xea1(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"original = %f Rounded to Tenth = %.1f\0A\00"
define void @roundToTenths(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+01
%6 = fpext float %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fptrunc double %7 to float
%9 = call i32 @floor(float %8)
%10 = sdiv i32 %9, 10
%11 = sitofp i32 %10 to float
store float %11, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), float %12, float %13)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"original = %f Rounded to Tenth = %.1f\0A\00"
define void @roundToTenths(float %0) {
%2 = fmul float %0, 1.000000e+01
%3 = fadd float %2, 5.000000e-01
%4 = tail call i32 @floor(float %3)
%5 = sdiv i32 %4, 10
%6 = sitofp i32 %5 to float
%7 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), float %0, float %6)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = ~1;
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ power_timer2_disable();
void rtc_poweroff(void) { power_timer2_disable(); }


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

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

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

LLVM IR (-O2):
define void @rtc_poweroff() {
%1 = tail call i32 (...) @power_timer2_disable()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_time_t();
time_t time(time_t *tloc) {
  time_t t;
  t = __infer_nondet_time_t();
  if (tloc)
    *tloc = t;
  return t;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_time_t@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <time+0x2a>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_time_t@plt>
test   %rbx,%rbx
je     1122 <time+0x12>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @time(i32* writeonly %0) {
%2 = tail call i32 (...) @__infer_nondet_time_t()
%3 = icmp eq i32* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* %0
br label %5
5: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ errorf(char *, size_t);
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *result = malloc(size);
  if (result == NULL) {
    errorf("Failed to allocate %i bytes.\n", size);
    exit(127);
  }
  return result;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <safe_malloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <errorf@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <safe_malloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <errorf@plt>
mov    $0x7f,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Failed to allocate %i bytes.\0A\00"
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @errorf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 127)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [30 x i8] c"Failed to allocate %i bytes.\0A\00"
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @errorf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 127)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
size_t align(size_t sz, size_t a) {
  if (a == 0)
    return sz;
  return (sz + a - 1) & ~(a - 1);
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1124 <align+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <align+0x43>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rsi,%rax
neg    %rax
and    %rcx,%rax
test   %rsi,%rsi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @align(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
store i64 %9, i64* %3
br label %19
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = add i64 %11, %12
%14 = sub i64 %13, 1
%15 = load i64, i64* %5
%16 = sub i64 %15, 1
%17 = xor i64 %16, -1
%18 = and i64 %14, %17
store i64 %18, i64* %3
br label %19
19: ; preds = %10, %8
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = add i64 %0, -1
%5 = add i64 %4, %1
%6 = sub i64 0, %1
%7 = and i64 %5, %6
%8 = select i1 %3, i64 %0, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test15_head() {
  do {
    printf("test15");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test15_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test15_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test15\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test15_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test15\00"
define void @test15_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
int test_imm_0Buint8_reg(unsigned char val) {
  return ((val) & (0x0B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Buint8_reg>:
test   $0xb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Buint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 11
%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_0Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 11
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void space_pad(char *s, int n) {
  while (strlen(s) < n)
    strcat(s, " ");
}


x86 assembly (clang, -O0):
<space_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0xc(%rbp),%eax
jge    1156 <space_pad+0x36>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcat@plt>
jmp    112f <space_pad+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space_pad>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    1157 <space_pad+0x37>
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %ebp,%eax
jl     1140 <space_pad+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @space_pad(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %9
5: ; preds = %2, %5
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp slt i32 %7, %1
br i1 %8, label %5, label %9
9: ; preds = %5, %2
ret void
}
void RTMemEfAllocVarNP(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ARGBSubtractRow_C() {
ret void
}
/* Variables and functions */
int print_test_data();
int test();
int main(int argc, char *argv[]) {
  int ret;
  if (argc > 1)
    ret = print_test_data();
  else
    ret = test();
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114f <main+0x2f>
mov    $0x0,%al
call   1030 <print_test_data@plt>
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x39>
mov    $0x0,%al
call   1040 <test@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     112c <main+0xc>
jmp    1030 <print_test_data@plt>
jmp    1040 <test@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @print_test_data()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @test()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
int b(int x) { return -x - 1; }


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

x86 assembly (clang, -O2):
<b>:
mov    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = xor i32 %0, -1
ret i32 %2
}
int DayofYear(year, month, day)
int year, month, day;
{
  double jd();
  return ((int)(jd(year, month, day, 0.0) - jd(year, 1, 0, 0.0)));
}


x86 assembly (clang, -O0):
<DayofYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <jd@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <jd@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DayofYear>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <jd@plt>
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%al
call   1030 <jd@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DayofYear(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call double (i32, i32, i32, double, ...) bitcast (double (...)* @jd to double (i32, i32, i32, double, ...)*)(i32 %7, i32 %8, i32 %9, double 0.000000e+00)
%11 = load i32, i32* %4
%12 = call double (i32, i32, i32, double, ...) bitcast (double (...)* @jd to double (i32, i32, i32, double, ...)*)(i32 %11, i32 1, i32 0, double 0.000000e+00)
%13 = fsub double %10, %12
%14 = fptosi double %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @DayofYear(i32 %0, i32 %1, i32 %2) {
%4 = tail call double (i32, i32, i32, double, ...) bitcast (double (...)* @jd to double (i32, i32, i32, double, ...)*)(i32 %0, i32 %1, i32 %2, double 0.000000e+00)
%5 = tail call double (i32, i32, i32, double, ...) bitcast (double (...)* @jd to double (i32, i32, i32, double, ...)*)(i32 %0, i32 1, i32 0, double 0.000000e+00)
%6 = fsub double %4, %5
%7 = fptosi double %6 to i32
ret i32 %7
}
long get_rtt(struct iperf_interval_results *irp) { return -1; }


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

x86 assembly (clang, -O2):
<get_rtt>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.iperf_interval_results = type opaque
define i64 @get_rtt(%struct.iperf_interval_results* %0) {
%2 = alloca %struct.iperf_interval_results*
store %struct.iperf_interval_results* %0, %struct.iperf_interval_results** %2
ret i64 -1
}

LLVM IR (-O2):
%struct.iperf_interval_results = type opaque
define i64 @get_rtt(%struct.iperf_interval_results* nocapture readnone %0) {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int x = 7;
  int y = 2;
  float z = (float)x / y;
  printf("z = %f\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"z = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), float 3.500000e+00)
ret i32 0
}
void yy_3_TagExtension(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_3_TagExtension(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ efp_stream_next_line(struct stream *);
scalar_t__ tok(struct stream *, char *);
int tok_stop(struct stream *stream) {
  if (tok(stream, "STOP")) {
    efp_stream_next_line(stream);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tok_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <tok@plt>
cmp    $0x0,%rax
je     115b <tok_stop+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <efp_stream_next_line@plt>
movl   $0x1,-0x4(%rbp)
jmp    1162 <tok_stop+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tok_stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <tok@plt>
test   %rax,%rax
je     1144 <tok_stop+0x24>
mov    %rbx,%rdi
call   1040 <efp_stream_next_line@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stream = type { i32 }
@.str = [5 x i8] c"STOP\00"
define i32 @tok_stop(%struct.stream* %0) {
%2 = alloca i32
%3 = alloca %struct.stream*
store %struct.stream* %0, %struct.stream** %3
%4 = load %struct.stream*, %struct.stream** %3
%5 = call i64 @tok(%struct.stream* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %struct.stream*, %struct.stream** %3
%9 = call i32 @efp_stream_next_line(%struct.stream* %8)
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.stream = type { i32 }
@.str = [5 x i8] c"STOP\00"
define i32 @tok_stop(%struct.stream* %0) {
%2 = tail call i64 @tok(%struct.stream* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @efp_stream_next_line(%struct.stream* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int gca_cmp_float(const void *aa, const void *bb) {
  const float a = *(const float *)aa;
  const float b = *(const float *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movss  -0x18(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
%9 = load float, float* %8
store float %9, float* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to float*
%12 = load float, float* %11
store float %12, float* %6
%13 = load float, float* %5
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
%16 = zext i1 %15 to i32
%17 = load float, float* %6
%18 = load float, float* %5
%19 = fcmp ogt float %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt float %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
void driveForward(int speed) {}


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

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

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

LLVM IR (-O2):
define void @driveForward(i32 %0) {
ret void
}
/* Variables and functions */
char *trm_line(char *);
char *trm_get(char *line) { return (trm_line(line)); }


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

x86 assembly (clang, -O2):
<trm_get>:
jmp    1030 <trm_line@plt>

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

LLVM IR (-O2):
define i8* @trm_get(i8* %0) {
%2 = tail call i8* @trm_line(i8* %0)
ret i8* %2
}
void kgsl_mmu_putpagetable(struct kgsl_pagetable *pagetable) {}


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

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

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

LLVM IR (-O2):
%struct.kgsl_pagetable = type opaque
define void @kgsl_mmu_putpagetable(%struct.kgsl_pagetable* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleHelpRequest() { printf("Function unimplemented!\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Function unimplemented!\0A\00"
define void @handleHelpRequest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Function unimplemented!\00"
define void @handleHelpRequest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void error(const char *str) {
  printf("%s\n", str);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
void PCIwrite(unsigned char bus, unsigned char func, int offset, void *data,
              int length, void *pci_dev_handle) {}


x86 assembly (clang, -O0):
<PCIwrite>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PCIwrite(i8 zeroext %0, i8 zeroext %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i8 %0, i8* %7
store i8 %1, i8* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
ret void
}

LLVM IR (-O2):
define void @PCIwrite(i8 zeroext %0, i8 zeroext %1, i32 %2, i8* nocapture %3, i32 %4, i8* nocapture %5) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void nocrash_fgetc() {
  FILE *f;
  int i;
  f = fopen("this_file_doesnt_exists", "r");
  if (f) {
    i = fgetc(f);
    printf("i =%i\n", i);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <nocrash_fgetc+0x4e>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_fgetc>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117b <nocrash_fgetc+0x3b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fgetc@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"this_file_doesnt_exists\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"i =%i\0A\00"
define void @nocrash_fgetc() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %1
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"this_file_doesnt_exists\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"i =%i\0A\00"
define void @nocrash_fgetc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @fgetc(i32* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int main() {
  int i = 0;
  volatile unsigned long *gpkcon0 = (volatile unsigned long *)0x7F008800;
  volatile unsigned long *gpkdat = (volatile unsigned long *)0x7F008808;
  *gpkcon0 = 0x11110000;
  i = 0x10;
  while (1) {
    *gpkdat = i;
    i++;
    if (i == 0x100)
      i = 0x10;
    delay(0x50000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x7f008800,%eax
mov    %rax,-0x10(%rbp)
mov    $0x7f008808,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x11110000,(%rax)
movl   $0x10,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jne    1172 <main+0x62>
movl   $0x10,-0x8(%rbp)
mov    $0x50000,%edi
call   1030 <delay@plt>
jmp    114a <main+0x3a>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movq   $0x11110000,0x7f008800
mov    $0x10,%ebp
mov    $0x10,%ebx
nopl   0x0(%rax)
movslq %ebx,%rbx
mov    %rbx,0x7f008808
7f
add    $0x1,%ebx
cmp    $0x100,%ebx
cmove  %ebp,%ebx
mov    $0x50000,%edi
call   1030 <delay@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64*
store i32 0, i32* %1
store i32 0, i32* %2
store i64* inttoptr (i64 2130741248 to i64*), i64** %3
store i64* inttoptr (i64 2130741256 to i64*), i64** %4
%5 = load i64*, i64** %3
store volatile i64 286326784, i64* %5
store i32 16, i32* %2
br label %6
6: ; preds = %0, %15
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = load i64*, i64** %4
store volatile i64 %8, i64* %9
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 256
br i1 %13, label %14, label %15
14: ; preds = %6
store i32 16, i32* %2
br label %15
15: ; preds = %14, %6
%16 = call i32 @delay(i32 327680)
br label %6
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 286326784, i64* inttoptr (i64 2130741248 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 16, %0 ], [ %6, %1 ]
%3 = sext i32 %2 to i64
store volatile i64 %3, i64* inttoptr (i64 2130741256 to i64*)
%4 = add nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
%6 = select i1 %5, i32 16, i32 %4
%7 = tail call i32 @delay(i32 327680)
br label %1
}
void zz(void) {}


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

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

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

LLVM IR (-O2):
define void @zz() {
ret void
}
/* Variables and functions */
int passivesock(char const *, char const *, char *, int);
int passiveTCP(const char *ipNumber, const char *service, int qlen) {
  return passivesock(ipNumber, service, "tcp", qlen);
}


x86 assembly (clang, -O0):
<passiveTCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdx
call   1030 <passivesock@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passiveTCP>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <passivesock@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tcp\00"
define i32 @passiveTCP(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @passivesock(i8* %7, i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
define i32 @passiveTCP(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @passivesock(i8* %0, i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %4
}
const char *strip_reg_name(const char *name) {
  if (name[0] == '%' || name[0] == '#')
    name++;
  return name;
}


x86 assembly (clang, -O0):
<strip_reg_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
je     1128 <strip_reg_name+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1134 <strip_reg_name+0x34>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_reg_name>:
mov    %rdi,%rax
mov    (%rdi),%cl
cmp    $0x25,%cl
je     110f <strip_reg_name+0xf>
cmp    $0x23,%cl
jne    1113 <strip_reg_name+0x13>
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @strip_reg_name(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %5 [
i8 37, label %3
i8 35, label %3
]
3: ; preds = %1, %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ %0, %1 ]
ret i8* %6
}
int compare_int(const void *a, const void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}