xunge/DecIR huggingface dataset:
void flash_ram_copy_end() { asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @flash_ram_copy_end() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double overflow(x)
double x;
{
  double y;
  do {
    y = x;
    x *= x;
  } while (y != x);
  return x;
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    1109 <overflow+0x9>
jp     1109 <overflow+0x9>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1100 <overflow>
jp     1100 <overflow>
ret

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

LLVM IR (-O2):
define double @overflow(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi double [ %0, %1 ], [ %4, %2 ]
%4 = fmul double %3, %3
%5 = fcmp une double %3, %4
br i1 %5, label %2, label %6
6: ; preds = %2
ret double %4
}
double flesch(int syllables, int words, int sentences) {
  return 206.835 - 84.6 * (((double)syllables) / words) -
         1.015 * (((double)words) / sentences);
}


x86 assembly (clang, -O0):
<flesch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xee5(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
addsd  %xmm0,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
divsd  %xmm2,%xmm0
movsd  0xeb7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<flesch>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
divsd  %xmm0,%xmm1
mulsd  0xeec(%rip),%xmm1
addsd  0xeec(%rip),%xmm1
cvtsi2sd %edx,%xmm2
divsd  %xmm2,%xmm0
mulsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @flesch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = call double @llvm.fmuladd.f64(double -8.460000e+01, double %11, double 2.068350e+02)
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %6
%16 = sitofp i32 %15 to double
%17 = fdiv double %14, %16
%18 = call double @llvm.fmuladd.f64(double -1.015000e+00, double %17, double %12)
ret double %18
}

LLVM IR (-O2):
define double @flesch(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double -8.460000e+01, double 2.068350e+02)
%8 = sitofp i32 %2 to double
%9 = fdiv double %5, %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double -1.015000e+00, double %7)
ret double %10
}
/* Variables and functions */
scalar_t__ kill_proc_fn(int, int, char const *);
scalar_t__ wait_proc_fn(int, char const *);
int kill_and_wait_proc_fn(int id, int sgnl, const char *id_str) {
  if (kill_proc_fn(id, sgnl, id_str) != 0) {
    return -1;
  }
  if (wait_proc_fn(id, id_str) != 0) {
    return -2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<kill_and_wait_proc_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <kill_proc_fn@plt>
cmp    $0x0,%rax
je     1157 <kill_and_wait_proc_fn+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <kill_and_wait_proc_fn+0x60>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <wait_proc_fn@plt>
cmp    $0x0,%rax
je     1179 <kill_and_wait_proc_fn+0x59>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1180 <kill_and_wait_proc_fn+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_and_wait_proc_fn>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
call   1030 <kill_proc_fn@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1152 <kill_and_wait_proc_fn+0x32>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <wait_proc_fn@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @kill_and_wait_proc_fn(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @kill_proc_fn(i32 %0, i32 %1, i8* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @wait_proc_fn(i32 %0, i8* %2)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 0, i32 -2
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void err_handling(char *message) {
  printf(message, stderr);
  printf("\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<err_handling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_handling>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @err_handling(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @printf(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
void INT_UART0_RX(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_UART0_RX() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ dopr(char *, size_t, size_t *, char const *,
                        int /*<<< orphan*/);
int uuid_str_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  size_t retlen;
  if (str != NULL)
    str[0] = '\0';
  dopr(str, count, &retlen, fmt, args);
  return retlen;
}


x86 assembly (clang, -O0):
<uuid_str_vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <uuid_str_vsnprintf+0x29>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
lea    -0x28(%rbp),%rdx
call   1030 <dopr@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uuid_str_vsnprintf>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
test   %rdi,%rdi
je     111f <uuid_str_vsnprintf+0xf>
movb   $0x0,(%rdi)
mov    %rsp,%rdx
call   1030 <dopr@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @uuid_str_vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = bitcast i64* %5 to i8*
%7 = icmp eq i8* %0, null
br i1 %7, label %9, label %8
8: ; preds = %4
store i8 0, i8* %0
br label %9
9: ; preds = %8, %4
%10 = call i32 @dopr(i8* %0, i64 %1, i64* %5, i8* %2, i32 %3)
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ begin(char *);
int /*<<< orphan*/ getLibraryParameterValueReal(char *);
int /*<<< orphan*/ lineWidth(int /*<<< orphan*/);
int /*<<< orphan*/ setLayer(int);
int /*<<< orphan*/ setWireBend(int /*<<< orphan*/);
void beginCourtyard(int layer) {
  setLayer(layer);
  setWireBend(0);
  begin("WIRE");
  lineWidth(getLibraryParameterValueReal("courtyardLineWidth"));
}


x86 assembly (clang, -O0):
<beginCourtyard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <setLayer@plt>
xor    %edi,%edi
call   1070 <setWireBend@plt>
lea    0xe8f(%rip),%rdi
call   1050 <begin@plt>
lea    0xe88(%rip),%rdi
call   1060 <getLibraryParameterValueReal@plt>
mov    %eax,%edi
call   1040 <lineWidth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beginCourtyard>:
push   %rax
call   1030 <setLayer@plt>
xor    %edi,%edi
call   1070 <setWireBend@plt>
lea    0xe9c(%rip),%rdi
call   1050 <begin@plt>
lea    0xe95(%rip),%rdi
call   1060 <getLibraryParameterValueReal@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lineWidth@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"WIRE\00"
@.str.1 = [19 x i8] c"courtyardLineWidth\00"
define void @beginCourtyard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @setLayer(i32 %3)
%5 = call i32 @setWireBend(i32 0)
%6 = call i32 @begin(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @getLibraryParameterValueReal(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @lineWidth(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"WIRE\00"
@.str.1 = [19 x i8] c"courtyardLineWidth\00"
define void @beginCourtyard(i32 %0) {
%2 = tail call i32 @setLayer(i32 %0)
%3 = tail call i32 @setWireBend(i32 0)
%4 = tail call i32 @begin(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @getLibraryParameterValueReal(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @lineWidth(i32 %5)
ret void
}
/* Variables and functions */
int sedge_main_loop();
int main(int argc, char *argv[]) {
  int error_code = 0;
  error_code = sedge_main_loop();
  return error_code;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <sedge_main_loop@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (...) @sedge_main_loop()
store i32 %7, i32* %6
%8 = load i32, i32* %6
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sedge_main_loop()
ret i32 %3
}
/* Variables and functions */
int nic_probe(int);
int nic_detect(int given) {
  int found;
  if ((found = nic_probe(given)) != -6) {
    return found;
  }
  return -6;
}


x86 assembly (clang, -O0):
<nic_detect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nic_probe@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xfffffffa,%eax
je     113a <nic_detect+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <nic_detect+0x31>
movl   $0xfffffffa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nic_detect>:
jmp    1030 <nic_probe@plt>

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

LLVM IR (-O2):
define i32 @nic_detect(i32 %0) {
%2 = tail call i32 @nic_probe(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ test_small(unsigned long long *);
int main() {
  unsigned long long count = 0;
  srand(3);
  test_small(&count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <srand@plt>
lea    -0x10(%rbp),%rdi
call   1030 <test_small@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    $0x3,%edi
call   1040 <srand@plt>
mov    %rsp,%rdi
call   1030 <test_small@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = call i32 @srand(i32 3)
%4 = call i32 @test_small(i64* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = tail call i32 @srand(i32 3)
%4 = call i32 @test_small(i64* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long);
int long_print_array(long long *myarray) {
  long long i;
  long long size_array = myarray[0];
  for (i = 1; i < size_array; i++) {
    printf("%lld\n", myarray[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<long_print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1166 <long_print_array+0x56>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <long_print_array+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%r12
cmp    $0x2,%r12
jl     1145 <long_print_array+0x35>
mov    %rdi,%r15
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <long_print_array+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @long_print_array(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp sgt i64 %2, 1
br i1 %3, label %4, label %11
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 1, %1 ]
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 0
}
int greater_than(int i0, int i1) { return i0 > i1; }


x86 assembly (clang, -O0):
<greater_than>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater_than>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @greater_than(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @greater_than(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_7Bint16_mem(short *val) {
  return ((*val) & (-0x7B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Bint16_mem>:
movzwl (%rdi),%eax
test   $0xff85,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Bint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -123
%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_7Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -123
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((always_)) io_wait(void) {
  __asm__ volatile("   jmp 1f\n"
                   "1: jmp 2f\n"
                   "2:");
}


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <io_wait+0x9>
jmp    110e <io_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
jmp    1102 <io_wait+0x2>
jmp    1104 <io_wait+0x4>
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect " jmp 1f\0A1: jmp 2f\0A2:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int create_quaddobl_homotopy_with_given_gamma(double gamma_re, double gamma_im,
                                              int pwt) {
  int *b, fail;
  double c[2];
  c[0] = gamma_re;
  c[1] = gamma_im;
  fail = _ada_use_c2phc(183, &pwt, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<create_quaddobl_homotopy_with_given_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0xb7,%edi
lea    -0x14(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_quaddobl_homotopy_with_given_gamma>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0xb7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @create_quaddobl_homotopy_with_given_gamma(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x double]
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%10 = load double, double* %4
%11 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
store double %10, double* %11
%12 = load double, double* %5
%13 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 1
store double %12, double* %13
%14 = load i32*, i32** %7
%15 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%16 = call i32 @_ada_use_c2phc(i32 183, i32* %6, i32* %14, double* %15, i32 0)
store i32 %16, i32* %8
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @create_quaddobl_homotopy_with_given_gamma(double %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca [2 x double]
store i32 %2, i32* %4
%6 = bitcast [2 x double]* %5 to i8*
%7 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
store double %0, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
store double %1, double* %8
%9 = call i32 @_ada_use_c2phc(i32 183, i32* %4, i32* undef, double* %7, i32 0)
ret i32 %9
}
int getRATs(int *list) {
  int c = 0;
  while (*list)
    if ((*list++) < 0)
      c++;
  return c;
}


x86 assembly (clang, -O0):
<getRATs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1142 <getRATs+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
cmpl   $0x0,(%rax)
jge    113d <getRATs+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getRATs+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRATs>:
mov    (%rdi),%ecx
test   %ecx,%ecx
je     1120 <getRATs+0x20>
add    $0x4,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shr    $0x1f,%ecx
add    %ecx,%eax
mov    (%rdi),%ecx
add    $0x4,%rdi
test   %ecx,%ecx
jne    1110 <getRATs+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getRATs(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i32* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = lshr i32 %5, 31
%10 = add nuw nsw i32 %9, %6
%11 = load i32, i32* %8
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double _get_current_time_sec(void) {
  struct timeval time;
  gettimeofday(&time, NULL);
  return (time.tv_sec + time.tv_usec * 0.000001);
}


x86 assembly (clang, -O0):
<_get_current_time_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_current_time_sec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @_get_current_time_sec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @_get_current_time_sec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFREG;
int stat(char *, struct stat *);
int isFile(char *path) {
  int s;
  struct stat info;
  s = stat(path, &info);
  return (s == 0 && (info.st_mode & S_IFREG));
}


x86 assembly (clang, -O0):
<isFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    1150 <isFile+0x40>
mov    -0x10(%rbp),%eax
mov    0x2ea3(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFile>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
sete   %al
mov    0x2ec3(%rip),%rcx
mov    (%rcx),%ecx
and    (%rsp),%ecx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @isFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFREG
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %9, %1
%16 = phi i1 [ false, %1 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @isFile(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IFREG
%9 = and i32 %8, %7
%10 = icmp ne i32 %9, 0
%11 = select i1 %5, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
bool UT32_DIV_OVFCHK(unsigned int a, unsigned int b) {
  (void)(a);
  return !b;
}


x86 assembly (clang, -O0):
<UT32_DIV_OVFCHK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UT32_DIV_OVFCHK>:
xor    %eax,%eax
test   %esi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @UT32_DIV_OVFCHK(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 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @UT32_DIV_OVFCHK(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;

/* Variables and functions */
int hea_test_u64_bit(int /*<<< orphan*/ const, int);
int hea_cq_aer_eq_err_state_err_check(const __u64 *aer) {
  return hea_test_u64_bit(*aer, 12);
}


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

x86 assembly (clang, -O2):
<hea_cq_aer_eq_err_state_err_check>:
mov    (%rdi),%edi
mov    $0xc,%esi
jmp    1030 <hea_test_u64_bit@plt>

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

LLVM IR (-O2):
define i32 @hea_cq_aer_eq_err_state_err_check(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @hea_test_u64_bit(i32 %2, i32 12)
ret i32 %3
}
int in_list(unsigned char *list, int opt) {
  int i;
  if (!list)
    return 1;
  for (i = 0; list[i] != 255; i++)
    if (opt == list[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<in_list>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1122 <in_list+0x22>
movl   $0x1,-0x4(%rbp)
jmp    117d <in_list+0x7d>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xff,%eax
je     1176 <in_list+0x76>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1163 <in_list+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117d <in_list+0x7d>
jmp    1168 <in_list+0x68>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <in_list+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_list>:
mov    $0x1,%eax
test   %rdi,%rdi
je     1135 <in_list+0x35>
mov    (%rdi),%cl
cmp    $0xff,%cl
je     1133 <in_list+0x33>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %cl,%ecx
cmp    %esi,%ecx
je     1135 <in_list+0x35>
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0xff,%cl
jne    1120 <in_list+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @in_list(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 1, i32* %3
br label %34
10: ; preds = %2
store i32 0, i32* %6
br label %11
11: ; preds = %30, %10
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = icmp ne i32 %17, 255
br i1 %18, label %19, label %33
19: ; preds = %11
%20 = load i32, i32* %5
%21 = load i8*, i8** %4
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp eq i32 %20, %26
br i1 %27, label %28, label %29
28: ; preds = %19
store i32 1, i32* %3
br label %34
29: ; preds = %19
br label %30
30: ; preds = %29
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %11
33: ; preds = %11
store i32 0, i32* %3
br label %34
34: ; preds = %33, %28, %9
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @in_list(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, -1
br i1 %6, label %17, label %11
7: ; preds = %11
%8 = getelementptr inbounds i8, i8* %0, i64 %16
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, -1
br i1 %10, label %17, label %11
11: ; preds = %4, %7
%12 = phi i64 [ %16, %7 ], [ 0, %4 ]
%13 = phi i8 [ %9, %7 ], [ %5, %4 ]
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, %1
%16 = add nuw i64 %12, 1
br i1 %15, label %17, label %7
17: ; preds = %11, %7, %4, %2
%18 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 1, %11 ], [ 0, %7 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
int main() {
  if (500 < 40)
    exit(0);
  f(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_addition();
int /*<<< orphan*/ test_complex();
int /*<<< orphan*/ test_division();
int /*<<< orphan*/ test_multiplication();
int /*<<< orphan*/ test_simple();
int /*<<< orphan*/ test_subtraction();
int main(int argc, char *argv[]) {
  test_simple();
  test_addition();
  test_subtraction();
  test_multiplication();
  test_division();
  test_complex();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <test_simple@plt>
mov    $0x0,%al
call   1060 <test_addition@plt>
mov    $0x0,%al
call   1050 <test_subtraction@plt>
mov    $0x0,%al
call   1030 <test_multiplication@plt>
mov    $0x0,%al
call   1040 <test_division@plt>
mov    $0x0,%al
call   1070 <test_complex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_simple@plt>
xor    %eax,%eax
call   1060 <test_addition@plt>
xor    %eax,%eax
call   1050 <test_subtraction@plt>
xor    %eax,%eax
call   1030 <test_multiplication@plt>
xor    %eax,%eax
call   1040 <test_division@plt>
xor    %eax,%eax
call   1070 <test_complex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = call i32 (...) @test_simple()
%7 = call i32 (...) @test_addition()
%8 = call i32 (...) @test_subtraction()
%9 = call i32 (...) @test_multiplication()
%10 = call i32 (...) @test_division()
%11 = call i32 (...) @test_complex()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_simple()
%4 = tail call i32 (...) @test_addition()
%5 = tail call i32 (...) @test_subtraction()
%6 = tail call i32 (...) @test_multiplication()
%7 = tail call i32 (...) @test_division()
%8 = tail call i32 (...) @test_complex()
ret i32 0
}
/* Variables and functions */
int fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int tosFile_stderr(void) { return fileno(stderr); }


x86 assembly (clang, -O0):
<tosFile_stderr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosFile_stderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fileno@plt>

LLVM IR (-O0):
@stderr = global i32 0
define i32 @tosFile_stderr() {
%1 = load i32, i32* @stderr
%2 = call i32 @fileno(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @tosFile_stderr() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fileno(i32 %1)
ret i32 %2
}
void ff_hevc_put_hevc_bi_epel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h12_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "error: not compiled with FEATURE_RFC3195 - terminating.\n");
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"error: not compiled with FEATURE_RFC3195 - terminating.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"error: not compiled with FEATURE_RFC3195 - terminating.\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int main() {
  int a = 42;
  int b = 8;
  int c = a - -b;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 50
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void st_precolos(void) {
  static int lc_a = 0;
  if (lc_a > 5) {
    putchar(',');
  }
  lc_a = 10;
  printf("\n  ");
}


x86 assembly (clang, -O0):
<st_precolos>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x5,0x2f09(%rip)
jle    113b <st_precolos+0x1b>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movl   $0xa,0x2eef(%rip)
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_precolos>:
push   %rax
cmpb   $0x1,0x2f0c(%rip)
jne    1134 <st_precolos+0x14>
mov    $0x2c,%edi
call   1030 <putchar@plt>
movb   $0x1,0x2ef9(%rip)
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@st_precolos.lc_a = internal global i32 0
@.str = [4 x i8] c"\0A \00"
define void @st_precolos() {
%1 = load i32, i32* @st_precolos.lc_a
%2 = icmp sgt i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @putchar(i8 signext 44)
br label %5
5: ; preds = %3, %0
store i32 10, i32* @st_precolos.lc_a
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@st_precolos.lc_a = internal unnamed_addr global i1 false
@.str = [4 x i8] c"\0A \00"
define void @st_precolos() {
%1 = load i1, i1* @st_precolos.lc_a
br i1 %1, label %2, label %4
2: ; preds = %0
%3 = tail call i32 @putchar(i8 signext 44)
br label %4
4: ; preds = %2, %0
store i1 true, i1* @st_precolos.lc_a
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void XtGrabButton() {}


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

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

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

LLVM IR (-O2):
define void @XtGrabButton() {
ret void
}
/* Variables and functions */
char tolower(char);
char *mutilsStrLower(char *str) {
  char *s;
  if (str) {
    for (s = str; *s; ++s)
      *s = tolower(*s);
  }
  return (str);
}


x86 assembly (clang, -O0):
<mutilsStrLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <mutilsStrLower+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <mutilsStrLower+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <mutilsStrLower+0x1f>
jmp    1166 <mutilsStrLower+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutilsStrLower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <mutilsStrLower+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <mutilsStrLower+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <mutilsStrLower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mutilsStrLower(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
void *realloc(void *, int);
void *speex_realloc(void *ptr, int size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<speex_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @speex_realloc(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 = call i8* @realloc(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @speex_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
test(int num, int tot) {
  while (num && tot--)
    num /= 2;
  if (num)
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     112d <test+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113d <test+0x3d>
jmp    1150 <test+0x50>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110a <test+0xa>
cmpl   $0x0,-0x8(%rbp)
je     1166 <test+0x66>
movl   $0x2,-0x4(%rbp)
jmp    116d <test+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
sete   %al
je     1130 <test+0x30>
test   %esi,%esi
je     1130 <test+0x30>
add    $0xffffffff,%esi
xchg   %ax,%ax
lea    0x1(%rdi),%eax
sub    $0x1,%esi
setb   %cl
cmp    $0x3,%eax
setb   %al
jb     1130 <test+0x30>
mov    %edi,%edx
shr    $0x1f,%edx
add    %edi,%edx
sar    %edx
mov    %edx,%edi
test   %cl,%cl
je     1110 <test+0x10>
movzbl %al,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %5
%11 = add nsw i32 %10, -1
store i32 %11, i32* %5
%12 = icmp ne i32 %10, 0
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 2
store i32 %17, i32* %4
br label %6
18: ; preds = %13
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 2, i32* %3
br label %23
22: ; preds = %18
store i32 1, i32* %3
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %1, %2 ]
%8 = phi i32 [ %10, %6 ], [ %0, %2 ]
%9 = add nsw i32 %7, -1
%10 = sdiv i32 %8, 2
%11 = add i32 %8, 1
%12 = icmp ult i32 %11, 3
%13 = icmp eq i32 %9, 0
%14 = select i1 %12, i1 true, i1 %13
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i1 [ %3, %2 ], [ %12, %6 ]
%17 = select i1 %16, i32 1, i32 2
ret i32 %17
}
int test_imm_FCint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xFC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FCint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xfc,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_FCint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 252
%7 = icmp ne i64 %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_FCint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1082331758592
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}