xunge/DecIR huggingface dataset:
/* Variables and functions */
bool isprime(long long unsigned int num) {
  long long unsigned int i = 1;
  if (num <= 0 || num == 1)
    return 0;
  while (++i < num)
    if (num % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1126 <isprime+0x26>
cmpq   $0x1,-0x10(%rbp)
jne    1132 <isprime+0x32>
movl   $0x0,-0x4(%rbp)
jmp    117b <isprime+0x7b>
jmp    1137 <isprime+0x37>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
jae    1174 <isprime+0x74>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    116f <isprime+0x6f>
movl   $0x0,-0x4(%rbp)
jmp    117b <isprime+0x7b>
jmp    1137 <isprime+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     113c <isprime+0x3c>
mov    $0x2,%ecx
jmp    1121 <isprime+0x21>
nop
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     113a <isprime+0x3a>
cmp    %rcx,%rdi
je     113d <isprime+0x3d>
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
jne    1110 <isprime+0x10>
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
jmp    1118 <isprime+0x18>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = add i64 %0, -1
br label %5
5: ; preds = %3, %9
%6 = phi i64 [ %7, %9 ], [ 1, %3 ]
%7 = add nuw i64 %6, 1
%8 = icmp eq i64 %6, %4
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = urem i64 %0, %7
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %1
%13 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SetPhysByte(int, char);
void outchar(char c) { SetPhysByte(0x800003f8, c); }


x86 assembly (clang, -O0):
<outchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x800003f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <SetPhysByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outchar>:
mov    %edi,%esi
mov    $0x800003f8,%edi
jmp    1030 <SetPhysByte@plt>

LLVM IR (-O0):
define void @outchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @SetPhysByte(i32 -2147482632, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @outchar(i8 signext %0) {
%2 = tail call i32 @SetPhysByte(i32 -2147482632, i8 signext %0)
ret void
}
/* Variables and functions */
int __test() {
  bool x = true;
  bool y = false;
  if (x && y) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1132 <__test+0x32>
cmpl   $0x0,-0xc(%rbp)
je     1132 <__test+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <__test+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void put_mem(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<put_mem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @put_mem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
union bpf_attr {
  int /*<<< orphan*/ pathname;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_OBJ_GET;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_obj_get(const char *pathname) {
  union bpf_attr attr;
  attr.pathname = ptr_to_u64((void *)pathname);
  return syscall(321, BPF_OBJ_GET, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_obj_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ptr_to_u64@plt>
mov    %eax,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_obj_get>:
push   %rax
call   1030 <ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1040 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.bpf_attr
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ptr_to_u64(i8* %4)
%6 = bitcast %union.bpf_attr* %3 to i32*
store i32 %5, i32* %6
%7 = load i32, i32* @BPF_OBJ_GET
%8 = call i32 @syscall(i32 321, i32 %7, %union.bpf_attr* %3, i32 4)
ret i32 %8
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_OBJ_GET = global i32 0
define i32 @bpf_obj_get(i8* %0) {
%2 = alloca %union.bpf_attr
%3 = bitcast %union.bpf_attr* %2 to i8*
%4 = tail call i32 @ptr_to_u64(i8* %0)
%5 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @BPF_OBJ_GET
%7 = call i32 @syscall(i32 321, i32 %6, %union.bpf_attr* %2, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test50_helper(double, double);
void test50(double d, double e) { test50_helper(d, e); }


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

x86 assembly (clang, -O2):
<test50>:
jmp    1030 <test50_helper@plt>

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

LLVM IR (-O2):
define void @test50(double %0, double %1) {
%3 = tail call i32 @test50_helper(double %0, double %1)
ret void
}
/* Variables and functions */
int bar(int, int);
int foo(int a, int b) {
  int c;
  c = bar(b - a, b * a);
  return c;
}


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

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%eax
sub    %edi,%eax
imul   %edi,%esi
mov    %eax,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = call i32 @bar(i32 %8, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = mul nsw i32 %1, %0
%5 = tail call i32 @bar(i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo() {
  int index = 0;
  for (index; index <= 10; index--)
    bar((0xcafe + index) * 0xdead);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     114a <foo+0x3a>
mov    -0x4(%rbp),%eax
add    $0xcafe,%eax
imul   $0xdead,%eax,%edi
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0xb09171a6,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <bar@plt>
add    $0xffff2153,%ebx
jmp    1120 <foo+0x10>

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = add nsw i32 51966, %7
%9 = mul nsw i32 %8, 57005
%10 = call i32 @bar(i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, -1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = mul i32 %2, 57005
%4 = add i32 %3, -1332645466
%5 = tail call i32 @bar(i32 %4)
%6 = add nsw i32 %2, -1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ revelation();
int main() {
  revelation();
  char buf0[10];
  gets(buf0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <revelation@plt>
lea    -0xa(%rbp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1040 <revelation@plt>
lea    0xe(%rsp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = call i32 (...) @revelation()
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = tail call i32 (...) @revelation()
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
ret i32 0
}
int main() {
  long long a = 4L;
  return a;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int seek_to(FILE *in, long offset) { return fseek(in, offset, SEEK_SET); }


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

x86 assembly (clang, -O2):
<seek_to>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @seek_to(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %5, i64 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @seek_to(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %3)
ret i32 %4
}
void foo662() {}


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

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

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

LLVM IR (-O2):
define void @foo662() {
ret void
}
void __attribute__((weak)) i2c3_ev_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<i2c3_ev_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c3_ev_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.i2c3_ev_isr = [12 x i8] c"i2c3_ev_isr\00"
define weak void @i2c3_ev_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c3_ev_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.i2c3_ev_isr = [12 x i8] c"i2c3_ev_isr\00"
define weak void @i2c3_ev_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c3_ev_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool nrf52_errata_131(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_131() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(int argc, char **argv) {
#pragma acc kernels
  {
    if (argc != 1)
      abort();
  }
  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)
cmpl   $0x1,-0x8(%rbp)
je     1137 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jne    1118 <main+0x8>
xor    %eax,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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 = load i32, i32* %4
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int);
int /*<<< orphan*/ emit_rotl(int);
int /*<<< orphan*/ emit_shrimm(int, int, int);
void emit_rotlsr(int t, int sr) {
  emit_shrimm(sr, 1, sr);
  emit_rotl(t);
  emit_adc(sr, sr);
}


x86 assembly (clang, -O0):
<emit_rotlsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_shrimm@plt>
mov    -0x4(%rbp),%edi
call   1040 <emit_rotl@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <emit_adc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_rotlsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <emit_shrimm@plt>
mov    %ebp,%edi
call   1040 <emit_rotl@plt>
mov    %ebx,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <emit_adc@plt>

LLVM IR (-O0):
define void @emit_rotlsr(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 = load i32, i32* %4
%7 = call i32 @emit_shrimm(i32 %5, i32 1, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @emit_rotl(i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @emit_adc(i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @emit_rotlsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_shrimm(i32 %1, i32 1, i32 %1)
%4 = tail call i32 @emit_rotl(i32 %0)
%5 = tail call i32 @emit_adc(i32 %1, i32 %1)
ret void
}
unsigned convert_mantissa(unsigned i) {
  unsigned m = i << 13;
  unsigned e = 0;
  while (!(m & 0x00800000)) {
    m <<= 1;
    e -= 0x00800000;
  }
  m &= ~0x00800000;
  e += 0x38800000;
  return m | e;
}


x86 assembly (clang, -O0):
<convert_mantissa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <convert_mantissa+0x34>
jmp    114d <convert_mantissa+0x4d>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x800000,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <convert_mantissa+0x17>
mov    -0x8(%rbp),%eax
and    $0xff7fffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x38800000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_mantissa>:
mov    %edi,%edx
shl    $0xd,%edx
mov    $0x38800000,%ecx
test   $0x400,%edi
jne    1135 <convert_mantissa+0x35>
mov    $0x38800000,%ecx
nopw   0x0(%rax,%rax,1)
lea    (%rdx,%rdx,1),%eax
add    $0xff800000,%ecx
test   $0x400000,%edx
mov    %eax,%edx
je     1120 <convert_mantissa+0x20>
jmp    1137 <convert_mantissa+0x37>
mov    %edx,%eax
and    $0xff7fe000,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @convert_mantissa(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 13
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %12, %1
%8 = load i32, i32* %3
%9 = and i32 %8, 8388608
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = sub i32 %15, 8388608
store i32 %16, i32* %4
br label %7
17: ; preds = %7
%18 = load i32, i32* %3
%19 = and i32 %18, -8388609
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = add i32 %20, 947912704
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = or i32 %22, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @convert_mantissa(i32 %0) {
%2 = shl i32 %0, 13
%3 = and i32 %0, 1024
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i32 [ %8, %5 ], [ %2, %1 ]
%8 = shl i32 %7, 1
%9 = add i32 %6, -8388608
%10 = and i32 %7, 4194304
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5
%13 = add i32 %6, 939524096
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ %2, %1 ], [ %8, %12 ]
%16 = phi i32 [ 947912704, %1 ], [ %13, %12 ]
%17 = and i32 %15, -8396800
%18 = or i32 %16, %17
ret i32 %18
}
void InitializeSPI() { ; }


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

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

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

LLVM IR (-O2):
define void @InitializeSPI() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBOTGSessionRequest(uint32_t ui32Base, bool bStart) {
  ;
  if (bStart) {
    (*((volatile unsigned char *)(ui32Base + 0x00000060))) |= 0x00000001;
  } else {
    (*((volatile unsigned char *)(ui32Base + 0x00000060))) &= ~0x00000001;
  }
}


x86 assembly (clang, -O0):
<USBOTGSessionRequest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112a <USBOTGSessionRequest+0x2a>
mov    -0x8(%rbp),%rax
mov    0x60(%rax),%cl
movzbl %cl,%ecx
or     $0x1,%ecx
mov    %cl,0x60(%rax)
jmp    113a <USBOTGSessionRequest+0x3a>
mov    -0x8(%rbp),%rax
mov    0x60(%rax),%cl
movzbl %cl,%ecx
and    $0xfffffffe,%ecx
mov    %cl,0x60(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBOTGSessionRequest>:
test   %esi,%esi
setne  %al
mov    0x60(%rdi),%cl
and    $0xfe,%cl
or     %al,%cl
mov    %cl,0x60(%rdi)
ret

LLVM IR (-O0):
define void @USBOTGSessionRequest(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 96
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
store volatile i8 %14, i8* %10
br label %23
15: ; preds = %2
%16 = load i64, i64* %3
%17 = add nsw i64 %16, 96
%18 = inttoptr i64 %17 to i8*
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, -2
%22 = trunc i32 %21 to i8
store volatile i8 %22, i8* %18
br label %23
23: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @USBOTGSessionRequest(i64 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = add nsw i64 %0, 96
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = and i8 %6, -2
%8 = zext i1 %3 to i8
%9 = or i8 %7, %8
store volatile i8 %9, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mcalign_push() {
  printf("NOT IMPLEMENTED:"
         "pa_mcalign_push"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_mcalign_push\0A\00"
define i32 @pa_mcalign_push() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_mcalign_push\00"
define i32 @pa_mcalign_push() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int height = 15;
  int width = 12;
  int area;
  area = height * width;
  printf("The height is %d, the width is %d.\n", height, width);
  printf("And the area is : %d \n", area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
movl   $0xc,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xf,%esi
mov    $0xc,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0xb4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"The height is %d, the width is %d.\0A\00"
@.str.1 = [23 x i8] c"And the area is : %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
store i32 12, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The height is %d, the width is %d.\0A\00"
@.str.1 = [23 x i8] c"And the area is : %d \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 15, i32 12)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 180)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_dobldobl_homotopy(int fixed_gamma, double regamma,
                                 double imgamma) {
  int fail, *b;
  double c[2];
  c[0] = regamma;
  c[1] = imgamma;
  fail = _ada_use_c2phc4c(501, &fixed_gamma, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_dobldobl_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x1f5,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @initialize_dobldobl_homotopy(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca [2 x double]
store i32 %0, 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 %1, double* %7
%8 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
store double %2, double* %8
%9 = call i32 @_ada_use_c2phc4c(i32 501, i32* %4, i32* undef, double* %7, i32 0)
ret i32 %9
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long GetDate_us(void) {
  static unsigned long InitDate = 0;
  struct timespec t1;
  clock_gettime(CLOCK_MONOTONIC, &t1);
  return (t1.tv_sec * 1000000 + t1.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<GetDate_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDate_us>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@GetDate_us.InitDate = internal global i64 0
@CLOCK_MONOTONIC = global i32 0
define i64 @GetDate_us() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @GetDate_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _quickSort(struct Node *, struct Node *);
struct Node *lastNode(struct Node *);
void quickSort(struct Node *head) {
  struct Node *h = lastNode(head);
  _quickSort(head, h);
}


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

x86 assembly (clang, -O2):
<quickSort>:
push   %rbx
mov    %rdi,%rbx
call   1040 <lastNode@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <_quickSort@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @quickSort(%struct.Node* %0) {
%2 = alloca %struct.Node*
%3 = alloca %struct.Node*
store %struct.Node* %0, %struct.Node** %2
%4 = load %struct.Node*, %struct.Node** %2
%5 = call %struct.Node* @lastNode(%struct.Node* %4)
store %struct.Node* %5, %struct.Node** %3
%6 = load %struct.Node*, %struct.Node** %2
%7 = load %struct.Node*, %struct.Node** %3
%8 = call i32 @_quickSort(%struct.Node* %6, %struct.Node* %7)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @quickSort(%struct.Node* %0) {
%2 = tail call %struct.Node* @lastNode(%struct.Node* %0)
%3 = tail call i32 @_quickSort(%struct.Node* %0, %struct.Node* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int dup2(int, int);
int maybe_dup2(int oldfd, int newfd, fd_set *ignore) {
  if (ignore && FD_ISSET(newfd, ignore)) {
    return 0;
  }
  return dup2(oldfd, newfd) == newfd ? 0 : -1;
}


x86 assembly (clang, -O0):
<maybe_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <maybe_dup2+0x3f>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <FD_ISSET@plt>
cmp    $0x0,%rax
je     115f <maybe_dup2+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    117e <maybe_dup2+0x5e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <dup2@plt>
mov    %eax,%edx
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybe_dup2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %rdx,%rdx
je     1140 <maybe_dup2+0x20>
mov    %ebx,%edi
mov    %rdx,%rsi
call   1030 <FD_ISSET@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1154 <maybe_dup2+0x34>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <dup2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setne  %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @maybe_dup2(i32 %0, i32 %1, i32* %2) {
%4 = icmp eq i32* %2, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i64 @FD_ISSET(i32 %1, i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5, %3
%9 = tail call i32 @dup2(i32 %0, i32 %1)
%10 = icmp ne i32 %9, %1
%11 = sext i1 %10 to i32
br label %12
12: ; preds = %5, %8
%13 = phi i32 [ %11, %8 ], [ 0, %5 ]
ret i32 %13
}
char *PlatformReadFile(const char *FileName) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @PlatformReadFile(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ MAX7219WriteByte(int /*<<< orphan*/, int, int);
int MAX7219CleanScreen() {
  int i, address, data;
  data = 0;
  for (i = 0; i < 8; i++) {
    address = i + 1;
    MAX7219WriteByte(0, address, data);
  }
  return 0;
}


x86 assembly (clang, -O0):
<MAX7219CleanScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    1154 <MAX7219CleanScreen+0x44>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <MAX7219WriteByte@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <MAX7219CleanScreen+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAX7219CleanScreen>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %edi,%edi
mov    $0x8,%esi
xor    %edx,%edx
call   1030 <MAX7219WriteByte@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @MAX7219CleanScreen() {
%1 = tail call i32 @MAX7219WriteByte(i32 0, i32 1, i32 0)
%2 = tail call i32 @MAX7219WriteByte(i32 0, i32 2, i32 0)
%3 = tail call i32 @MAX7219WriteByte(i32 0, i32 3, i32 0)
%4 = tail call i32 @MAX7219WriteByte(i32 0, i32 4, i32 0)
%5 = tail call i32 @MAX7219WriteByte(i32 0, i32 5, i32 0)
%6 = tail call i32 @MAX7219WriteByte(i32 0, i32 6, i32 0)
%7 = tail call i32 @MAX7219WriteByte(i32 0, i32 7, i32 0)
%8 = tail call i32 @MAX7219WriteByte(i32 0, i32 8, i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int nums[] = {4, 5, 6, 7, 0, 1, 2};
  printf("%d\n", search(nums, sizeof(nums) / 4, 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
xor    %edx,%edx
call   1040 <search@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.nums = [7 x i32] [i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i32]
%4 = bitcast [7 x i32]* %3 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%6 = call i32 @search(i32* %5, i32 7, i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int write_settings_file(char *, char *, char *, char *);
int create_default_settings_file() {
  return write_settings_file("<YourAccessKey>", "<YourSecretKey>",
                             "<YourS3Host>", "<YourDefaultBucket>");
}


x86 assembly (clang, -O0):
<create_default_settings_file>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xef7(%rip),%rdx
lea    0xefd(%rip),%rcx
call   1030 <write_settings_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_default_settings_file>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xf01(%rip),%rcx
jmp    1030 <write_settings_file@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"<YourAccessKey>\00"
@.str.1 = [16 x i8] c"<YourSecretKey>\00"
@.str.2 = [13 x i8] c"<YourS3Host>\00"
@.str.3 = [20 x i8] c"<YourDefaultBucket>\00"
define i32 @create_default_settings_file() {
%1 = call i32 @write_settings_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"<YourAccessKey>\00"
@.str.1 = [16 x i8] c"<YourSecretKey>\00"
@.str.2 = [13 x i8] c"<YourS3Host>\00"
@.str.3 = [20 x i8] c"<YourDefaultBucket>\00"
define i32 @create_default_settings_file() {
%1 = tail call i32 @write_settings_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
ret i32 %1
}
void fn(void) {
  const int a = 10;
  const long unsigned int b = (sizeof(int) * 8 - 1);
  int k1 = a << b;
  int k2 = 10 << b;
  int k3 = a << (sizeof(int) * 8 - 1);
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movq   $0x1f,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fn() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %1
store i64 31, i64* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
ret void
}

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

/* Variables and functions */
int ibv_query_device(struct ibv_context *, struct ibv_device_attr *);
int mlx4_glue_query_device(struct ibv_context *context,
                           struct ibv_device_attr *device_attr) {
  return ibv_query_device(context, device_attr);
}


x86 assembly (clang, -O0):
<mlx4_glue_query_device>:
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 <ibv_query_device@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlx4_glue_query_device>:
jmp    1030 <ibv_query_device@plt>

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_device_attr = type { i32 }
define i32 @mlx4_glue_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1) {
%3 = alloca %struct.ibv_context*
%4 = alloca %struct.ibv_device_attr*
store %struct.ibv_context* %0, %struct.ibv_context** %3
store %struct.ibv_device_attr* %1, %struct.ibv_device_attr** %4
%5 = load %struct.ibv_context*, %struct.ibv_context** %3
%6 = load %struct.ibv_device_attr*, %struct.ibv_device_attr** %4
%7 = call i32 @ibv_query_device(%struct.ibv_context* %5, %struct.ibv_device_attr* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_device_attr = type { i32 }
define i32 @mlx4_glue_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1) {
%3 = tail call i32 @ibv_query_device(%struct.ibv_context* %0, %struct.ibv_device_attr* %1)
ret i32 %3
}
/* Variables and functions */
float cos(float);
float sin(float);
float compute(float x, float y) {
  float func;
  func = (sin(x) + cos(y)) / (sin(x) - cos(y));
  return func;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movss  -0x14(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x10(%rbp),%xmm0
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
sub    $0x18,%rsp
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <sin@plt>
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
call   1040 <cos@plt>
addss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <sin@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
call   1040 <cos@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  0x10(%rsp),%xmm0
divss  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @compute(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = call float @sin(float %6)
%8 = load float, float* %4
%9 = call float @cos(float %8)
%10 = fadd float %7, %9
%11 = load float, float* %3
%12 = call float @sin(float %11)
%13 = load float, float* %4
%14 = call float @cos(float %13)
%15 = fsub float %12, %14
%16 = fdiv float %10, %15
store float %16, float* %5
%17 = load float, float* %5
ret float %17
}

LLVM IR (-O2):
define float @compute(float %0, float %1) {
%3 = tail call float @sin(float %0)
%4 = tail call float @cos(float %1)
%5 = fadd float %3, %4
%6 = tail call float @sin(float %0)
%7 = tail call float @cos(float %1)
%8 = fsub float %6, %7
%9 = fdiv float %5, %8
ret float %9
}
isword(c) int c;
{
  static char special[] = ".%_-$@";
  return (isalnum(c) || isin(special, c));
}


x86 assembly (clang, -O0):
<isword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115d <isword+0x3d>
mov    -0x4(%rbp),%esi
lea    0x2ee3(%rip),%rdi
mov    $0x0,%al
call   1040 <isin@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isword>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1135 <isword+0x15>
pop    %rbx
ret
lea    0x2ef4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <isin@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@isword.special = internal global [7 x i8] c".%_-$@\00"
define i32 @isword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isalnum(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @isin to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @isword.special, i64 0, i64 0), i32 %7)
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@isword.special = internal global [7 x i8] c".%_-$@\00"
define i32 @isword(i32 %0) {
%2 = tail call i32 @isalnum(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @isin to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @isword.special, i64 0, i64 0), i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ FlightBatterySettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightBatterySettingsRequestUpdate() {
  UAVObjRequestUpdate(FlightBatterySettingsHandle());
}


x86 assembly (clang, -O0):
<FlightBatterySettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FlightBatterySettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightBatterySettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FlightBatterySettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FlightBatterySettingsRequestUpdate() {
%1 = call i32 (...) @FlightBatterySettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightBatterySettingsRequestUpdate() {
%1 = tail call i32 (...) @FlightBatterySettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}