xunge/DecIR huggingface dataset:
int intlog2(long n) {
  register int i;
  if (n == 0)
    return (0);
  i = 31;
  if (n < 0)
    return (i);
  while ((n = n << 1) > 0)
    i--;
  return (--i);
}


x86 assembly (clang, -O0):
<intlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <intlog2+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1171 <intlog2+0x71>
movl   $0x1f,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    113c <intlog2+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <intlog2+0x71>
jmp    1141 <intlog2+0x41>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jle    1165 <intlog2+0x65>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <intlog2+0x41>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlog2>:
test   %rdi,%rdi
je     111c <intlog2+0x1c>
mov    $0x1f,%eax
js     111b <intlog2+0x1b>
nopl   0x0(%rax)
add    %rdi,%rdi
add    $0xffffffff,%eax
test   %rdi,%rdi
jg     1110 <intlog2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @intlog2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp slt i64 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ %0, %3 ]
%7 = phi i32 [ %10, %5 ], [ 30, %3 ]
%8 = shl nuw i64 %6, 1
%9 = icmp sgt i64 %8, 0
%10 = add nsw i32 %7, -1
br i1 %9, label %5, label %11
11: ; preds = %5, %3, %1
%12 = phi i32 [ 0, %1 ], [ 31, %3 ], [ %7, %5 ]
ret i32 %12
}
double w_bar_3(double p) {
  double q = 1 - p;
  return 1.0 - p * (0.5) * (0.1) - q * (0.1);
}


x86 assembly (clang, -O0):
<w_bar_3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeed(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe85(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_bar_3>:
movsd  0xef8(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
mulsd  0xef0(%rip),%xmm0
movsd  0xef0(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @w_bar_3(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
store double %5, double* %3
%6 = load double, double* %2
%7 = fmul double %6, 5.000000e-01
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double 1.000000e+00)
%10 = load double, double* %3
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 1.000000e-01, double %9)
ret double %12
}

LLVM IR (-O2):
define double @w_bar_3(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %0, -5.000000e-01
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e-01, double 1.000000e+00)
%5 = fneg double %2
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-01, double %4)
ret double %6
}
const char *getSpec(void) { return "typ_spec { name=typ_FrameBufferType; }"; }


