xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int rename(char const *, char const *);
void renameFile(char *oldname, char *newname) {
  if ((rename((const char *)oldname, (const char *)newname)) == -1)
    printf("Error, can't rename file.\n");
}


x86 assembly (clang, -O0):
<renameFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rename@plt>
cmp    $0xffffffff,%eax
jne    1152 <renameFile+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameFile>:
push   %rax
call   1040 <rename@plt>
cmp    $0xffffffff,%eax
je     112d <renameFile+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Error, can't rename file.\0A\00"
define void @renameFile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @rename(i8* %5, i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Error, can't rename file.\00"
define void @renameFile(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
void test_breakpoint(void) {
  static int nCall = 0;
  nCall++;
}


x86 assembly (clang, -O0):
<test_breakpoint>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_breakpoint>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@test_breakpoint.nCall = internal global i32 0
define void @test_breakpoint() {
%1 = load i32, i32* @test_breakpoint.nCall
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test_breakpoint.nCall
ret void
}

LLVM IR (-O2):
@test_breakpoint.nCall = internal unnamed_addr global i32 0
define void @test_breakpoint() {
%1 = load i32, i32* @test_breakpoint.nCall
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test_breakpoint.nCall
ret void
}
void INT_Excep_PERIB_INTB140(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB140() {
ret void
}
/* Variables and functions */
size_t get_allocation_size(size_t size) {
  size_t total_size = 0x10;
  while (total_size < size) {
    total_size <<= 0x01;
  }
  return total_size;
}


x86 assembly (clang, -O0):
<get_allocation_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x10,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <get_allocation_size+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_allocation_size+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_allocation_size>:
mov    $0x10,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <get_allocation_size+0x10>
ret

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

LLVM IR (-O2):
define i64 @get_allocation_size(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 16, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
__attribute__((always_)) void cpuid_count(int op, int count, int *eax, int *ebx,
                                          int *ecx, int *edx) {
  __asm__("cpuid"
          : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx)
          : "0"(op), "c"(count));
}


x86 assembly (clang, -O0):
<cpuid_count>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cpuid
mov    %eax,%r9d
mov    -0x40(%rbp),%rax
mov    %ecx,%esi
mov    -0x38(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_count>:
push   %rbx
mov    %rcx,%r10
mov    %rdx,%r11
mov    %esi,%ecx
mov    %edi,%eax
cpuid
mov    %eax,(%r11)
mov    %ebx,(%r10)
mov    %ecx,(%r8)
mov    %edx,(%r9)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid_count(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32*, i32** %11
%16 = load i32*, i32** %12
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %17, i32 %18)
%20 = extractvalue { i32, i32, i32, i32 } %19, 0
%21 = extractvalue { i32, i32, i32, i32 } %19, 1
%22 = extractvalue { i32, i32, i32, i32 } %19, 2
%23 = extractvalue { i32, i32, i32, i32 } %19, 3
store i32 %20, i32* %13
store i32 %21, i32* %14
store i32 %22, i32* %15
store i32 %23, i32* %16
ret void
}

LLVM IR (-O2):
define void @cpuid_count(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
%8 = extractvalue { i32, i32, i32, i32 } %7, 0
%9 = extractvalue { i32, i32, i32, i32 } %7, 1
%10 = extractvalue { i32, i32, i32, i32 } %7, 2
%11 = extractvalue { i32, i32, i32, i32 } %7, 3
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
store i32 %11, i32* %5
ret void
}
int main(argc, argv)
int argc;
char *argv[];
{
  create_graphic();
  dfs(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @create_graphic()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @dfs to i32 (i32, ...)*)(i32 0)
ret i32 0
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_unsigned_char(unsigned char *const dest,
                                          unsigned char const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_COPY_unsigned_char>:
mov    %sil,(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_unsigned_char(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret i32 1
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
__u64 kcov_remote_handle(__u64 subsys, __u64 inst) {
  if (subsys & ~(0xffull << 56) || inst & ~(0xffffffffull))
    return 0;
  return subsys | inst;
}


x86 assembly (clang, -O0):
<kcov_remote_handle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movabs $0xffffffffffffff,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jne    1140 <kcov_remote_handle+0x40>
movslq -0xc(%rbp),%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rcx,%rax
cmp    $0x0,%rax
je     114c <kcov_remote_handle+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1155 <kcov_remote_handle+0x55>
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcov_remote_handle>:
movslq %edi,%rax
mov    %rax,%rcx
shl    $0x8,%rcx
or     %esi,%eax
xor    %edx,%edx
test   %rcx,%rcx
cmovne %edx,%eax
test   %esi,%esi
cmovs  %edx,%eax
ret

LLVM IR (-O0):
define i32 @kcov_remote_handle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = and i64 %7, 72057594037927935
%9 = icmp ne i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = and i64 %12, -4294967296
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10, %2
store i32 0, i32* %3
br label %20
16: ; preds = %10
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = or i32 %17, %18
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @kcov_remote_handle(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 72057594037927935
%5 = icmp eq i64 %4, 0
%6 = icmp sgt i32 %1, -1
%7 = and i1 %6, %5
%8 = or i32 %1, %0
%9 = select i1 %7, i32 %8, i32 0
ret i32 %9
}
foo(int i, int *p) {
  int j;
  if (i > 10) {
    if (p) {
      j = *p;
      if (p)
        return j + 1;
    }
  } else {
    j = *p - 3;
    if (!p)
      return j - 4;
  }
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    114c <foo+0x4c>
cmpq   $0x0,-0x10(%rbp)
je     1147 <foo+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <foo+0x42>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <foo+0x7c>
jmp    1147 <foo+0x47>
jmp    1176 <foo+0x76>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x3,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <foo+0x71>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <foo+0x7c>
jmp    1176 <foo+0x76>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
cmp    $0xb,%edi
jl     1111 <foo+0x11>
test   %rsi,%rsi
je     1111 <foo+0x11>
mov    (%rsi),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 11
%4 = icmp eq i32* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ %0, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ dcac_acl_ops(int, int, int, char *, int /*<<< orphan*/ *);
int dcac_set_def_rdacl(char *plain_acl) {
  return (int)dcac_acl_ops(20, -1, -1, plain_acl, NULL);
}


x86 assembly (clang, -O0):
<dcac_set_def_rdacl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x14,%edi
mov    $0xffffffff,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    %edx,%esi
call   1030 <dcac_acl_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_set_def_rdacl>:
mov    %rdi,%rcx
mov    $0x14,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
xor    %r8d,%r8d
jmp    1030 <dcac_acl_ops@plt>

LLVM IR (-O0):
define i32 @dcac_set_def_rdacl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @dcac_acl_ops(i32 20, i32 -1, i32 -1, i8* %3, i32* null)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @dcac_set_def_rdacl(i8* %0) {
%2 = tail call i64 @dcac_acl_ops(i32 20, i32 -1, i32 -1, i8* %0, i32* null)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Usage();
int /*<<< orphan*/ mq_unlink(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    Usage();
  }
  mq_unlink(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <Usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <mq_unlink@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1130 <main+0x10>
xor    %eax,%eax
call   1030 <Usage@plt>
mov    0x8(%rbx),%rdi
call   1040 <mq_unlink@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @Usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @mq_unlink(i8* %13)
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @Usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @mq_unlink(i8* %8)
ret i32 0
}
double xor (double x, double y) { return (long)x ^ (long)y; }


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvttsd2si -0x10(%rbp),%rcx
xor    %rcx,%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
cvttsd2si %xmm0,%rax
cvttsd2si %xmm1,%rcx
xor    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
ret

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

LLVM IR (-O2):
define double @xor(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = fptosi double %1 to i64
%5 = xor i64 %4, %3
%6 = sitofp i64 %5 to double
ret double %6
}
int sys_stub(int err) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @sys_stub(i32 %0) {
ret i32 -1
}
void markVisited(int **visit, int dest) {
  int *visited = *visit;
  visited[dest] = 1;
}


x86 assembly (clang, -O0):
<markVisited>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<markVisited>:
mov    (%rdi),%rax
movslq %esi,%rcx
movl   $0x1,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @markVisited(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32*
store i32** %0, i32*** %3
store i32 %1, i32* %4
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 1, i32* %11
ret void
}

LLVM IR (-O2):
define void @markVisited(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
store i32 1, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_read(int /*<<< orphan*/, char *, int);
int getchar(void) {
  static char ret;
  sys_read(0, &ret, 1);
  return ret;
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0x2f0c(%rip),%rsi
mov    $0x1,%edx
call   1030 <sys_read@plt>
movsbl 0x2efb(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
lea    0x2f11(%rip),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <sys_read@plt>
movsbl 0x2efe(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@getchar.ret = internal global i8 0
define i32 @getchar() {
%1 = call i32 @sys_read(i32 0, i8* @getchar.ret, i32 1)
%2 = load i8, i8* @getchar.ret
%3 = sext i8 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@getchar.ret = internal global i8 0
define i32 @getchar() {
%1 = tail call i32 @sys_read(i32 0, i8* @getchar.ret, i32 1)
%2 = load i8, i8* @getchar.ret
%3 = sext i8 %2 to i32
ret i32 %3
}
void glNormal3x(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glNormal3x() {
ret void
}
int arith_max(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<arith_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <arith_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <arith_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @arith_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mp2vseqdx_get_format(const uint8_t *p_mp2vseqdx) {
  return ((p_mp2vseqdx[4] & 0x0e) >> 1);
}


x86 assembly (clang, -O0):
<mp2vseqdx_get_format>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xe,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqdx_get_format>:
mov    0x10(%rdi),%eax
shr    %eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqdx_get_format(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 14
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @mp2vseqdx_get_format(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 7
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(unsigned long);
double *makeDoubleArray(unsigned long int arraySize) {
  double *theArray;
  theArray = (double *)malloc(arraySize * sizeof(double));
  return theArray;
}


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

x86 assembly (clang, -O2):
<makeDoubleArray>:
shl    $0x3,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @makeDoubleArray(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 8
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to double*
store double* %7, double** %3
%8 = load double*, double** %3
ret double* %8
}

LLVM IR (-O2):
define double* @makeDoubleArray(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
/* Variables and functions */
int /*<<< orphan*/ MemFree(double *);
void DestroyHistogram(double *h16) {
  if (h16)
    MemFree(h16);
}


x86 assembly (clang, -O0):
<DestroyHistogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <DestroyHistogram+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <MemFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DestroyHistogram>:
test   %rdi,%rdi
je     111a <DestroyHistogram+0xa>
jmp    1030 <MemFree@plt>
ret

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

LLVM IR (-O2):
define void @DestroyHistogram(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @MemFree(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned short, int);
void serial_cfg_line(unsigned short com) { outb((com + 3), 0x03); }


x86 assembly (clang, -O0):
<serial_cfg_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x3,%eax
mov    $0x3,%esi
movzwl %ax,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_cfg_line>:
add    $0x3,%edi
movzwl %di,%edi
mov    $0x3,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @serial_cfg_line(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = add nsw i32 %4, 3
%6 = trunc i32 %5 to i16
%7 = call i32 @outb(i16 zeroext %6, i32 3)
ret void
}

LLVM IR (-O2):
define void @serial_cfg_line(i16 zeroext %0) {
%2 = add i16 %0, 3
%3 = tail call i32 @outb(i16 zeroext %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int read(int, char *, int);
char action(int fd) {
  char ch;
  if (read(fd, &ch, 1) == -1)
    err(7, "Error reading named pipe");
  return ch;
}


x86 assembly (clang, -O0):
<action>:
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    $0xffffffff,%eax
jne    1156 <action+0x36>
mov    $0x7,%edi
lea    0xeaf(%rip),%rsi
call   1040 <err@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<action>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0xffffffff,%eax
jne    1146 <action+0x26>
lea    0xec4(%rip),%rsi
mov    $0x7,%edi
call   1040 <err@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Error reading named pipe\00"
define signext i8 @action(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @read(i32 %4, i8* %3, i32 1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i32 7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
@.str = [25 x i8] c"Error reading named pipe\00"
define signext i8 @action(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8, i8* %2
ret i8 %8
}
void *test_anti_range_126(short n) {
  extern void *alloc_anti_range_126(short) __attribute__((alloc_size(1)));
  if ((-0x7fff - 1) + 2 <= n && n <= 1)
    n = (-0x7fff - 1) + 2 - 1;
  return alloc_anti_range_126(n);
}


x86 assembly (clang, -O0):
<test_anti_range_126>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffff8002,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_126+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x1,%eax
jg     1143 <test_anti_range_126+0x33>
movw   $0x8001,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_126@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_126>:
mov    %edi,%eax
add    $0x7ffe,%ax
mov    $0x8001,%eax
cmovs  %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_126@plt>

LLVM IR (-O0):
define i8* @test_anti_range_126(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 -32766, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -32767, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_126(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_126(i16 signext %0) {
%2 = add i16 %0, 32766
%3 = icmp sgt i16 %2, -1
%4 = select i1 %3, i16 -32767, i16 %0
%5 = tail call i8* @alloc_anti_range_126(i16 signext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SYS_rename;
int syscall(int /*<<< orphan*/, char const *, char const *);
int real_rename(const char *oldname, const char *newname) {
  return syscall(SYS_rename, (oldname), (newname));
}


x86 assembly (clang, -O0):
<real_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_rename>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_rename = global i32 0
define i32 @real_rename(i8* %0, i8* %1) {
%3 = load i32, i32* @SYS_rename
%4 = tail call i32 @syscall(i32 %3, i8* %0, i8* %1)
ret i32 %4
}
int sys_select(void *args) {
  int r;
  __asm__ __volatile__("\tint $0x80\n"
                       : "=a"(r)
                       : "a"(82), "b"(args)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<sys_select>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x52,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <set_errno@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_select>:
push   %rbx
mov    %rdi,%rbx
mov    $0x52,%eax
int    $0x80
mov    %eax,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i32 @sys_select(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 82, i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sys_select(i8* %0) {
%2 = tail call i32 asm sideeffect "\09int $$0x80\0A", "={ax},{ax},{bx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 82, i8* %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @set_errno to i32 (i32, ...)*)(i32 %2)
ret i32 %3
}
/* Variables and functions */
int _f(int, int /*<<< orphan*/, double const, double const *);
double _g_1(const double omega, const double vertices_omegas[4]) {
  return (3 * _f(1, 0, omega, vertices_omegas) *
          _f(2, 0, omega, vertices_omegas) /
          (vertices_omegas[3] - vertices_omegas[0]));
}


x86 assembly (clang, -O0):
<_g_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_f@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <_f@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_g_1>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <_f@plt>
mov    %eax,%ebp
mov    $0x2,%edi
xor    %esi,%esi
movsd  (%rsp),%xmm0
mov    %rbx,%rdx
call   1030 <_f@plt>
imul   %ebp,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x18(%rbx),%xmm1
subsd  (%rbx),%xmm1
divsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @_g_1(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = call i32 @_f(i32 1, i32 0, double %5, double* %6)
%8 = mul nsw i32 3, %7
%9 = load double, double* %3
%10 = load double*, double** %4
%11 = call i32 @_f(i32 2, i32 0, double %9, double* %10)
%12 = mul nsw i32 %8, %11
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 3
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = fsub double %16, %19
%21 = fdiv double %13, %20
ret double %21
}

LLVM IR (-O2):
define double @_g_1(double %0, double* %1) {
%3 = tail call i32 @_f(i32 1, i32 0, double %0, double* %1)
%4 = mul nsw i32 %3, 3
%5 = tail call i32 @_f(i32 2, i32 0, double %0, double* %1)
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds double, double* %1, i64 3
%9 = load double, double* %8
%10 = load double, double* %1
%11 = fsub double %9, %10
%12 = fdiv double %7, %11
ret double %12
}
/* Variables and functions */
float __nv_fdiv_rd(float, float);
float __fdiv_rd(float __a, float __b) { return __nv_fdiv_rd(__a, __b); }


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

x86 assembly (clang, -O2):
<__fdiv_rd>:
jmp    1030 <__nv_fdiv_rd@plt>

LLVM IR (-O0):
define float @__fdiv_rd(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 @__nv_fdiv_rd(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fdiv_rd(float %0, float %1) {
%3 = tail call float @__nv_fdiv_rd(float %0, float %1)
ret float %3
}
/* Variables and functions */
int sodium_crit_leave(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sodium_crit_leave() {
ret i32 0
}
OP(fd, ba) { op_ba(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ba()
ret i32 undef
}
void two_accesses(int *arr) {
  if (arr[1] < 0) {
    arr[0] = 0;
  }
}


x86 assembly (clang, -O0):
<two_accesses>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jge    1120 <two_accesses+0x20>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_accesses>:
cmpl   $0x0,0x4(%rdi)
js     1107 <two_accesses+0x7>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @two_accesses(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 0, i32* %9
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @two_accesses(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 0, i32* %0
br label %6
6: ; preds = %5, %1
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int syscall_gettimeofday(struct timeval *, void *);
int gettimeofday(struct timeval *tv, void *tz) {
  return syscall_gettimeofday(tv, tz);
}


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

x86 assembly (clang, -O2):
<gettimeofday>:
jmp    1030 <syscall_gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load i8*, i8** %4
%7 = call i32 @syscall_gettimeofday(%struct.timeval* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = tail call i32 @syscall_gettimeofday(%struct.timeval* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ stderr;
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\nstdout\n", a + b);
  fprintf(stderr, "stderr");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [11 x i8] c"%d\0Astdout\0A\00"
@stderr = global i32 0
@.str.2 = [7 x i8] c"stderr\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [11 x i8] c"%d\0Astdout\0A\00"
@stderr = global i32 0
@.str.2 = [7 x i8] c"stderr\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int list_append(struct list *, void *);
scalar_t__ list_find(struct list *, void *);
int list_append_safe(struct list *l, void *d) {
  if (list_find(l, d) >= 0)
    return 1;
  return list_append(l, d);
}


x86 assembly (clang, -O0):
<list_append_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <list_find@plt>
cmp    $0x0,%rax
jl     1153 <list_append_safe+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1163 <list_append_safe+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_append@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_append_safe>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <list_find@plt>
test   %rax,%rax
js     1141 <list_append_safe+0x21>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_append@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @list_append_safe(%struct.list* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.list*
%5 = alloca i8*
store %struct.list* %0, %struct.list** %4
store i8* %1, i8** %5
%6 = load %struct.list*, %struct.list** %4
%7 = load i8*, i8** %5
%8 = call i64 @list_find(%struct.list* %6, i8* %7)
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load %struct.list*, %struct.list** %4
%13 = load i8*, i8** %5
%14 = call i32 @list_append(%struct.list* %12, i8* %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @list_append_safe(%struct.list* %0, i8* %1) {
%3 = tail call i64 @list_find(%struct.list* %0, i8* %1)
%4 = icmp sgt i64 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @list_append(%struct.list* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 1, %2 ]
ret i32 %8
}
double re_mul_d(double re1, double im1, double re2, double im2) {
  return re1 * re2 - im1 * im2;
}


x86 assembly (clang, -O0):
<re_mul_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_mul_d>:
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @re_mul_d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @re_mul_d(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %3
%7 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %6)
ret double %7
}
long long GetNumPlayers() { return 350000LL; }


x86 assembly (clang, -O0):
<GetNumPlayers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55730,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @GetNumPlayers() {
ret i64 350000
}

LLVM IR (-O2):
define i64 @GetNumPlayers() {
ret i64 350000
}
char *K256Tail(char *Key) {
  char *r;
  r = Key;
  if (!(*r & 0x80)) {
    int c0;
    c0 = 1;
    r++;
    while (c0) {
      if (*r & 0x80) {
        c0++;
      } else {
        c0--;
      }
      r++;
    }
  }
  return r;
}


x86 assembly (clang, -O0):
<K256Tail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1184 <K256Tail+0x84>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     117f <K256Tail+0x7f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1165 <K256Tail+0x65>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116e <K256Tail+0x6e>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <K256Tail+0x38>
jmp    1184 <K256Tail+0x84>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<K256Tail>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
js     1135 <K256Tail+0x35>
add    $0x1,%rax
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%edx
shr    $0x7,%dl
movzbl %dl,%edx
lea    (%rcx,%rdx,2),%ecx
add    $0x1,%rax
add    $0xffffffff,%ecx
jne    1120 <K256Tail+0x20>
ret

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

LLVM IR (-O2):
define i8* @K256Tail(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %6
6: ; preds = %4, %6
%7 = phi i8* [ %5, %4 ], [ %13, %6 ]
%8 = phi i32 [ 1, %4 ], [ %12, %6 ]
%9 = load i8, i8* %7
%10 = icmp sgt i8 %9, -1
%11 = select i1 %10, i32 -1, i32 1
%12 = add nsw i32 %11, %8
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %1
%16 = phi i8* [ %0, %1 ], [ %13, %6 ]
ret i8* %16
}
void initial(int *cube) {
  int i;
  for (i = 0; i < 24; i++) {
    cube[i] = i / 4;
  }
  return;
}


x86 assembly (clang, -O0):
<initial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jge    113f <initial+0x3f>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initial+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initial>:
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
movaps 0xef3(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xef8(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xefd(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xf02(%rip),%xmm0
movups %xmm0,0x40(%rdi)
movaps 0xf07(%rip),%xmm0
movups %xmm0,0x50(%rdi)
ret

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

LLVM IR (-O2):
define void @initial(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %2 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %0, i64 12
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, <4 x i32>* %8
%9 = getelementptr inbounds i32, i32* %0, i64 16
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 4, i32 4, i32 4, i32 4>, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %0, i64 20
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 5, i32 5, i32 5, i32 5>, <4 x i32>* %12
ret void
}