xunge/DecIR huggingface dataset:
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ pancake_sort(int *, int);
int test_pancake_sort() {
  int input[] = {4, 7, 2, 1, 9, 0, 6, 3, 5, 8};
  int expected[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  pancake_sort(input, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_pancake_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <pancake_sort@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pancake_sort>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf00(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <pancake_sort@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_pancake_sort.input = [10 x i32] [i32 4, i32 7, i32 2, i32 1, i32 9, i32 0, i32 6, i32 3, i32 5, i32 8]
@__const.test_pancake_sort.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_pancake_sort() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @pancake_sort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_pancake_sort.input = [10 x i32] [i32 4, i32 7, i32 2, i32 1, i32 9, i32 0, i32 6, i32 3, i32 5, i32 8]
@__const.test_pancake_sort.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_pancake_sort() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @pancake_sort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
void b_ethernet_tx(void *mem, unsigned long len, unsigned long iid) {
  asm volatile("call *0x00100060" : : "S"(mem), "c"(len), "d"(iid));
}


x86 assembly (clang, -O0):
<b_ethernet_tx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
call   *0x100060
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_ethernet_tx>:
mov    %rsi,%rcx
mov    %rdi,%rsi
call   *0x100060
ret

LLVM IR (-O0):
define void @b_ethernet_tx(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @b_ethernet_tx(i8* %0, i64 %1, i64 %2) {
tail call void asm sideeffect "call *0x00100060", "{si},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ weak_block_encrypt(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t strong_block_encrypt(uint64_t block, uint64_t key) {
  for (int i = 0; i < 4096; i++) {
    block = weak_block_encrypt(block, key);
  }
  return block;
}


x86 assembly (clang, -O0):
<strong_block_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1000,-0xc(%rbp)
jge    114e <strong_block_encrypt+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <weak_block_encrypt@plt>
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <strong_block_encrypt+0x15>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strong_block_encrypt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%eax
mov    $0x1000,%ebp
nopl   0x0(%rax)
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <weak_block_encrypt@plt>
add    $0xffffffff,%ebp
jne    1120 <strong_block_encrypt+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strong_block_encrypt(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 = %13, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4096
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @weak_block_encrypt(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @strong_block_encrypt(i32 %0, i32 %1) {
br label %4
3: ; preds = %4
ret i32 %7
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = phi i32 [ %0, %2 ], [ %7, %4 ]
%7 = tail call i32 @weak_block_encrypt(i32 %6, i32 %1)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 4096
br i1 %9, label %3, label %4
}
/* Type definitions */
struct symbol {
  int dummy;
};

/* Variables and functions */
scalar_t__ generic_ptr(int, int);
struct symbol *symbol_ptr(int number) {
  struct symbol *sym_ptr;
  sym_ptr = (struct symbol *)generic_ptr(48, number);
  return (sym_ptr);
}


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

x86 assembly (clang, -O2):
<symbol_ptr>:
mov    %edi,%esi
mov    $0x30,%edi
jmp    1030 <generic_ptr@plt>

LLVM IR (-O0):
%struct.symbol = type { i32 }
define %struct.symbol* @symbol_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.symbol*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @generic_ptr(i32 48, i32 %4)
%6 = inttoptr i64 %5 to %struct.symbol*
store %struct.symbol* %6, %struct.symbol** %3
%7 = load %struct.symbol*, %struct.symbol** %3
ret %struct.symbol* %7
}

LLVM IR (-O2):
%struct.symbol = type { i32 }
define %struct.symbol* @symbol_ptr(i32 %0) {
%2 = tail call i64 @generic_ptr(i32 48, i32 %0)
%3 = inttoptr i64 %2 to %struct.symbol*
ret %struct.symbol* %3
}
/* Variables and functions */
int /*<<< orphan*/ ReadFile(char *);
int /*<<< orphan*/ WriteOutputOnlyStd(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    printf("Usage: %s trainfile\n", argv[0]);
    exit(0);
  }
  ReadFile(argv[1]);
  WriteOutputOnlyStd("manipulate.train");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1173 <main+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ReadFile@plt>
lea    0xe8e(%rip),%rdi
call   1050 <WriteOutputOnlyStd@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    115f <main+0x1f>
mov    0x8(%rsi),%rdi
call   1030 <ReadFile@plt>
lea    0xebf(%rip),%rdi
call   1050 <WriteOutputOnlyStd@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s trainfile\0A\00"
@.str.1 = [17 x i8] c"manipulate.train\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 2
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @ReadFile(i8* %16)
%18 = call i32 @WriteOutputOnlyStd(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s trainfile\0A\00"
@.str.1 = [17 x i8] c"manipulate.train\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @ReadFile(i8* %10)
%12 = tail call i32 @WriteOutputOnlyStd(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int seri_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @seri_init() {
ret i32 0
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char **argv) {
  int c;
  c = getchar();
  while (c != EOF) {
    if (c == '\r')
      c = getchar();
    putchar(c);
    c = getchar();
  }
  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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%eax
je     117d <main+0x5d>
cmpl   $0xd,-0x14(%rbp)
jne    1166 <main+0x46>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
jmp    114e <main+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     1160 <main+0x40>
cmp    $0xd,%eax
jne    1140 <main+0x20>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %2, %11
%7 = phi i32 [ %14, %11 ], [ %3, %2 ]
%8 = icmp eq i32 %7, 13
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @getchar()
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %10, %9 ], [ %7, %6 ]
%13 = tail call i32 @putchar(i32 %12)
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %6
17: ; preds = %11, %2
ret i32 0
}
/* Variables and functions */
int plan_count_entries(char const *);
int /*<<< orphan*/ plan_set_entry(char const *, int);
void set(const char *plan, int entry) {
  int entries = plan_count_entries(plan);
  plan_set_entry(plan, ((entry) < (1)             ? (1)
                        : (entry) > (entries + 1) ? (entries + 1)
                                                  : (entry)));
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <plan_count_entries@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    115a <set+0x3a>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1185 <set+0x65>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1179 <set+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117f <set+0x5f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <plan_set_entry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <plan_count_entries@plt>
add    $0x1,%eax
cmp    %ebx,%eax
cmovge %ebx,%eax
test   %ebx,%ebx
mov    $0x1,%esi
cmovg  %eax,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <plan_set_entry@plt>

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

LLVM IR (-O2):
define void @set(i8* %0, i32 %1) {
%3 = tail call i32 @plan_count_entries(i8* %0)
%4 = icmp slt i32 %1, 1
%5 = add nsw i32 %3, 1
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
%8 = select i1 %4, i32 1, i32 %7
%9 = tail call i32 @plan_set_entry(i8* %0, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vxge_get_registers_common();
int /*<<< orphan*/ vxge_get_registers_legacy();
int /*<<< orphan*/ vxge_get_registers_mrpcim();
int /*<<< orphan*/ vxge_get_registers_pcicfgmgmt();
int /*<<< orphan*/ vxge_get_registers_srpcim();
int /*<<< orphan*/ vxge_get_registers_toc();
int /*<<< orphan*/ vxge_get_registers_vpath();
int /*<<< orphan*/ vxge_get_registers_vpmgmt();
void vxge_get_registers_all(void) {
  vxge_get_registers_legacy();
  vxge_get_registers_toc();
  vxge_get_registers_common();
  vxge_get_registers_pcicfgmgmt();
  vxge_get_registers_srpcim();
  vxge_get_registers_mrpcim();
  vxge_get_registers_vpmgmt();
  vxge_get_registers_vpath();
}


x86 assembly (clang, -O0):
<vxge_get_registers_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <vxge_get_registers_legacy@plt>
mov    $0x0,%al
call   1090 <vxge_get_registers_toc@plt>
mov    $0x0,%al
call   1070 <vxge_get_registers_common@plt>
mov    $0x0,%al
call   1060 <vxge_get_registers_pcicfgmgmt@plt>
mov    $0x0,%al
call   1040 <vxge_get_registers_srpcim@plt>
mov    $0x0,%al
call   1050 <vxge_get_registers_mrpcim@plt>
mov    $0x0,%al
call   10a0 <vxge_get_registers_vpmgmt@plt>
mov    $0x0,%al
call   1030 <vxge_get_registers_vpath@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vxge_get_registers_all>:
push   %rax
xor    %eax,%eax
call   1080 <vxge_get_registers_legacy@plt>
xor    %eax,%eax
call   1090 <vxge_get_registers_toc@plt>
xor    %eax,%eax
call   1070 <vxge_get_registers_common@plt>
xor    %eax,%eax
call   1060 <vxge_get_registers_pcicfgmgmt@plt>
xor    %eax,%eax
call   1040 <vxge_get_registers_srpcim@plt>
xor    %eax,%eax
call   1050 <vxge_get_registers_mrpcim@plt>
xor    %eax,%eax
call   10a0 <vxge_get_registers_vpmgmt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <vxge_get_registers_vpath@plt>

LLVM IR (-O0):
define void @vxge_get_registers_all() {
%1 = call i32 (...) @vxge_get_registers_legacy()
%2 = call i32 (...) @vxge_get_registers_toc()
%3 = call i32 (...) @vxge_get_registers_common()
%4 = call i32 (...) @vxge_get_registers_pcicfgmgmt()
%5 = call i32 (...) @vxge_get_registers_srpcim()
%6 = call i32 (...) @vxge_get_registers_mrpcim()
%7 = call i32 (...) @vxge_get_registers_vpmgmt()
%8 = call i32 (...) @vxge_get_registers_vpath()
ret void
}

LLVM IR (-O2):
define void @vxge_get_registers_all() {
%1 = tail call i32 (...) @vxge_get_registers_legacy()
%2 = tail call i32 (...) @vxge_get_registers_toc()
%3 = tail call i32 (...) @vxge_get_registers_common()
%4 = tail call i32 (...) @vxge_get_registers_pcicfgmgmt()
%5 = tail call i32 (...) @vxge_get_registers_srpcim()
%6 = tail call i32 (...) @vxge_get_registers_mrpcim()
%7 = tail call i32 (...) @vxge_get_registers_vpmgmt()
%8 = tail call i32 (...) @vxge_get_registers_vpath()
ret void
}
const void *print_reloc_proc(const void *obj, const char *cname,
                             const void *robj) {
  do {
  } while (0);
  return robj;
}


x86 assembly (clang, -O0):
<print_reloc_proc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1115 <print_reloc_proc+0x15>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_reloc_proc>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @print_reloc_proc(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load i8*, i8** %6
ret i8* %9
}

LLVM IR (-O2):
define i8* @print_reloc_proc(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* readnone returned %2) {
ret i8* %2
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_sb_alloc();
struct clad_sb *clad_sb_init_empty(int /*<<< orphan*/);
struct clad_sb *clad_sb_make_empty() {
  return clad_sb_init_empty(clad_sb_alloc());
}


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

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

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_make_empty() {
%1 = call i32 (...) @clad_sb_alloc()
%2 = call %struct.clad_sb* @clad_sb_init_empty(i32 %1)
ret %struct.clad_sb* %2
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define %struct.clad_sb* @clad_sb_make_empty() {
%1 = tail call i32 (...) @clad_sb_alloc()
%2 = tail call %struct.clad_sb* @clad_sb_init_empty(i32 %1)
ret %struct.clad_sb* %2
}
/* Variables and functions */
int /*<<< orphan*/ compute_matrix_T(double *, double, double, double, double);
void compute_matrix_B(double *B, double c1, double c2) {
  double x;
  x = 1.0 / (1.0 + c2 - c1);
  compute_matrix_T(B, (1.0 - c1) * x, -c2 * x, 1.0 - c1, c1);
}


x86 assembly (clang, -O0):
<compute_matrix_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xed2(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xec0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xeab(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  0xe78(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm3
call   1030 <compute_matrix_T@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_matrix_B>:
movapd %xmm0,%xmm3
movsd  0xee4(%rip),%xmm2
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
subsd  %xmm3,%xmm0
movapd %xmm2,%xmm4
divsd  %xmm0,%xmm4
subsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm4,%xmm0
xorpd  0xecc(%rip),%xmm1
mulsd  %xmm4,%xmm1
jmp    1030 <compute_matrix_T@plt>

LLVM IR (-O0):
define void @compute_matrix_B(double* %0, double %1, double %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = fadd double 1.000000e+00, %8
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %7
%13 = load double*, double** %4
%14 = load double, double* %5
%15 = fsub double 1.000000e+00, %14
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = load double, double* %6
%19 = fneg double %18
%20 = load double, double* %7
%21 = fmul double %19, %20
%22 = load double, double* %5
%23 = fsub double 1.000000e+00, %22
%24 = load double, double* %5
%25 = call i32 @compute_matrix_T(double* %13, double %17, double %21, double %23, double %24)
ret void
}

LLVM IR (-O2):
define void @compute_matrix_B(double* %0, double %1, double %2) {
%4 = fadd double %2, 1.000000e+00
%5 = fsub double %4, %1
%6 = fdiv double 1.000000e+00, %5
%7 = fsub double 1.000000e+00, %1
%8 = fmul double %7, %6
%9 = fneg double %2
%10 = fmul double %6, %9
%11 = tail call i32 @compute_matrix_T(double* %0, double %8, double %10, double %7, double %1)
ret void
}
/* Type definitions */
struct FindjoB {
  int dummy;
};

/* Variables and functions */
int Findjob_set_prop_filter(struct FindjoB *, int, int, int /*<<< orphan*/);
int Findjob_set_filter_filter(struct FindjoB *o, int value, int flag) {
  int ret;
  ret = Findjob_set_prop_filter(o, 8, value, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Findjob_set_filter_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x8,%esi
xor    %ecx,%ecx
call   1030 <Findjob_set_prop_filter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Findjob_set_filter_filter>:
mov    %esi,%edx
mov    $0x8,%esi
xor    %ecx,%ecx
jmp    1030 <Findjob_set_prop_filter@plt>

LLVM IR (-O0):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_filter_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = alloca %struct.FindjoB*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.FindjoB* %0, %struct.FindjoB** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.FindjoB*, %struct.FindjoB** %4
%9 = load i32, i32* %5
%10 = call i32 @Findjob_set_prop_filter(%struct.FindjoB* %8, i32 8, i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.FindjoB = type { i32 }
define i32 @Findjob_set_filter_filter(%struct.FindjoB* %0, i32 %1, i32 %2) {
%4 = tail call i32 @Findjob_set_prop_filter(%struct.FindjoB* %0, i32 8, i32 %1, i32 0)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t geteuid(void) { return (uid_t)1; }


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

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

LLVM IR (-O0):
define i32 @geteuid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct entity_t {
  int dummy;
};

/* Variables and functions */
void write_shield_data_to_net(uint32_t conn, struct entity_t *shield) { ; }


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

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

LLVM IR (-O0):
%struct.entity_t = type { i32 }
define void @write_shield_data_to_net(i32 %0, %struct.entity_t* %1) {
%3 = alloca i32
%4 = alloca %struct.entity_t*
store i32 %0, i32* %3
store %struct.entity_t* %1, %struct.entity_t** %4
ret void
}

LLVM IR (-O2):
%struct.entity_t = type { i32 }
define void @write_shield_data_to_net(i32 %0, %struct.entity_t* nocapture %1) {
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          char *);
void time_print(char *str) {
  struct timeval t;
  gettimeofday(&t, NULL);
  printf("%ld.%06ld: %s", t.tv_sec, t.tv_usec, str);
}


x86 assembly (clang, -O0):
<time_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_print>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%esi
lea    0xebd(%rip),%rdi
mov    %rbx,%rcx
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"%ld.%06ld: %s\00"
define void @time_print(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.timeval
store i8* %0, i8** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [14 x i8] c"%ld.%06ld: %s\00"
define void @time_print(i8* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i8* %0)
ret void
}
unsigned int f0(int x, unsigned int y) { return x ? y : -1; }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <f0+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112c <f0+0x2c>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <f0+0x2c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
cmp    $0x1,%edi
sbb    %eax,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @f0(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %4
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i32 [ %8, %7 ], [ -1, %9 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f0(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %1
ret i32 %4
}
int fun1026() { return 1026; }


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

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

LLVM IR (-O0):
define i32 @fun1026() {
ret i32 1026
}

LLVM IR (-O2):
define i32 @fun1026() {
ret i32 1026
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_architecture(void) { printf("SPARC"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"SPARC\00"
define void @get_architecture() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"SPARC\00"
define void @get_architecture() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void cb2(int (*bar)(void)) { printf("Result: %d \n", bar()); }


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

x86 assembly (clang, -O2):
<cb2>:
push   %rax
call   *%rdi
lea    0xee6(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Result: %d \0A\00"
define void @cb2(i32 ()* %0) {
%2 = alloca i32 ()*
store i32 ()* %0, i32 ()** %2
%3 = load i32 ()*, i32 ()** %2
%4 = call i32 %3()
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Result: %d \0A\00"
define void @cb2(i32 ()* nocapture %0) {
%2 = tail call i32 %0()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int db_delete_playlist(char **, int);
int pi_db_delete_playlist(char **pe, int playlistid) {
  return db_delete_playlist(pe, playlistid);
}


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

x86 assembly (clang, -O2):
<pi_db_delete_playlist>:
jmp    1030 <db_delete_playlist@plt>

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

LLVM IR (-O2):
define i32 @pi_db_delete_playlist(i8** %0, i32 %1) {
%3 = tail call i32 @db_delete_playlist(i8** %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *argv[]) {
  printf("P1 Usage: \n");
  printf("\t %s num \n", argv[0]);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"P1 Usage: \0A\00"
@.str.1 = [11 x i8] c"\09 %s num \0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\09 %s num \0A\00"
@str = [11 x i8] c"P1 Usage: \00"
define void @print_usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
int cmp_int(const void *aa, const void *bb) {
  const int *a = aa, *b = bb;
  return (*a < *b) ? -1 : (*a > *b);
}


x86 assembly (clang, -O0):
<cmp_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
jge    113b <cmp_int+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <cmp_int+0x52>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_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 slt i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %24
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp sgt i32 %19, %21
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %17, %16
%25 = phi i32 [ -1, %16 ], [ %23, %17 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_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 slt i32 %5, %6
%8 = icmp sgt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void comm_begin_async_transmit(void) {}


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

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

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

LLVM IR (-O2):
define void @comm_begin_async_transmit() {
ret void
}
void f2_struct() {
  struct S1;
  struct S1 *s1;
  struct S1 {
    int i;
    int j;
  };
  struct S1 s2;
  *s1 = s2;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.S1 = type { i32, i32 }
define void @f2_struct() {
%1 = alloca %struct.S1*
%2 = alloca %struct.S1
%3 = load %struct.S1*, %struct.S1** %1
%4 = bitcast %struct.S1* %3 to i8*
%5 = bitcast %struct.S1* %2 to i8*
ret void
}

LLVM IR (-O2):
double read_double(const char *buf) { return *(double *)buf; }


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

x86 assembly (clang, -O2):
<read_double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @read_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @read_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
int intFromData(unsigned char *data) {
  int i = 0x00;
  i |= (data[7] << 24);
  i |= (data[6] << 16);
  i |= (data[5] << 8);
  i |= (data[4]);
  return i;
}


x86 assembly (clang, -O0):
<intFromData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @intFromData(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 6
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 16
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 5
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 8
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i32, i32* %3
%30 = or i32 %29, %28
store i32 %30, i32* %3
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @intFromData(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 6
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 5
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}
/* Variables and functions */
int crc16_ccitt(void *, int);
int /*<<< orphan*/ printf(char *, int);
void crctest() {
  int intbuf[] = {1, 2, 3, 4, 5};
  printf("%d\n", crc16_ccitt((void *)intbuf, 5));
}


x86 assembly (clang, -O0):
<crctest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <crc16_ccitt@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crctest>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <crc16_ccitt@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.crctest.intbuf = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define void @crctest() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = bitcast i32* %3 to i8*
%5 = call i32 @crc16_ccitt(i8* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@__const.crctest.intbuf = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define void @crctest() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = call i32 @crc16_ccitt(i8* %2, i32 5)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void HibernateIntDisable(unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC014))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<HibernateIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fc014,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fc014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntDisable>:
not    %rdi
and    %rdi,0x400fc014
40
ret

LLVM IR (-O0):
define void @HibernateIntDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074774036 to i64*)
ret void
}

LLVM IR (-O2):
define void @HibernateIntDisable(i64 %0) {
%2 = xor i64 %0, -1
%3 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%4 = and i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 1074774036 to i64*)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t wyrand(uint64_t *seed) {
  *seed += 0xa0761d6478bd642full;
  uint64_t see1 = *seed ^ 0xe7037ed1a0b428dbull;
  see1 *= (see1 >> 32) | (see1 << 32);
  return (*seed * ((*seed >> 32) | (*seed << 32))) ^
         ((see1 >> 32) | (see1 << 32));
}


x86 assembly (clang, -O0):
<wyrand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
movabs $0xa0761d6478bd642f,%rdx
1d 76 a0
add    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
movabs $0xe7037ed1a0b428db,%rcx
7e 03 e7
xor    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    -0xc(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
or     %edx,%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    -0x10(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wyrand>:
addl   $0x78bd642f,(%rdi)
ret

LLVM IR (-O0):
define i32 @wyrand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = add i64 %6, -6884282663029611473
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = xor i64 %11, -1800455987208640293
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = ashr i32 %14, 32
%16 = load i32, i32* %3
%17 = shl i32 %16, 32
%18 = or i32 %15, %17
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, %18
store i32 %20, i32* %3
%21 = load i32*, i32** %2
%22 = load i32, i32* %21
%23 = load i32*, i32** %2
%24 = load i32, i32* %23
%25 = ashr i32 %24, 32
%26 = load i32*, i32** %2
%27 = load i32, i32* %26
%28 = shl i32 %27, 32
%29 = or i32 %25, %28
%30 = mul nsw i32 %22, %29
%31 = load i32, i32* %3
%32 = ashr i32 %31, 32
%33 = load i32, i32* %3
%34 = shl i32 %33, 32
%35 = or i32 %32, %34
%36 = xor i32 %30, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @wyrand(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 2025677871
store i32 %3, i32* %0
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  char name[200];
  double a, b;
  gets(name);
  scanf("%lf %lf", &a, &b);
  printf("TOTAL = R$ %.2lf\n", a + b * .15);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeb3(%rip),%rdi
lea    -0xd8(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
call   1050 <scanf@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  0xe80(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
lea    0x10(%rsp),%rdi
call   1040 <gets@plt>
lea    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
mulsd  0xe9e(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call double @llvm.fmuladd.f64(double %9, double 1.500000e-01, double %8)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [18 x i8] c"TOTAL = R$ %.2lf\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca double
%3 = alloca double
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = call i32 @gets(i8* %4)
%8 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %10, double 1.500000e-01, double %9)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}
int movePieces() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @movePieces() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void abandon_ship() {
  printf("\nUnsuccessful termination. See README.TXT for more details.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<abandon_ship>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abandon_ship>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"\0AUnsuccessful termination. See README.TXT for more details.\0A\00"
define void @abandon_ship() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"\0AUnsuccessful termination. See README.TXT for more details.\00"
define void @abandon_ship() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}