x86 assembly (clang, -O0):
<getSpec>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSpec>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"typ_spec { name=typ_FrameBufferType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"typ_spec { name=typ_FrameBufferType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int getchar();
int next_codeword_bit(void) {
  int numeral = getchar();
  if (numeral == '1')
    return 1;
  if (numeral == '0')
    return 0;
  return numeral;
}


x86 assembly (clang, -O0):
<next_codeword_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x31,-0x8(%rbp)
jne    1138 <next_codeword_bit+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1154 <next_codeword_bit+0x44>
cmpl   $0x30,-0x8(%rbp)
jne    114e <next_codeword_bit+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1154 <next_codeword_bit+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_codeword_bit>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x31,%eax
je     1126 <next_codeword_bit+0x16>
cmp    $0x30,%eax
jne    1124 <next_codeword_bit+0x14>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @next_codeword_bit() {
%1 = tail call i32 (...) @getchar()
switch i32 %1, label %3 [
i32 49, label %4
i32 48, label %2
]
2: ; preds = %0
br label %4
3: ; preds = %0
br label %4
4: ; preds = %0, %3, %2
%5 = phi i32 [ 0, %2 ], [ %1, %3 ], [ 1, %0 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *const, char *const *);
int /*<<< orphan*/ geteuid();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void grant_shell() {
  printf("Welcome back superuser!\nHere's your shell:\n");
  setuid(geteuid());
  char *const args[] = {"/bin/sh", NULL};
  execv(args[0], args);
}


x86 assembly (clang, -O0):
<grant_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
mov    0x2ca7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ca4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grant_shell>:
sub    $0x18,%rsp
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
movaps 0x2cab(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe90(%rip),%rdi
mov    %rsp,%rsi
call   1060 <execv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Welcome back superuser!\0AHere's your shell:\0A\00"
@.str.1 = [8 x i8] c"/bin/sh\00"
@__const.grant_shell.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* null]
define void @grant_shell() {
%1 = alloca [2 x i8*]
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @geteuid()
%4 = call i32 @setuid(i32 %3)
%5 = bitcast [2 x i8*]* %1 to i8*
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%9 = call i32 @execv(i8* %7, i8** %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"/bin/sh\00"
@__const.grant_shell.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* null]
@str = [43 x i8] c"Welcome back superuser!\0AHere's your shell:\00"
define void @grant_shell() {
%1 = alloca [2 x i8*]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @geteuid()
%4 = tail call i32 @setuid(i32 %3)
%5 = bitcast [2 x i8*]* %1 to i8*
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %6)
ret void
}
int test_imm_37uint16_mem(unsigned short *val) {
  return ((*val) & (0x37 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_37uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 55
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerMatchGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;
  ;
  return ((ui32Timer == 0x000000FF)
              ? (*((volatile unsigned long *)(ui32Base + 0x00000030)))
              : (*((volatile unsigned long *)(ui32Base + 0x00000034))));
}


x86 assembly (clang, -O0):
<TimerMatchGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    112b <TimerMatchGet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    113a <TimerMatchGet+0x3a>
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerMatchGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x30(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%rax
ret

LLVM IR (-O0):
define i32 @TimerMatchGet(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 eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 48
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 52
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
br label %19
19: ; preds = %13, %7
%20 = phi i64 [ %12, %7 ], [ %18, %13 ]
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @TimerMatchGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 48, i32 52
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
void usage(char *name) {
  if (!name) {
    printf("Programer Error: usage requires a name!!"), exit(1);
  }
  printf("Usage: %s\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114f <usage+0x2f>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
test   %rdi,%rdi
jne    113e <usage+0x1e>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Programer Error: usage requires a name!!\00"
@.str.1 = [11 x i8] c"Usage: %s\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %8)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Programer Error: usage requires a name!!\00"
@.str.1 = [11 x i8] c"Usage: %s\0A\00"
define void @usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
void main() {
  char *p = "li";
  char *q = "liang";
  strcat(p, q);
  printf("%s\n", p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"li\00"
@.str.1 = [6 x i8] c"liang\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = tail call i32 @strcat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void atoi() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @atoi() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
int fn8(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = b & a;
  return tem1 | tem2;
}


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

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

LLVM IR (-O0):
define i32 @fn8(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* %4
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and 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 @fn8(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int t();
q() {
  int i = t();
  if (!i)
    i = t();
}


x86 assembly (clang, -O0):
<q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <t@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <q+0x26>
mov    $0x0,%al
call   1030 <t@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q>:
push   %rax
xor    %eax,%eax
call   1030 <t@plt>
test   %eax,%eax
je     111e <q+0xe>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <t@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @q() {
%1 = tail call i32 (...) @t()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @t()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
void InitializeClock() {}


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

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

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

LLVM IR (-O2):
define void @InitializeClock() {
ret void
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_transpose(float *, float *);
__attribute__((always_)) struct mat4 *psmat4_transpose(struct mat4 *result,
                                                       struct mat4 *m) {
  mat4_transpose((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat4_transpose>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_transpose@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_transpose(%struct.mat4* %0, %struct.mat4* %1) {
%3 = alloca %struct.mat4*
%4 = alloca %struct.mat4*
store %struct.mat4* %0, %struct.mat4** %3
store %struct.mat4* %1, %struct.mat4** %4
%5 = load %struct.mat4*, %struct.mat4** %3
%6 = bitcast %struct.mat4* %5 to float*
%7 = load %struct.mat4*, %struct.mat4** %4
%8 = bitcast %struct.mat4* %7 to float*
%9 = call i32 @mat4_transpose(float* %6, float* %8)
%10 = load %struct.mat4*, %struct.mat4** %3
ret %struct.mat4* %10
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_transpose(%struct.mat4* returned %0, %struct.mat4* %1) {
%3 = bitcast %struct.mat4* %0 to float*
%4 = bitcast %struct.mat4* %1 to float*
%5 = tail call i32 @mat4_transpose(float* %3, float* %4)
ret %struct.mat4* %0
}
/* Variables and functions */
char thermo_hi_threshold_get();
int /*<<< orphan*/ thermo_hi_threshold_set(char);
void thermo_hi_threshold_inc() {
  char val;
  val = thermo_hi_threshold_get();
  if (val == (128))
    return;
  if (val < (85)) {
    val++;
    thermo_hi_threshold_set(val);
  }
}


x86 assembly (clang, -O0):
<thermo_hi_threshold_inc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <thermo_hi_threshold_get@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x80,%eax
jne    1146 <thermo_hi_threshold_inc+0x26>
jmp    1164 <thermo_hi_threshold_inc+0x44>
movsbl -0x1(%rbp),%eax
cmp    $0x55,%eax
jge    1164 <thermo_hi_threshold_inc+0x44>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <thermo_hi_threshold_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thermo_hi_threshold_inc>:
push   %rax
xor    %eax,%eax
call   1040 <thermo_hi_threshold_get@plt>
cmp    $0x54,%al
jg     1137 <thermo_hi_threshold_inc+0x17>
add    $0x1,%al
movsbl %al,%edi
pop    %rax
jmp    1030 <thermo_hi_threshold_set@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @thermo_hi_threshold_inc() {
%1 = alloca i8
%2 = call signext i8 (...) @thermo_hi_threshold_get()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %0
br label %16
7: ; preds = %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 85
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %1
%13 = add i8 %12, 1
store i8 %13, i8* %1
%14 = load i8, i8* %1
%15 = call i32 @thermo_hi_threshold_set(i8 signext %14)
br label %16
16: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
define void @thermo_hi_threshold_inc() {
%1 = tail call signext i8 (...) @thermo_hi_threshold_get()
%2 = icmp slt i8 %1, 85
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = add nsw i8 %1, 1
%5 = tail call i32 @thermo_hi_threshold_set(i8 signext %4)
br label %6
6: ; preds = %0, %3
ret void
}
/* Variables and functions */
int f273(int *);
int f274(int *p) { return f273(p); }


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

x86 assembly (clang, -O2):
<f274>:
jmp    1030 <f273@plt>

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

LLVM IR (-O2):
define i32 @f274(i32* %0) {
%2 = tail call i32 @f273(i32* %0)
ret i32 %2
}
/* Variables and functions */
float min(float, float);
float sqrt(float);
float fOpUnionChamfer(float a, float b, float r) {
  return min(min(a, b), (a - r + b) * sqrt(0.5f));
}


x86 assembly (clang, -O0):
<fOpUnionChamfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe99(%rip),%xmm0
call   1040 <sqrt@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm1
call   1030 <min@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fOpUnionChamfer>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <min@plt>
movss  0xc(%rsp),%xmm1
subss  0x14(%rsp),%xmm1
addss  0x10(%rsp),%xmm1
mulss  0xebb(%rip),%xmm1
add    $0x18,%rsp
jmp    1030 <min@plt>

LLVM IR (-O0):
define float @fOpUnionChamfer(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call float @min(float %7, float %8)
%10 = load float, float* %4
%11 = load float, float* %6
%12 = fsub float %10, %11
%13 = load float, float* %5
%14 = fadd float %12, %13
%15 = call float @sqrt(float 5.000000e-01)
%16 = fmul float %14, %15
%17 = call float @min(float %9, float %16)
ret float %17
}

LLVM IR (-O2):
define float @fOpUnionChamfer(float %0, float %1, float %2) {
%4 = tail call float @min(float %0, float %1)
%5 = fsub float %0, %2
%6 = fadd float %5, %1
%7 = fmul float %6, 0x3FE6A09E60000000
%8 = tail call float @min(float %4, float %7)
ret float %8
}
/* Type definitions */
typedef scalar_t__ ssize_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int errno;
scalar_t__ sendfile(int, int, int /*<<< orphan*/ *, size_t);
ssize_t __sulong_posix_sendfile(int out_fd, int in_fd, off_t *offset,
                                size_t count) {
  {
    int native_errno = errno;
    ssize_t result = sendfile(out_fd, in_fd, offset, count);
    if (result == (ssize_t)-1) {
      result = (ssize_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_sendfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <sendfile@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0xffffffffffffffff,-0x28(%rbp)
jne    1165 <__sulong_posix_sendfile+0x55>
xor    %eax,%eax
mov    0x2e83(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%ecx
mov    0x2e71(%rip),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_sendfile>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <sendfile@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i64 @__sulong_posix_sendfile(i32 %0, i32 %1, i32* %2, i64 %3) {
%5 = load i32, i32* @errno
%6 = tail call i64 @sendfile(i32 %0, i32 %1, i32* %2, i64 %3)
%7 = icmp eq i64 %6, -1
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
%11 = select i1 %7, i64 %10, i64 %6
store i32 %5, i32* @errno
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ VIDEO_SLOWMOTION;
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int videoSlowMotion(int fd, int nframes) {
  int ans;
  if ((ans = ioctl(fd, VIDEO_SLOWMOTION, nframes) < 0)) {
    perror("VIDEO SLOWMOTION: ");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<videoSlowMotion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
test   $0x1,%al
jne    1161 <videoSlowMotion+0x41>
jmp    1179 <videoSlowMotion+0x59>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <videoSlowMotion+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoSlowMotion>:
push   %rax
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     113d <videoSlowMotion+0x1d>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@VIDEO_SLOWMOTION = global i32 0
@.str = [19 x i8] c"VIDEO SLOWMOTION: \00"
define i32 @videoSlowMotion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @VIDEO_SLOWMOTION
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
br i1 %11, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@VIDEO_SLOWMOTION = global i32 0
@.str = [19 x i8] c"VIDEO SLOWMOTION: \00"
define i32 @videoSlowMotion(i32 %0, i32 %1) {
%3 = load i32, i32* @VIDEO_SLOWMOTION
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fatal(const char *s) {
  (void)fprintf(stderr, "%s\n", s);
  exit(-1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
const char *str_stmt_return() { return "return"; }


x86 assembly (clang, -O0):
<str_stmt_return>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_stmt_return>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"return\00"
define i8* @str_stmt_return() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"return\00"
define i8* @str_stmt_return() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void soundb_report_driver_all(char *s, unsigned size) { *s = 0; }


x86 assembly (clang, -O0):
<soundb_report_driver_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundb_report_driver_all>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @soundb_report_driver_all(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret void
}
double test_frexp(double x, int *y) { return __builtin_frexp(x, y); }


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

x86 assembly (clang, -O2):
<test_frexp>:
jmp    1030 <frexp@plt>

LLVM IR (-O0):
define double @test_frexp(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
%5 = load double, double* %3
%6 = load i32*, i32** %4
%7 = call double @frexp(double %5, i32* %6)
ret double %7
}

LLVM IR (-O2):
define double @test_frexp(double %0, i32* nocapture %1) {
%3 = tail call double @frexp(double %0, i32* %1)
ret double %3
}
/* Type definitions */
struct annoStreamer {
  int dummy;
};
struct annoGrator {
  int dummy;
};
struct annoAssembly {
  int dummy;
};

/* Variables and functions */
struct annoGrator *annoGrateWigNew(struct annoStreamer *);
struct annoStreamer *annoStreamBigWigNew(char *, struct annoAssembly *);
struct annoGrator *annoGrateBigWigNew(char *fileOrUrl,
                                      struct annoAssembly *aa) {
  struct annoStreamer *bigWigSource = annoStreamBigWigNew(fileOrUrl, aa);
  return annoGrateWigNew(bigWigSource);
}


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

x86 assembly (clang, -O2):
<annoGrateBigWigNew>:
push   %rax
call   1040 <annoStreamBigWigNew@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <annoGrateWigNew@plt>

LLVM IR (-O0):
%struct.annoGrator = type { i32 }
%struct.annoAssembly = type { i32 }
%struct.annoStreamer = type { i32 }
define %struct.annoGrator* @annoGrateBigWigNew(i8* %0, %struct.annoAssembly* %1) {
%3 = alloca i8*
%4 = alloca %struct.annoAssembly*
%5 = alloca %struct.annoStreamer*
store i8* %0, i8** %3
store %struct.annoAssembly* %1, %struct.annoAssembly** %4
%6 = load i8*, i8** %3
%7 = load %struct.annoAssembly*, %struct.annoAssembly** %4
%8 = call %struct.annoStreamer* @annoStreamBigWigNew(i8* %6, %struct.annoAssembly* %7)
store %struct.annoStreamer* %8, %struct.annoStreamer** %5
%9 = load %struct.annoStreamer*, %struct.annoStreamer** %5
%10 = call %struct.annoGrator* @annoGrateWigNew(%struct.annoStreamer* %9)
ret %struct.annoGrator* %10
}

LLVM IR (-O2):
%struct.annoGrator = type { i32 }
%struct.annoAssembly = type { i32 }
%struct.annoStreamer = type { i32 }
define %struct.annoGrator* @annoGrateBigWigNew(i8* %0, %struct.annoAssembly* %1) {
%3 = tail call %struct.annoStreamer* @annoStreamBigWigNew(i8* %0, %struct.annoAssembly* %1)
%4 = tail call %struct.annoGrator* @annoGrateWigNew(%struct.annoStreamer* %3)
ret %struct.annoGrator* %4
}
void delay() {
  volatile unsigned long x = 0xffff;
  while (x--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movq   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     112a <delay+0x2a>
jmp    110c <delay+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movq   $0xffff,-0x8(%rsp)
nopl   0x0(%rax)
subq   $0x1,-0x8(%rsp)
jae    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca i64
store volatile i64 65535, i64* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i64, i64* %1
%4 = add i64 %3, -1
store volatile i64 %4, i64* %1
%5 = icmp ne i64 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store volatile i64 65535, i64* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i64, i64* %1
%5 = add i64 %4, -1
store volatile i64 %5, i64* %1
%6 = icmp eq i64 %4, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
/* Type definitions */
struct RNAsubopt_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAsubopt_args_info *);
int /*<<< orphan*/ clear_given(struct RNAsubopt_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAsubopt_args_info *);
void RNAsubopt_cmdline_parser_init(struct RNAsubopt_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAsubopt_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAsubopt_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAsubopt_args_info = type { i32 }
define void @RNAsubopt_cmdline_parser_init(%struct.RNAsubopt_args_info* %0) {
%2 = alloca %struct.RNAsubopt_args_info*
store %struct.RNAsubopt_args_info* %0, %struct.RNAsubopt_args_info** %2
%3 = load %struct.RNAsubopt_args_info*, %struct.RNAsubopt_args_info** %2
%4 = call i32 @clear_given(%struct.RNAsubopt_args_info* %3)
%5 = load %struct.RNAsubopt_args_info*, %struct.RNAsubopt_args_info** %2
%6 = call i32 @clear_args(%struct.RNAsubopt_args_info* %5)
%7 = load %struct.RNAsubopt_args_info*, %struct.RNAsubopt_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAsubopt_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAsubopt_args_info = type { i32 }
define void @RNAsubopt_cmdline_parser_init(%struct.RNAsubopt_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAsubopt_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAsubopt_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAsubopt_args_info* %0)
ret void
}
/* Variables and functions */
bool nrf52_errata_171(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_171() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_anl_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "ANL   A, "
          "0x%02X"
          "                   ",
          direct);
}


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

x86 assembly (clang, -O2):
<fprint_anl_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"ANL A, 0x%02X \00"
define void @fprint_anl_direct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"ANL A, 0x%02X \00"
define void @fprint_anl_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LINUX_REBOOT_MAGIC1;
int /*<<< orphan*/ LINUX_REBOOT_MAGIC2;
int /*<<< orphan*/ __NR_reboot;
int /*<<< orphan*/ sync();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ unmount_all();
void call_reboot(int cmd) {
  unmount_all();
  sync();
  syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, NULL);
}


x86 assembly (clang, -O0):
<call_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <unmount_all@plt>
mov    $0x0,%al
call   1040 <sync@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_reboot>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <unmount_all@plt>
xor    %eax,%eax
call   1040 <sync@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    0x2e76(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define void @call_reboot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @unmount_all()
%4 = call i32 (...) @sync()
%5 = load i32, i32* @__NR_reboot
%6 = load i32, i32* @LINUX_REBOOT_MAGIC1
%7 = load i32, i32* @LINUX_REBOOT_MAGIC2
%8 = load i32, i32* %2
%9 = call i32 @syscall(i32 %5, i32 %6, i32 %7, i32 %8, i32* null)
ret void
}

LLVM IR (-O2):
@__NR_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define void @call_reboot(i32 %0) {
%2 = tail call i32 (...) @unmount_all()
%3 = tail call i32 (...) @sync()
%4 = load i32, i32* @__NR_reboot
%5 = load i32, i32* @LINUX_REBOOT_MAGIC1
%6 = load i32, i32* @LINUX_REBOOT_MAGIC2
%7 = tail call i32 @syscall(i32 %4, i32 %5, i32 %6, i32 %0, i32* null)
ret void
}
/* Variables and functions */
void rd_close_file(int fd) { return; }


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

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

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

LLVM IR (-O2):
define void @rd_close_file(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *, int);
void bar(void *p, int x) { foo(p, x + 1); }


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

x86 assembly (clang, -O2):
<bar>:
add    $0x1,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i32 @foo(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @bar(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 @foo(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
size_t hashFunction(const char *key, size_t number_of_rows) {
  unsigned sum = 0;
  while ('\0' != *key) {
    sum += key[0];
    key++;
  }
  return sum % number_of_rows;
}


x86 assembly (clang, -O0):
<hashFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1142 <hashFunction+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <hashFunction+0x13>
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFunction>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <hashFunction+0x22>
add    $0x1,%rdi
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashFunction+0x10>
mov    %eax,%eax
cmp    %rsi,%rax
jb     112d <hashFunction+0x2d>
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i64 @hashFunction(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i32 [ %10, %5 ], [ 0, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = add i32 %7, %9
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = zext i32 %10 to i64
br label %16
16: ; preds = %14, %2
%17 = phi i64 [ 0, %2 ], [ %15, %14 ]
%18 = urem i64 %17, %1
ret i64 %18
}
unsigned xrop3_12_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_12_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_12_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %7
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_12_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}