xunge/DecIR huggingface dataset:
/* Variables and functions */
int ZLIBH_inflate(unsigned char *, unsigned char *);
int ZLIBH_decompress(char *dest, const char *compressed) {
  unsigned char *ip = (unsigned char *)compressed;
  unsigned char *op = (unsigned char *)dest;
  int input_used_so_far;
  input_used_so_far = ZLIBH_inflate(op, ip);
  return input_used_so_far;
}


x86 assembly (clang, -O0):
<ZLIBH_decompress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ZLIBH_inflate@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZLIBH_decompress>:
jmp    1030 <ZLIBH_inflate@plt>

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

LLVM IR (-O2):
define i32 @ZLIBH_decompress(i8* %0, i8* %1) {
%3 = tail call i32 @ZLIBH_inflate(i8* %0, i8* %1)
ret i32 %3
}
int console_lock(int timeout) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_lock(i32 %0) {
ret i32 0
}
/* Variables and functions */
int sqrt(long);
int isprime(long int num) {
  int i;
  for (i = 2; i <= sqrt(num); i++)
    if (num % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jg     1175 <isprime+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1162 <isprime+0x52>
movl   $0x0,-0x4(%rbp)
jmp    117c <isprime+0x6c>
jmp    1167 <isprime+0x57>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isprime+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x2,%eax
jl     116f <isprime+0x5f>
mov    $0x1,%ebp
nopl   0x0(%rax)
add    $0x1,%rbp
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1150 <isprime+0x40>
mov    %rbx,%rax
cqto
idiv   %rbp
test   %rdx,%rdx
jne    115b <isprime+0x4b>
jmp    116c <isprime+0x5c>
nop
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
test   %rdx,%rdx
je     116c <isprime+0x5c>
mov    %rbx,%rdi
call   1030 <sqrt@plt>
cltq
cmp    %rax,%rbp
jl     1130 <isprime+0x20>
jmp    116f <isprime+0x5f>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isprime(i64 %0) {
%2 = tail call i32 @sqrt(i64 %0)
%3 = icmp slt i32 %2, 2
br i1 %3, label %13, label %9
4: ; preds = %9
%5 = add nuw nsw i64 %10, 1
%6 = tail call i32 @sqrt(i64 %0)
%7 = sext i32 %6 to i64
%8 = icmp slt i64 %10, %7
br i1 %8, label %9, label %13
9: ; preds = %1, %4
%10 = phi i64 [ %5, %4 ], [ 2, %1 ]
%11 = srem i64 %0, %10
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %9, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %9 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least32_t;

/* Variables and functions */
size_t fmt_int32_base(char *, int /*<<< orphan*/, int);
size_t fmt_int32(char *ptr, uint_least32_t val) {
  return fmt_int32_base(ptr, val, 10);
}


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

x86 assembly (clang, -O2):
<fmt_int32>:
mov    $0xa,%edx
jmp    1030 <fmt_int32_base@plt>

LLVM IR (-O0):
define i64 @fmt_int32(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 i64 @fmt_int32_base(i8* %5, i32 %6, i32 10)
ret i64 %7
}

LLVM IR (-O2):
define i64 @fmt_int32(i8* %0, i32 %1) {
%3 = tail call i64 @fmt_int32_base(i8* %0, i32 %1, i32 10)
ret i64 %3
}
char __gt_func(long double d1, long double d2) { return d1 > d2 ? 1 : 0; }


x86 assembly (clang, -O0):
<__gt_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gt_func>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define signext i8 @__gt_func(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp ogt x86_fp80 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @__gt_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ogt x86_fp80 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x92() {
  Assert_real((isupper(146) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              735, ("isupper should be 0 for 0x92"));
}


x86 assembly (clang, -O0):
<t_isupper_0x92>:
push   %rbp
mov    %rsp,%rbp
mov    $0x92,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2df,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x92>:
push   %rax
mov    $0x92,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2df,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x92\00"
define void @t_isupper_0x92() {
%1 = call i64 @isupper(i32 146)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x92\00"
define void @t_isupper_0x92() {
%1 = tail call i64 @isupper(i32 146)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 735, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_char();
void discard_char(void) { (void)get_char(); }


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

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

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

LLVM IR (-O2):
define void @discard_char() {
%1 = tail call i32 (...) @get_char()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hex_dump(char *, int, unsigned char *, int);
int aa_pro_mic_b04(int chan, unsigned char *buf, int len) {
  hex_dump("MIC ACK: ", 16, buf, len);
  return (0);
}


x86 assembly (clang, -O0):
<aa_pro_mic_b04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xed0(%rip),%rdi
mov    $0x10,%esi
call   1030 <hex_dump@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_mic_b04>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee3(%rip),%rdi
mov    $0x10,%esi
call   1030 <hex_dump@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"MIC ACK: \00"
define i32 @aa_pro_mic_b04(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @hex_dump(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 16, i8* %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chan_send(void *, long *);
scalar_t__ go_malloc(int);
void first_whisper(void *chan) {
  long *v = (long *)go_malloc(sizeof(long));
  *v = 1;
  chan_send(chan, v);
}


x86 assembly (clang, -O0):
<first_whisper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <go_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <chan_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_whisper>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <go_malloc@plt>
movq   $0x1,(%rax)
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <chan_send@plt>

LLVM IR (-O0):
define void @first_whisper(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = call i64 @go_malloc(i32 8)
%5 = inttoptr i64 %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
store i64 1, i64* %6
%7 = load i8*, i8** %2
%8 = load i64*, i64** %3
%9 = call i32 @chan_send(i8* %7, i64* %8)
ret void
}

LLVM IR (-O2):
define void @first_whisper(i8* %0) {
%2 = tail call i64 @go_malloc(i32 8)
%3 = inttoptr i64 %2 to i64*
store i64 1, i64* %3
%4 = tail call i32 @chan_send(i8* %0, i64* %3)
ret void
}
/* Variables and functions */
unsigned long getStringLength(char *, int /*<<< orphan*/);
char *getExtension(char *__fn__) {
  long unsigned int __cn__ = getStringLength(__fn__, 0);
  while (*(__fn__ + __cn__) != '.' && __cn__) {
    __cn__--;
  }
  __fn__ += __cn__;
  return __fn__;
}


x86 assembly (clang, -O0):
<getExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <getStringLength@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x11(%rbp)
je     1150 <getExtension+0x40>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <getExtension+0x50>
jmp    1171 <getExtension+0x61>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <getExtension+0x1b>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExtension>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <getStringLength@plt>
lea    (%rax,%rbx,1),%rcx
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffffffffffff,%rax
setb   %dl
cmpb   $0x2e,-0x1(%rcx)
lea    -0x1(%rcx),%rcx
je     1145 <getExtension+0x35>
test   %dl,%dl
jne    1130 <getExtension+0x20>
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @getExtension(i8* %0) {
%2 = tail call i64 @getStringLength(i8* %0, i32 0)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %2, %1 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 46
%8 = icmp ne i64 %4, 0
%9 = select i1 %7, i1 %8, i1 false
%10 = add i64 %4, -1
br i1 %9, label %3, label %11
11: ; preds = %3
%12 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ osKernelInitialize();
int /*<<< orphan*/ osKernelStart();
int main(void) {
  osKernelInitialize();
  osKernelStart();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <osKernelInitialize@plt>
xor    %eax,%eax
call   1040 <osKernelStart@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @osKernelInitialize()
%2 = call i32 (...) @osKernelStart()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @osKernelInitialize()
%2 = tail call i32 (...) @osKernelStart()
ret i32 0
}
void showInterfaces() {
  int lastIndex = 0;
  char *oid = "ipAdEntAddr";
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"ipAdEntAddr\00"
define void @showInterfaces() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
ret void
}

LLVM IR (-O2):
define void @showInterfaces() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int pread(int, unsigned long long *, int, uintptr_t);
uint64_t GetPageFrameNumber(int pagemap, uint8_t *virtual_address) {
  uint64_t value;
  int got =
      pread(pagemap, &value, 8, (((uintptr_t)virtual_address) / 0x1000) * 8);
  assert(got == 8);
  uint64_t page_frame_number = value & ((1ULL << 54) - 1);
  return page_frame_number;
}


x86 assembly (clang, -O0):
<GetPageFrameNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
shr    $0xc,%rcx
shl    $0x3,%rcx
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movabs $0x3fffffffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPageFrameNumber>:
push   %rax
mov    %rsi,%rcx
shr    $0x9,%rcx
and    $0xfffffffffffffff8,%rcx
mov    %rsp,%rsi
mov    $0x8,%edx
call   1040 <pread@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
call   1030 <assert@plt>
movabs $0x3fffffffffffff,%rax
and    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @GetPageFrameNumber(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %3
store i32* %1, i32** %4
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = ptrtoint i32* %9 to i64
%11 = udiv i64 %10, 4096
%12 = mul i64 %11, 8
%13 = call i32 @pread(i32 %8, i64* %5, i32 8, i64 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 8
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %5
%19 = and i64 %18, 18014398509481983
store i64 %19, i64* %7
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @GetPageFrameNumber(i32 %0, i32* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = ptrtoint i32* %1 to i64
%6 = lshr i64 %5, 9
%7 = and i64 %6, 36028797018963960
%8 = call i32 @pread(i32 %0, i64* %3, i32 8, i64 %7)
%9 = icmp eq i32 %8, 8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = load i64, i64* %3
%13 = and i64 %12, 18014398509481983
ret i64 %13
}
float copysignf(float x, float y) { return __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<copysignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignf>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @copysignf(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
float __ocml_mul_rte_f32(float, float);
float __fmul_rn(float x, float y) { return __ocml_mul_rte_f32(x, y); }


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

x86 assembly (clang, -O2):
<__fmul_rn>:
jmp    1030 <__ocml_mul_rte_f32@plt>

LLVM IR (-O0):
define float @__fmul_rn(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__ocml_mul_rte_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fmul_rn(float %0, float %1) {
%3 = tail call float @__ocml_mul_rte_f32(float %0, float %1)
ret float %3
}
void fa121(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        p024A:
          goto p024A;
          goto a;
        P024A:
          goto P024A;
          0;
      });
    a:
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa121>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa121+0x4>

x86 assembly (clang, -O2):
<fa121>:
jmp    1100 <fa121>

LLVM IR (-O0):
define void @fa121() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
br label %14
14: ; preds = %14, %13
br label %14
15: ; preds = %15
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa121() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ CloseIOFile(int);
void CloseAllIOFiles(void) {
  int k;
  for (k = 0; k < 10; k++)
    CloseIOFile(k);
}


x86 assembly (clang, -O0):
<CloseAllIOFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113f <CloseAllIOFiles+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <CloseIOFile@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <CloseAllIOFiles+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseAllIOFiles>:
push   %rax
xor    %edi,%edi
call   1030 <CloseIOFile@plt>
mov    $0x1,%edi
call   1030 <CloseIOFile@plt>
mov    $0x2,%edi
call   1030 <CloseIOFile@plt>
mov    $0x3,%edi
call   1030 <CloseIOFile@plt>
mov    $0x4,%edi
call   1030 <CloseIOFile@plt>
mov    $0x5,%edi
call   1030 <CloseIOFile@plt>
mov    $0x6,%edi
call   1030 <CloseIOFile@plt>
mov    $0x7,%edi
call   1030 <CloseIOFile@plt>
mov    $0x8,%edi
call   1030 <CloseIOFile@plt>
mov    $0x9,%edi
pop    %rax
jmp    1030 <CloseIOFile@plt>

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

LLVM IR (-O2):
define void @CloseAllIOFiles() {
%1 = tail call i32 @CloseIOFile(i32 0)
%2 = tail call i32 @CloseIOFile(i32 1)
%3 = tail call i32 @CloseIOFile(i32 2)
%4 = tail call i32 @CloseIOFile(i32 3)
%5 = tail call i32 @CloseIOFile(i32 4)
%6 = tail call i32 @CloseIOFile(i32 5)
%7 = tail call i32 @CloseIOFile(i32 6)
%8 = tail call i32 @CloseIOFile(i32 7)
%9 = tail call i32 @CloseIOFile(i32 8)
%10 = tail call i32 @CloseIOFile(i32 9)
ret void
}
/* Variables and functions */
short bset_h(short *, short *);
short intr_wrap_528(short p1, short p2) { return bset_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_528>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <bset_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_528>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <bset_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_528(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @bset_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_528(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @bset_h(i16* %3, i16* %4)
ret i16 %5
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ fegetenv(int *);
int /*<<< orphan*/ fesetenv(int *);
int fesetexceptflag(const fexcept_t *__flagp, int __excepts) {
  fexcept_t __fcsr;
  fegetenv(&__fcsr);
  __excepts &= FE_ALL_EXCEPT;
  __fcsr &= ~__excepts;
  __fcsr |= *__flagp & __excepts;
  fesetenv(&__fcsr);
  return 0;
}


x86 assembly (clang, -O0):
<fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <fegetenv@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetexceptflag>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1040 <fegetenv@plt>
mov    0x2e9e(%rip),%rax
and    (%rax),%ebx
mov    0xc(%rsp),%eax
mov    (%r14),%ecx
xor    %eax,%ecx
and    %ebx,%ecx
xor    %eax,%ecx
mov    %ecx,0xc(%rsp)
mov    %r15,%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @fegetenv(i32* %5)
%7 = load i32, i32* @FE_ALL_EXCEPT
%8 = load i32, i32* %4
%9 = and i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %5
%13 = and i32 %12, %11
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = load i32, i32* %4
%17 = and i32 %15, %16
%18 = load i32, i32* %5
%19 = or i32 %18, %17
store i32 %19, i32* %5
%20 = call i32 @fesetenv(i32* %5)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fesetexceptflag(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fegetenv(i32* %3)
%6 = load i32, i32* @FE_ALL_EXCEPT
%7 = and i32 %6, %1
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %9, %8
%11 = load i32, i32* %0
%12 = and i32 %11, %7
%13 = or i32 %12, %10
store i32 %13, i32* %3
%14 = call i32 @fesetenv(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_offset(int /*<<< orphan*/);
int /*<<< orphan*/ mark_backward_target(unsigned long);
void mark_forward_branch(unsigned long cstag) {
  mark_backward_target(cstag);
  emit_offset(0);
}


x86 assembly (clang, -O0):
<mark_forward_branch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mark_backward_target@plt>
xor    %edi,%edi
call   1030 <emit_offset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_forward_branch>:
push   %rax
call   1040 <mark_backward_target@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <emit_offset@plt>

LLVM IR (-O0):
define void @mark_forward_branch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @mark_backward_target(i64 %3)
%5 = call i32 @emit_offset(i32 0)
ret void
}

LLVM IR (-O2):
define void @mark_forward_branch(i64 %0) {
%2 = tail call i32 @mark_backward_target(i64 %0)
%3 = tail call i32 @emit_offset(i32 0)
ret void
}
int qreflect2(filt, x_dim, y_dim, x_pos, y_pos, result, r_or_e)
double *filt, *result;
int x_dim, y_dim, x_pos, y_pos, r_or_e;
{
  reflect2(filt, x_dim, y_dim, x_pos, y_pos, result, 0);
  return (0);
}


x86 assembly (clang, -O0):
<qreflect2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
mov    $0x0,%al
call   1030 <reflect2@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qreflect2>:
push   %rax
movl   $0x0,(%rsp)
xor    %eax,%eax
call   1030 <reflect2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @qreflect2(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, double* %5, i32 %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
%15 = load double*, double** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load double*, double** %13
%21 = call i32 (double*, i32, i32, i32, i32, double*, i32, ...) bitcast (i32 (...)* @reflect2 to i32 (double*, i32, i32, i32, i32, double*, i32, ...)*)(double* %15, i32 %16, i32 %17, i32 %18, i32 %19, double* %20, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @qreflect2(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, double* %5, i32 %6) {
%8 = tail call i32 (double*, i32, i32, i32, i32, double*, i32, ...) bitcast (i32 (...)* @reflect2 to i32 (double*, i32, i32, i32, i32, double*, i32, ...)*)(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, double* %5, i32 0)
ret i32 0
}
void InfoPrint(void *a) { ; }


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

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

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

LLVM IR (-O2):
define void @InfoPrint(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
long timespec_microseconds(struct timespec *a) {
  return a->tv_sec * 1000000L + a->tv_nsec / 1000L;
}


x86 assembly (clang, -O0):
<timespec_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xf4240,(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_microseconds>:
imul   $0xf4240,(%rdi),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x8(%rdi)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_microseconds(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 1000
%8 = add nsw i64 %7, %4
ret i64 %8
}
/* Variables and functions */
int func_anonym(double);
int main(void) {
  int func_complete(double x);
  double parameter = 3.14;
  return func_anonym(parameter) * func_complete(parameter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <func_anonym@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <func_complete@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
call   1030 <func_anonym@plt>
mov    %eax,%ebx
movsd  0xec8(%rip),%xmm0
call   1040 <func_complete@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 3.140000e+00, double* %2
%3 = load double, double* %2
%4 = call i32 @func_anonym(double %3)
%5 = load double, double* %2
%6 = call i32 @func_complete(double %5)
%7 = mul nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func_anonym(double 3.140000e+00)
%2 = tail call i32 @func_complete(double 3.140000e+00)
%3 = mul nsw i32 %2, %1
ret i32 %3
}
main(argc, argv) int argc;
char *argv[];
{
  initialize(argc, argv);
  mainloop(argc, argv);
  terminate(argc, argv);
  exit(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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <initialize@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <mainloop@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <terminate@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <initialize@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <mainloop@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <terminate@plt>
xor    %edi,%edi
call   1050 <exit@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 = load i8**, i8*** %5
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @initialize to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @mainloop to i32 (i32, i8**, ...)*)(i32 %9, i8** %10)
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @terminate to i32 (i32, i8**, ...)*)(i32 %12, i8** %13)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @initialize to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
%4 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @mainloop to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
%5 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @terminate to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
tail call void @exit(i32 0)
unreachable
}
int is_line_sep(char c) { return (c == '\0' || c == '\n' || c == '\r'); }


x86 assembly (clang, -O0):
<is_line_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_line_sep+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_line_sep+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_line_sep>:
mov    $0x1,%eax
test   %dil,%dil
je     1110 <is_line_sep+0x10>
cmp    $0xa,%dil
jne    1111 <is_line_sep+0x11>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_line_sep(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 13
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_line_sep(i8 signext %0) {
switch i8 %0, label %2 [
i8 10, label %5
i8 0, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
scalar_t__ log1p(double);
float log1pf(float x) { return (float)log1p((double)x); }


x86 assembly (clang, -O0):
<log1pf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <log1p@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log1p@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log1pf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @log1p(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @log1pf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @log1p(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void round_test(void) {
  assert(((3) > 0 ? (int)(3 + 0.5) : (int)(3 - 0.5)) == 3);
  assert(((3.4) > 0 ? (int)(3.4 + 0.5) : (int)(3.4 - 0.5)) == 3);
  assert(((3.5) > 0 ? (int)(3.5 + 0.5) : (int)(3.5 - 0.5)) == 4);
  assert(((-3) > 0 ? (int)(-3 + 0.5) : (int)(-3 - 0.5)) == -3);
  assert(((-3.4) > 0 ? (int)(-3.4 + 0.5) : (int)(-3.4 - 0.5)) == -3);
  assert(((-3.5) > 0 ? (int)(-3.5 + 0.5) : (int)(-3.5 - 0.5)) == -4);
}


x86 assembly (clang, -O0):
<round_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_test>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @round_test() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 1)
%4 = call i32 @assert(i32 1)
%5 = call i32 @assert(i32 1)
%6 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @round_test() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_append_n(struct buffer *, char const *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void buffer_append(struct buffer *b, const char *s) {
  buffer_append_n(b, s, strlen(s));
}


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

x86 assembly (clang, -O2):
<buffer_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <buffer_append_n@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_append(%struct.buffer* %0, i8* %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %3
store i8* %1, i8** %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @buffer_append_n(%struct.buffer* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_append(%struct.buffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @buffer_append_n(%struct.buffer* %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int main() {
  FILE *out = fopen("input.dat", "a");
  fprintf(out, "%d\n", INT_MIN);
  fprintf(out, "%d\n", INT_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
lea    0xec2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.dat\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @INT_MIN
%6 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* @INT_MAX
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.dat\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
@INT_MAX = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @INT_MIN
%3 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_snprintf() {
  printf("NOT IMPLEMENTED:"
         "pa_snprintf"
         "\n");
}


x86 assembly (clang, -O0):
<pa_snprintf>:
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_snprintf>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_snprintf\00"
define i32 @pa_snprintf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
void f(int farg) {
  int flocal = 44;
  g(flocal);
}


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

x86 assembly (clang, -O2):
<f>:
mov    $0x2c,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 44, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @g(i32 %4)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = tail call i32 @g(i32 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ avrtest_abort();
void abort(void) {
  avrtest_abort();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <avrtest_abort@plt>
jmp    111b <abort+0xb>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1030 <avrtest_abort@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <abort+0x10>

LLVM IR (-O0):
define void @abort() {
%1 = call i32 (...) @avrtest_abort()
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @abort() {
%1 = tail call i32 (...) @avrtest_abort()
br label %2
2: ; preds = %2, %0
br label %2
}
void func4(void) {
  extern int g16;
  extern int g17;
  extern int g18;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *timer_list_open(void) { return fopen("/proc/timer_list", "r"); }


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

x86 assembly (clang, -O2):
<timer_list_open>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/proc/timer_list\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @timer_list_open() {
%1 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}

LLVM IR (-O2):
@.str = [17 x i8] c"/proc/timer_list\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @timer_list_open() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}