xunge/DecIR huggingface dataset:
/* Variables and functions */
int *calloc(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *array = calloc(4, 4);
  int i = 0;
  while (i < 4) {
    printf("%d\n", array[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1175 <main+0x55>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xec1(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @calloc(i32 4, i32 4)
store i32* %4, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32* @calloc(i32 4, i32 4)
%2 = load i32, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds i32, i32* %1, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %1, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}
short test_short_8(short a, short b, short c, short d, short e, short f,
                   short g, short h) {
  return 3134;
}


x86 assembly (clang, -O0):
<test_short_8>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9w,%ax
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9w
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    $0xc3e,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_short_8>:
mov    $0xc3e,%ax
ret

LLVM IR (-O0):
define signext i16 @test_short_8(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
%16 = alloca i16
store i16 %0, i16* %9
store i16 %1, i16* %10
store i16 %2, i16* %11
store i16 %3, i16* %12
store i16 %4, i16* %13
store i16 %5, i16* %14
store i16 %6, i16* %15
store i16 %7, i16* %16
ret i16 3134
}

LLVM IR (-O2):
define signext i16 @test_short_8(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
ret i16 3134
}
int fn3(int a, int b) {
  int tem1 = a & b;
  int tem2 = b ^ a;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn3>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @fn3(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
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
unsigned int __blcmsk_u32(unsigned int);
unsigned int test__blcmsk_u32(unsigned int a) { return __blcmsk_u32(a); }


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

x86 assembly (clang, -O2):
<test__blcmsk_u32>:
jmp    1030 <__blcmsk_u32@plt>

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

LLVM IR (-O2):
define i32 @test__blcmsk_u32(i32 %0) {
%2 = tail call i32 @__blcmsk_u32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int u_int;

/* Variables and functions */
int RAND_MAX;
int rand_r(u_int *next_r) {
  int ret;
  (*next_r) = (*next_r) * 1103515245 + 12345;
  ret = (*next_r) & RAND_MAX;
  return (ret);
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%ecx
add    $0x3039,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ebd(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
imul   $0x41c64e6d,(%rdi),%eax
add    $0x3039,%eax
mov    %eax,(%rdi)
mov    0x2ed4(%rip),%rcx
and    (%rcx),%eax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1103515245
%7 = add nsw i32 %6, 12345
%8 = load i32*, i32** %2
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = load i32, i32* @RAND_MAX
%12 = and i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 1103515245
%4 = add nsw i32 %3, 12345
store i32 %4, i32* %0
%5 = load i32, i32* @RAND_MAX
%6 = and i32 %4, %5
ret i32 %6
}
int f2(int x, int *y, int *z) { return 0; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f2(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
ret i32 0
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
unsigned long cris_swapnwbrlz(unsigned long);
unsigned long __ffs(unsigned long w) { return cris_swapnwbrlz(~w); }


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

x86 assembly (clang, -O2):
<__ffs>:
not    %rdi
jmp    1030 <cris_swapnwbrlz@plt>

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @cris_swapnwbrlz(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @cris_swapnwbrlz(i64 %2)
ret i64 %3
}
int main(void) {
  int i = 0;
  for (; (i != 0);) {
    ++i;
  }
  for (; (i != 10); ++i)
    ;
  for (; (i != 3); ++i)
    i = 0;
  for (i = 0; (i != 5); ++i)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
cmpl   $0xa,-0x8(%rbp)
je     114c <main+0x4c>
jmp    113e <main+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x2f>
jmp    1151 <main+0x51>
cmpl   $0x3,-0x8(%rbp)
je     1170 <main+0x70>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <main+0x51>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1194 <main+0x94>
jmp    1186 <main+0x86>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1177 <main+0x77>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %10
17: ; preds = %10
br label %18
18: ; preds = %22, %17
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, 3
br i1 %20, label %21, label %25
21: ; preds = %18
store i32 0, i32* %2
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %18
25: ; preds = %18
store i32 0, i32* %2
br label %26
26: ; preds = %30, %25
%27 = load i32, i32* %2
%28 = icmp ne i32 %27, 5
br i1 %28, label %29, label %33
29: ; preds = %26
br label %30
30: ; preds = %29
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %26
33: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
unsigned int rq_trade_mgr_hash(void *x) { return ((unsigned int)x); }


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

x86 assembly (clang, -O2):
<rq_trade_mgr_hash>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @rq_trade_mgr_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
double limit_minutes(double minutes) {
  double limited = minutes;
  if (limited < -20.0)
    limited += 1440.0;
  else if (limited > 20.0)
    limited -= 1440.0;
  return limited;
}


x86 assembly (clang, -O0):
<limit_minutes>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee5(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <limit_minutes+0x3d>
movsd  0xee2(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116f <limit_minutes+0x6f>
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116a <limit_minutes+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116f <limit_minutes+0x6f>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_minutes>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1117 <limit_minutes+0x17>
addsd  0xf02(%rip),%xmm0
ret
ucomisd 0xee9(%rip),%xmm0
jbe    1129 <limit_minutes+0x29>
addsd  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define double @limit_minutes(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
store double %4, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, -2.000000e+01
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fadd double %8, 1.440000e+03
store double %9, double* %3
br label %17
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ogt double %11, 2.000000e+01
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %3
%15 = fsub double %14, 1.440000e+03
store double %15, double* %3
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %16, %7
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @limit_minutes(double %0) {
%2 = fcmp olt double %0, -2.000000e+01
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 1.440000e+03
br label %9
5: ; preds = %1
%6 = fcmp ogt double %0, 2.000000e+01
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = fadd double %0, -1.440000e+03
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
/* Variables and functions */
int printf(char *, char const *);
int puts(char const *string) { return printf("%s\n", string); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(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)
ret i32 %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @puts(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int copy_dobldobl_target_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(255, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<copy_dobldobl_target_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xff,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_dobldobl_target_solutions_to_container>:
mov    $0xff,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_dobldobl_target_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 255, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_dobldobl_target_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 255, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
scalar_t__ isspace(int);
int asSpace(int c) { return isspace(c) ? c : ' '; }


x86 assembly (clang, -O0):
<asSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1138 <asSpace+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <asSpace+0x35>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <asSpace+0x35>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asSpace>:
push   %rbx
mov    %edi,%ebx
call   1030 <isspace@plt>
test   %rax,%rax
mov    $0x20,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @asSpace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isspace(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i32 [ %7, %6 ], [ 32, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @asSpace(i32 %0) {
%2 = tail call i64 @isspace(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 32, i32 %0
ret i32 %4
}
void rte_prefetch0(const volatile void *p) {}


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

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

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

LLVM IR (-O2):
define void @rte_prefetch0(i8* nocapture %0) {
ret void
}
int _is_number(const char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<_is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_is_number+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_number>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_is_number(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t sdbm(uint8_t c1, uint8_t c2, int size_bf) {
  unsigned long h = c1;
  h = c2 + (h << 6) + (h << 16) - h;
  return ((uint16_t)h) % size_bf;
}


x86 assembly (clang, -O0):
<sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cltd
idivl  -0x14(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbm>:
mov    %edx,%ecx
imul   $0x10040,%edi,%eax
sub    %edi,%esi
add    %esi,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sdbm(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
store i64 %8, i64* %7
%9 = load i64, i64* %5
%10 = load i64, i64* %7
%11 = shl i64 %10, 6
%12 = add i64 %9, %11
%13 = load i64, i64* %7
%14 = shl i64 %13, 16
%15 = add i64 %12, %14
%16 = load i64, i64* %7
%17 = sub i64 %15, %16
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = trunc i64 %18 to i32
%20 = load i32, i32* %6
%21 = srem i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @sdbm(i64 %0, i64 %1, i32 %2) {
%4 = mul i64 %0, 65600
%5 = sub i64 %1, %0
%6 = add i64 %5, %4
%7 = trunc i64 %6 to i32
%8 = srem i32 %7, %2
ret i32 %8
}
void ath_hal_set_device(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @ath_hal_set_device(i8* nocapture %0) {
ret void
}
unsigned long long int time_convert(unsigned long s, unsigned long us) {
  return ((s * 1000000) + us);
}


x86 assembly (clang, -O0):
<time_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_convert>:
imul   $0xf4240,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @time_convert(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 = mul i64 %5, 1000000
%7 = load i64, i64* %4
%8 = add i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @time_convert(i64 %0, i64 %1) {
%3 = mul i64 %0, 1000000
%4 = add i64 %3, %1
ret i64 %4
}
long grib_op_sub(long a, long b) { return a - b; }


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

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

LLVM IR (-O0):
define i64 @grib_op_sub(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 nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @grib_op_sub(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, unsigned char const);
int is_metacharacter(const unsigned char *s) {
  static const char *metacharacters = "^$().[]*+?|\\Ssd";
  return strchr(metacharacters, *s) != NULL;
}


x86 assembly (clang, -O0):
<is_metacharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f05(%rip),%rdi
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_metacharacter>:
push   %rax
movzbl (%rdi),%esi
lea    0xee5(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@is_metacharacter.metacharacters = internal global i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0)
@.str = [16 x i8] c"^$().[]*+?|\\Ssd\00"
define i32 @is_metacharacter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** @is_metacharacter.metacharacters
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i32* @strchr(i8* %3, i8 zeroext %5)
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"^$().[]*+?|\\Ssd\00"
define i32 @is_metacharacter(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32* @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int _gcd(int a, int b) { return b ? _gcd(b, a % b) : a; }


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

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

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

LLVM IR (-O2):
define i32 @_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
void func(void) {}


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

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

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

LLVM IR (-O2):
define void @func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write_texture(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("usage: jpg2hdr outfile.hdr infile.jpg\n");
  }
  write_texture(argv[1], argv[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <write_texture@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1135 <main+0x15>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <write_texture@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"usage: jpg2hdr outfile.hdr infile.jpg\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @write_texture(i8* %13, i8* %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [38 x i8] c"usage: jpg2hdr outfile.hdr infile.jpg\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @write_texture(i8* %8, i8* %10)
ret i32 0
}
int ceilll(long long a, long long b) { return (a - 1) / b + 1; }


x86 assembly (clang, -O0):
<ceilll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
cqto
idivq  -0x10(%rbp)
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilll>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111c <ceilll+0x1c>
cqto
idiv   %rsi
add    $0x1,%eax
ret
xor    %edx,%edx
div    %esi
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ceilll(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 = sub nsw i64 %5, 1
%7 = load i64, i64* %4
%8 = sdiv i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ceilll(i64 %0, i64 %1) {
%3 = add nsw i64 %0, -1
%4 = sdiv i64 %3, %1
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
ret i32 %6
}
/* Variables and functions */
scalar_t__ errno;
unsigned long strtoul(char const *, char **, int /*<<< orphan*/);
int getnum(const char *s, unsigned long *ret) {
  char *t;
  errno = 0;
  *ret = strtoul(s, &t, 0);
  if (errno || *t != '\0') {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<getnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2e92(%rip),%rax
cmpq   $0x0,(%rax)
jne    1168 <getnum+0x58>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1174 <getnum+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <getnum+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2ec2(%rip),%r14
movq   $0x0,(%r14)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
mov    %rax,(%rbx)
mov    $0xffffffff,%eax
cmpq   $0x0,(%r14)
jne    1147 <getnum+0x37>
mov    (%rsp),%rax
xor    %ecx,%ecx
cmp    (%rax),%cl
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @getnum(i8* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i8*
store i8* %0, i8** %4
store i64* %1, i64** %5
store i64 0, i64* @errno
%7 = load i8*, i8** %4
%8 = call i64 @strtoul(i8* %7, i8** %6, i32 0)
%9 = load i64*, i64** %5
store i64 %8, i64* %9
%10 = load i64, i64* @errno
%11 = icmp ne i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12, %2
store i32 -1, i32* %3
br label %19
18: ; preds = %12
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @getnum(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 0)
store i64 %5, i64* %1
%6 = load i64, i64* @errno
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %8, %2
%14 = phi i32 [ -1, %2 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR78_set(void) { return U_WMRCORENONE_set("U_WMR78"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR78\00"
define i8* @U_WMR78_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR78\00"
define i8* @U_WMR78_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
float fastexp(float);
float fastsinh(float p) { return 0.5f * (fastexp(p) - fastexp(-p)); }


x86 assembly (clang, -O0):
<fastsinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fastexp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <fastexp@plt>
movss  -0x8(%rbp),%xmm1
subss  %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsinh>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <fastexp@plt>
movss  %xmm0,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xed0(%rip),%xmm0
call   1030 <fastexp@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xec9(%rip),%xmm1
movaps %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @fastsinh(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fastexp(float %3)
%5 = load float, float* %2
%6 = fneg float %5
%7 = call float @fastexp(float %6)
%8 = fsub float %4, %7
%9 = fmul float 5.000000e-01, %8
ret float %9
}

LLVM IR (-O2):
define float @fastsinh(float %0) {
%2 = tail call float @fastexp(float %0)
%3 = fneg float %0
%4 = tail call float @fastexp(float %3)
%5 = fsub float %2, %4
%6 = fmul float %5, 5.000000e-01
ret float %6
}
int snd_hdac_i915_exit(struct hdac_bus *bus) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hdac_bus = type opaque
define i32 @snd_hdac_i915_exit(%struct.hdac_bus* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ISInit();
scalar_t__ strcmp(char *, char const *);
void ISNewText(const char *dev, const char *name, char *texts[], char *names[],
               int n) {
  ISInit();
  if (dev && strcmp("FLI Wheel", dev))
    return;
  n = n;
  dev = dev;
  name = name;
  names = names;
  texts = texts;
}


x86 assembly (clang, -O0):
<ISNewText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x0,%al
call   1040 <ISInit@plt>
cmpq   $0x0,-0x8(%rbp)
je     116d <ISNewText+0x4d>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     116d <ISNewText+0x4d>
jmp    1193 <ISNewText+0x73>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISNewText>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <ISInit@plt>
test   %rbx,%rbx
je     1140 <ISNewText+0x20>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcmp@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"FLI Wheel\00"
define void @ISNewText(i8* %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = call i32 (...) @ISInit()
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %5
%15 = load i8*, i8** %6
%16 = call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %25
19: ; preds = %14, %5
%20 = load i32, i32* %10
store i32 %20, i32* %10
%21 = load i8*, i8** %6
store i8* %21, i8** %6
%22 = load i8*, i8** %7
store i8* %22, i8** %7
%23 = load i8**, i8*** %9
store i8** %23, i8*** %9
%24 = load i8**, i8*** %8
store i8** %24, i8*** %8
br label %25
25: ; preds = %19, %18
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"FLI Wheel\00"
define void @ISNewText(i8* %0, i8* nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i32 %4) {
%6 = tail call i32 (...) @ISInit()
%7 = icmp eq i8* %0, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearScreen(void) { printf("\e[1;1H\e[2J"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
define void @clearScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
define void @clearScreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_codec_get_pkt_timebase() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_get_pkt_timebase() {
ret void
}
/* Variables and functions */
double sqrt(double);
double distEuclidean(double a, double b) {
  double diff;
  diff = a - b;
  return sqrt(diff * diff);
}


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

x86 assembly (clang, -O2):
<distEuclidean>:
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1127 <distEuclidean+0x17>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @distEuclidean(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fmul double %3, %3
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct proto_hdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ proto_field_set_bytes(struct proto_hdr *, int /*<<< orphan*/,
                                         int /*<<< orphan*/ *);
void proto_field_set_u16(struct proto_hdr *hdr, uint32_t fid, uint16_t val) {
  proto_field_set_bytes(hdr, fid, (uint8_t *)&val);
}


x86 assembly (clang, -O0):
<proto_field_set_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <proto_field_set_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proto_field_set_u16>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <proto_field_set_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.proto_hdr = type { i32 }
define void @proto_field_set_u16(%struct.proto_hdr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.proto_hdr*
%5 = alloca i32
%6 = alloca i32
store %struct.proto_hdr* %0, %struct.proto_hdr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.proto_hdr*, %struct.proto_hdr** %4
%8 = load i32, i32* %5
%9 = call i32 @proto_field_set_bytes(%struct.proto_hdr* %7, i32 %8, i32* %6)
ret void
}

LLVM IR (-O2):
%struct.proto_hdr = type { i32 }
define void @proto_field_set_u16(%struct.proto_hdr* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @proto_field_set_bytes(%struct.proto_hdr* %0, i32 %1, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HalCC2430RadioP__InterruptTXDone__fired();
void HplCC2430InterruptsC__InterruptTXDone__fired(void) {
  HalCC2430RadioP__InterruptTXDone__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplCC2430InterruptsC__InterruptTXDone__fired() {
%1 = tail call i32 (...) @HalCC2430RadioP__InterruptTXDone__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRLW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xd1);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_PSRLW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRLW>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xd1,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRLW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 209)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRLW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 209)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
long long fool(long long x) { return x == 0x123456; }


x86 assembly (clang, -O0):
<fool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x123456,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<fool>:
xor    %eax,%eax
cmp    $0x123456,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @fool(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1193046
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @fool(i64 %0) {
%2 = icmp eq i64 %0, 1193046
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Type definitions */
struct char_array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void char_array_free(struct char_array *const a) { printf("Free\n"); }


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

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

LLVM IR (-O0):
%struct.char_array = type { i32 }
@.str = [6 x i8] c"Free\0A\00"
define void @char_array_free(%struct.char_array* %0) {
%2 = alloca %struct.char_array*
store %struct.char_array* %0, %struct.char_array** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.char_array = type { i32 }
@str = [5 x i8] c"Free\00"
define void @char_array_free(%struct.char_array* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void upper(s) register char *s;
{
  while (*s != '\0') {
    if (islower(*s))
      *s = toupper(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <upper+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%eax
je     1165 <upper+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <upper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1165 <upper+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    114b <upper+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1165 <upper+0x45>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <islower@plt>
test   %eax,%eax
je     1140 <upper+0x20>
mov    %ebp,%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1140 <upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @islower(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = tail call i32 @toupper(i32 %7)
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
br label %13
13: ; preds = %10, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
double evaluate_postfix(struct token_queue *pqueue_postfix) {}


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

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

LLVM IR (-O0):
%struct.token_queue = type opaque
define double @evaluate_postfix(%struct.token_queue* %0) {
%2 = alloca double
%3 = alloca %struct.token_queue*
store %struct.token_queue* %0, %struct.token_queue** %3
%4 = load double, double* %2
ret double %4
}

LLVM IR (-O2):
%struct.token_queue = type opaque
define double @evaluate_postfix(%struct.token_queue* nocapture readnone %0) {
ret double undef
}