xunge/DecIR huggingface dataset:
void PyDTrace_INSTANCE_NEW_START(int arg0) {}


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

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

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

LLVM IR (-O2):
define void @PyDTrace_INSTANCE_NEW_START(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  printf("#define COMPILE_DATE %d\n", (int)time(NULL));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"#define COMPILE_DATE %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"#define COMPILE_DATE %d\0A\00"
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int func(int);
int main() {
  int i;
  return func(i);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <func@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 undef)
ret i32 %1
}
/* Variables and functions */
void *aligned_alloc(size_t, size_t);
void *aligned_alloc_and_null_check(size_t alignemnt, size_t size) {
  void *tmp = aligned_alloc(alignemnt, size);
  if (!tmp) {
    ;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<aligned_alloc_and_null_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <aligned_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <aligned_alloc_and_null_check+0x31>
jmp    1141 <aligned_alloc_and_null_check+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_alloc_and_null_check>:
jmp    1030 <aligned_alloc@plt>

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

LLVM IR (-O2):
define i8* @aligned_alloc_and_null_check(i64 %0, i64 %1) {
%3 = tail call i8* @aligned_alloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char buff[256];
  int fd = open("key.txt", 0, 0);
  int bytes = read(fd, buff, 256);
  write(1, buff, bytes);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xebe(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <open@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    %eax,-0x108(%rbp)
lea    -0x100(%rbp),%rsi
mov    -0x108(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <open@plt>
mov    %rsp,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <read@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"key.txt\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 256)
store i32 %7, i32* %3
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @write(i32 1, i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"key.txt\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @open(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%4 = call i32 @read(i32 %3, i8* %2, i32 256)
%5 = call i32 @write(i32 1, i8* %2, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
long sysconf(int /*<<< orphan*/);
long os_getpagesize(void) { return sysconf(_SC_PAGESIZE); }


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

x86 assembly (clang, -O2):
<os_getpagesize>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i64 @os_getpagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i64 @os_getpagesize() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
char getc(void) {
  while (!((*(volatile unsigned long *)0xE2900810) & (1 << 0)))
    ;
  return (*(volatile unsigned long *)0xE2900824);
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getc+0x9>
mov    $0xe2900810,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <getc+0x2b>
jmp    1130 <getc+0x30>
jmp    1109 <getc+0x9>
mov    $0xe2900824,%eax
mov    (%rax),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
mov    $0xe2900810,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,(%rax)
je     1110 <getc+0x10>
mov    0x14(%rax),%rax
ret

LLVM IR (-O0):
define signext i8 @getc() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 3801090064 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 3801090084 to i64*)
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3801090064 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3801090084 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ outp(int, unsigned char);
setled(unsigned char row, unsigned char col, unsigned char state) {
  outp(0x1c, row);
  outp(0x1c + 1, col);
  outp(0x1c + 2, state);
}


x86 assembly (clang, -O0):
<setled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
mov    $0x1c,%edi
movzbl -0x5(%rbp),%esi
call   1030 <outp@plt>
mov    $0x1d,%edi
movzbl -0x6(%rbp),%esi
call   1030 <outp@plt>
mov    $0x1e,%edi
movzbl -0x7(%rbp),%esi
call   1030 <outp@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setled>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%esi
mov    $0x1c,%edi
call   1030 <outp@plt>
mov    $0x1d,%edi
mov    %ebp,%esi
call   1030 <outp@plt>
mov    $0x1e,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outp@plt>

LLVM IR (-O0):
define i32 @setled(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
%8 = load i8, i8* %5
%9 = call i32 @outp(i32 28, i8 zeroext %8)
%10 = load i8, i8* %6
%11 = call i32 @outp(i32 29, i8 zeroext %10)
%12 = load i8, i8* %7
%13 = call i32 @outp(i32 30, i8 zeroext %12)
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @setled(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @outp(i32 28, i8 zeroext %0)
%5 = tail call i32 @outp(i32 29, i8 zeroext %1)
%6 = tail call i32 @outp(i32 30, i8 zeroext %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pointer_destroy(void *to_delete) { free(to_delete); }


x86 assembly (clang, -O0):
<pointer_destroy>:
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):
<pointer_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @pointer_destroy(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 @pointer_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void skip() {}


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

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

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

LLVM IR (-O2):
define void @skip() {
ret void
}
void RTSemRWGetReadCount(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWGetReadCount() {
ret void
}
/* Variables and functions */
int numa_num_task_nodes();
int numa_num_thread_nodes(void) { return numa_num_task_nodes(); }


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

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

LLVM IR (-O0):
define i32 @numa_num_thread_nodes() {
%1 = call i32 (...) @numa_num_task_nodes()
ret i32 %1
}

LLVM IR (-O2):
define i32 @numa_num_thread_nodes() {
%1 = tail call i32 (...) @numa_num_task_nodes()
ret i32 %1
}
char *get_pathname(void) {
  static char pathname_array[4][4096];
  static int idx;
  return pathname_array[3 & ++idx];
}


x86 assembly (clang, -O0):
<get_pathname>:
push   %rbp
mov    %rsp,%rbp
mov    0x6f26(%rip),%eax
add    $0x1,%eax
mov    %eax,0x6f1d(%rip)
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2f10(%rip),%rax
shl    $0xc,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pathname>:
mov    0x6f2a(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x6f21(%rip)
and    $0x3,%ecx
shl    $0xc,%rcx
lea    0x2f13(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@get_pathname.pathname_array = internal global [4 x [4096 x i8]] zeroinitializer
@get_pathname.idx = internal global i32 0
define i8* @get_pathname() {
%1 = load i32, i32* @get_pathname.idx
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_pathname.idx
%3 = and i32 3, %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [4 x [4096 x i8]], [4 x [4096 x i8]]* @get_pathname.pathname_array, i64 0, i64 %4
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
ret i8* %6
}

LLVM IR (-O2):
@get_pathname.pathname_array = internal global [4 x [4096 x i8]] zeroinitializer
@get_pathname.idx = internal unnamed_addr global i32 0
define i8* @get_pathname() {
%1 = load i32, i32* @get_pathname.idx
%2 = add nsw i32 %1, 1
store i32 %2, i32* @get_pathname.idx
%3 = and i32 %2, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [4 x [4096 x i8]], [4 x [4096 x i8]]* @get_pathname.pathname_array, i64 0, i64 %4, i64 0
ret i8* %5
}
comp(a, b) char *a;
char *b;
{
  a--;
  b--;
  while (*++a == *++b)
    if (*a == '\0')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl 0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jne    1173 <comp+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116e <comp+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    117a <comp+0x7a>
jmp    1124 <comp+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1126 <comp+0x26>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <comp+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -1
%4 = getelementptr inbounds i8, i8* %1, i64 -1
br label %5
5: ; preds = %13, %2
%6 = phi i8* [ %3, %2 ], [ %8, %13 ]
%7 = phi i8* [ %4, %2 ], [ %10, %13 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = icmp eq i8 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %13
%16 = phi i32 [ 1, %13 ], [ 0, %5 ]
ret i32 %16
}
int B2I(int x) { return x / (1440.0 / 12.6); }


x86 assembly (clang, -O0):
<B2I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<B2I>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @B2I(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 0x405C924924924925
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @B2I(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 0x405C924924924925
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int link(char const *, char const *);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
void create_hardlink(const char *path1, const char *path2) {
  int ret = link(path1, path2);
  if (ret != 0) {
    printf("link failed: %s\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<create_hardlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <link@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1195 <create_hardlink+0x55>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_hardlink>:
push   %rax
call   1040 <link@plt>
test   %eax,%eax
jne    114c <create_hardlink+0xc>
pop    %rax
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"link failed: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_hardlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @link(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"link failed: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_hardlink(i8* %0, i8* %1) {
%3 = tail call i32 @link(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  struct timeval tv;
  double time;
  gettimeofday(&tv, NULL);
  time = tv.tv_sec + tv.tv_usec / 1e6;
  printf("time = %.3lf\n", time);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdl -0x18(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdl (%rsp),%xmm1
cvtsi2sdl 0x4(%rsp),%xmm0
divsd  0xec2(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"time = %.3lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 1.000000e+06
%16 = fadd double %11, %15
store double %16, double* %7
%17 = load double, double* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %17)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"time = %.3lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %12, %8
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %13)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_clear_mixed_cell_configuration(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(94, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_clear_mixed_cell_configuration>:
mov    $0x5e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @celcon_clear_mixed_cell_configuration() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 94, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void grid3x_generic_output(void *data, unsigned *out_width,
                           unsigned *out_height, unsigned width,
                           unsigned height) {
  *out_width = width * 3;
  *out_height = height * 3;
}


x86 assembly (clang, -O0):
<grid3x_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
imul   $0x3,-0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x3,-0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid3x_generic_output>:
lea    (%rcx,%rcx,2),%eax
mov    %eax,(%rsi)
lea    (%r8,%r8,2),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @grid3x_generic_output(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = mul i32 %11, 3
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %10
%15 = mul i32 %14, 3
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @grid3x_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = mul i32 %3, 3
store i32 %6, i32* %1
%7 = mul i32 %4, 3
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int sell(const char *pname, const char *fname, int argc, const char **argv) {
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<sell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sell>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @sell(i8* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @sell(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i != 0) {
    if (i < 0) {
      i = i - 1;
      i = i * (-1);
    } else {
      i = i + 1;
      i = i * (-1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1167 <main+0x57>
cmpl   $0x0,-0x8(%rbp)
jge    1152 <main+0x42>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void brint_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @brint_initialize() {
ret void
}
int compar_int(const void *p1, const void *p2) {
  const unsigned int *i1 = p1, *i2 = p2;
  return (*i1 > *i2) - (*i1 < *i2);
}


x86 assembly (clang, -O0):
<compar_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x20(%rbp),%rdx
cmp    (%rdx),%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @compar_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp ugt i32 %12, %14
%16 = zext i1 %15 to i32
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = icmp ult i32 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @compar_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ugt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp ult i32 %5, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
unsigned long nibble_sort_word(unsigned long);
void nibble_sort_falk(unsigned long *buf) {
  for (int i = 0; i < 1024; i++)
    buf[i] = nibble_sort_word(buf[i]);
}


x86 assembly (clang, -O0):
<nibble_sort_falk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    115e <nibble_sort_falk+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <nibble_sort_falk+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_falk>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <nibble_sort_word@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    1120 <nibble_sort_falk+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nibble_sort_falk(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64*, i64** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %8, i64 %10
%12 = load i64, i64* %11
%13 = call i64 @nibble_sort_word(i64 %12)
%14 = load i64*, i64** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
store i64 %13, i64* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @nibble_sort_falk(i64* nocapture %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = tail call i64 @nibble_sort_word(i64 %6)
store i64 %7, i64* %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 1024
br i1 %9, label %2, label %3
}
void CRTC_InitialiseHsyncTable(void) {}


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

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

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

LLVM IR (-O2):
define void @CRTC_InitialiseHsyncTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HardwareSerial_begin(int);
void main(void) { HardwareSerial_begin(9600); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2580,%edi
jmp    1030 <HardwareSerial_begin@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @HardwareSerial_begin(i32 9600)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @HardwareSerial_begin(i32 9600)
ret void
}
long stub_syscall1(long syscall, long arg1) {
  long ret;
  __asm__ volatile("int $0x80" : "=a"(ret) : "0"(syscall), "b"(arg1));
  return ret;
}


x86 assembly (clang, -O0):
<stub_syscall1>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
int    $0x80
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_syscall1>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i64 @stub_syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @stub_syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
double H(double x) {
  if (x >= 0)
    return 1.;
  else
    return 0.;
}


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112d <H+0x2d>
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1135 <H+0x35>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<H>:
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
movsd  0xeef(%rip),%xmm0
andnpd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @H(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @H(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double 1.000000e+00
ret double %3
}
/* Variables and functions */
int isdigit(int);
int nat_isdigit(int a) { return isdigit(a); }


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

x86 assembly (clang, -O2):
<nat_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @nat_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ verbose(int /*<<< orphan*/, char *, int);
int parse_getchecksum(char *msgbuf, size_t msglen) {
  if (msglen != 0) {
    verbose(0, "parse_getchecksum: bad message size %d\n", (int)msglen);
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_getchecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <parse_getchecksum+0x39>
mov    -0x10(%rbp),%rax
mov    %eax,%edx
xor    %edi,%edi
lea    0xeb6(%rip),%rsi
call   1030 <verbose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_getchecksum>:
test   %rsi,%rsi
jne    1128 <parse_getchecksum+0x8>
xor    %eax,%eax
ret
push   %rax
mov    %rsi,%rdx
lea    0xecd(%rip),%rsi
xor    %edi,%edi
call   1030 <verbose@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"parse_getchecksum: bad message size %d\0A\00"
define i32 @parse_getchecksum(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @verbose(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"parse_getchecksum: bad message size %d\0A\00"
define i32 @parse_getchecksum(i8* nocapture readnone %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = trunc i64 %1 to i32
%6 = tail call i32 @verbose(i32 0, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32 0
}
void exchange(int *a, int i, int j) {
  int temp = a[i];
  a[i] = a[j];
  a[j] = temp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @exchange(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dibujarAyuda();
int /*<<< orphan*/ dibujarControles();
int /*<<< orphan*/ dubijarLogo();
void dubijarInto() {
  dibujarAyuda();
  dubijarLogo();
  dibujarControles();
}


x86 assembly (clang, -O0):
<dubijarInto>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dibujarAyuda@plt>
mov    $0x0,%al
call   1040 <dubijarLogo@plt>
mov    $0x0,%al
call   1050 <dibujarControles@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dubijarInto>:
push   %rax
xor    %eax,%eax
call   1030 <dibujarAyuda@plt>
xor    %eax,%eax
call   1040 <dubijarLogo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <dibujarControles@plt>

LLVM IR (-O0):
define void @dubijarInto() {
%1 = call i32 (...) @dibujarAyuda()
%2 = call i32 (...) @dubijarLogo()
%3 = call i32 (...) @dibujarControles()
ret void
}

LLVM IR (-O2):
define void @dubijarInto() {
%1 = tail call i32 (...) @dibujarAyuda()
%2 = tail call i32 (...) @dubijarLogo()
%3 = tail call i32 (...) @dibujarControles()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
FILE *freopen(const char *filename, const char *mode, FILE *stream) {
  errno = ENOENT;
  return NULL;
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freopen>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @ENOENT
store i32 %7, i32* @errno
ret i32* null
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define noalias i32* @freopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOENT
store i32 %4, i32* @errno
ret i32* null
}
const char *copystr(const char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @copystr(i8* readnone returned %0) {
ret i8* %0
}
unsigned int numdigits(unsigned int d, unsigned int base) {
  unsigned int i = 0;
  while (d > 0) {
    d /= base;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<numdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    1136 <numdigits+0x36>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <numdigits+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numdigits>:
xor    %ecx,%ecx
test   %edi,%edi
je     111f <numdigits+0x1f>
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    $0x1,%ecx
cmp    %esi,%edi
mov    %eax,%edi
jae    1110 <numdigits+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numdigits(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = udiv i32 %6, %1
%8 = add i32 %5, 1
%9 = icmp ult i32 %6, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ read(int, unsigned char *, int);
void ClearReceiveBuffer(int fd) {
  unsigned char tmp;
  while ((read(fd, &tmp, 1)) > 0)
    ;
  return;
}


x86 assembly (clang, -O0):
<ClearReceiveBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    113b <ClearReceiveBuffer+0x2b>
jmp    111b <ClearReceiveBuffer+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearReceiveBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x7(%rsp),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
jg     1120 <ClearReceiveBuffer+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ClearReceiveBuffer(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = call i64 @read(i32 %5, i8* %3, i32 1)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ClearReceiveBuffer(i32 %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i64 @read(i32 %0, i8* %2, i32 1)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
ret void
}
/* Variables and functions */
int t10(int a, double b) { return a + b; }


x86 assembly (clang, -O0):
<t10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t10>:
cvtsi2sd %edi,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @t10(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @t10(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, %1
%5 = fptosi double %4 to i32
ret i32 %5
}
char is_eye(char eye) {
  char eyes[] = {':', ';', '=', 0};
  for (int i = 0; eyes[i] != 0; i++)
    if (eyes[i] == eye) {
      return eyes[i];
    }
  return 0;
}


x86 assembly (clang, -O0):
<is_eye>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movsbl -0x6(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1164 <is_eye+0x64>
movslq -0xc(%rbp),%rax
movsbl -0x6(%rbp,%rax,1),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <is_eye+0x51>
movslq -0xc(%rbp),%rax
mov    -0x6(%rbp,%rax,1),%al
mov    %al,-0x1(%rbp)
jmp    1168 <is_eye+0x68>
jmp    1156 <is_eye+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <is_eye+0x1a>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_eye>:
cmp    $0x3a,%dil
je     1115 <is_eye+0x15>
cmp    $0x3b,%dil
je     1118 <is_eye+0x18>
cmp    $0x3d,%dil
jne    111b <is_eye+0x1b>
mov    $0x3d,%al
ret
mov    $0x3a,%al
ret
mov    $0x3b,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.is_eye.eyes = [4 x i8] c":;=\00"
define signext i8 @is_eye(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca [4 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [4 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %29, %1
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %7
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %28
23: ; preds = %14
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %25
%27 = load i8, i8* %26
store i8 %27, i8* %2
br label %33
28: ; preds = %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %7
32: ; preds = %7
store i8 0, i8* %2
br label %33
33: ; preds = %32, %23
%34 = load i8, i8* %2
ret i8 %34
}

LLVM IR (-O2):
define signext i8 @is_eye(i8 signext %0) {
switch i8 %0, label %2 [
i8 58, label %5
i8 59, label %3
i8 61, label %4
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i8 [ 58, %1 ], [ 0, %2 ], [ 59, %3 ], [ 61, %4 ]
ret i8 %6
}
void genc_un_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_un_d() {
ret void
}