xunge/DecIR huggingface dataset:
int func6_in_obj(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func6_in_obj() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ capture_args(char **, int *);
void keep_args_handler(char **argv, int *idx) {
  (*idx)++;
  capture_args(argv, idx);
}


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

x86 assembly (clang, -O2):
<keep_args_handler>:
addl   $0x1,(%rsi)
jmp    1030 <capture_args@plt>

LLVM IR (-O0):
define void @keep_args_handler(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i8**, i8*** %3
%9 = load i32*, i32** %4
%10 = call i32 @capture_args(i8** %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @keep_args_handler(i8** %0, i32* %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = tail call i32 @capture_args(i8** %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(int, char const *, unsigned int, char *, long);
void *realloc(void *, size_t);
void *srealloc(void *restrict ptr, size_t size, const char *file,
               unsigned line) {
  void *restrict res = realloc(ptr, size);
  if (!res && size)
    fail(1, file, line, "allocation of %ld bytes failed\n", (long)size);
  return res;
}


x86 assembly (clang, -O0):
<srealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    117a <srealloc+0x5a>
cmpq   $0x0,-0x10(%rbp)
je     117a <srealloc+0x5a>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%r8
mov    $0x1,%edi
lea    0xe8b(%rip),%rcx
call   1030 <fail@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srealloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%rbp
test   %rbx,%rbx
je     115c <srealloc+0x3c>
test   %rbp,%rbp
jne    115c <srealloc+0x3c>
lea    0xeb7(%rip),%rcx
mov    $0x1,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %rbx,%r8
call   1030 <fail@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation of %ld bytes failed\0A\00"
define i8* @srealloc(i8* noalias %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = icmp ne i8* %13, null
br i1 %14, label %23, label %15
15: ; preds = %4
%16 = load i64, i64* %6
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = load i64, i64* %6
%22 = call i32 @fail(i32 1, i8* %19, i32 %20, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %21)
br label %23
23: ; preds = %18, %15, %4
%24 = load i8*, i8** %9
ret i8* %24
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation of %ld bytes failed\0A\00"
define noalias i8* @srealloc(i8* noalias nocapture %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
%7 = icmp ne i64 %1, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @fail(i32 1, i8* %2, i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %11
11: ; preds = %9, %4
ret i8* %5
}
/* Variables and functions */
void *malloc(size_t const);
int /*<<< orphan*/ memcpy(void *, void *, size_t const);
void *ds_sll_copyElement(void *element, const size_t element_size) {
  void *copy = malloc(element_size);
  if (copy == NULL) {
    return NULL;
  }
  memcpy(copy, element, element_size);
  return copy;
}


x86 assembly (clang, -O0):
<ds_sll_copyElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1155 <ds_sll_copyElement+0x35>
movq   $0x0,-0x8(%rbp)
jmp    116e <ds_sll_copyElement+0x4e>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds_sll_copyElement>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <ds_sll_copyElement+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ds_sll_copyElement(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* null, i8** %3
br label %18
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %12, %11
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @ds_sll_copyElement(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int winsch(int /*<<< orphan*/ *, int /*<<< orphan*/);
int __darwin_winsch(WINDOW *w, uint32_t c) { return winsch(w, c); }


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

x86 assembly (clang, -O2):
<__darwin_winsch>:
jmp    1030 <winsch@plt>

LLVM IR (-O0):
define i32 @__darwin_winsch(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 = call i32 @winsch(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__darwin_winsch(i32* %0, i32 %1) {
%3 = tail call i32 @winsch(i32* %0, i32 %1)
ret i32 %3
}
int main() { return 125; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 125
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x85() {
  Assert_real((isspace(133) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              670, ("isspace should be 0 for 0x85"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x85\00"
define void @t_isspace_0x85() {
%1 = tail call i64 @isspace(i32 133)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 670, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int a_cas(volatile int *p, int t, int s) {
  if (*p == t)
    *p = s;
  return t;
}


x86 assembly (clang, -O0):
<a_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1126 <a_cas+0x26>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas>:
mov    %esi,%eax
mov    (%rdi),%ecx
cmp    %esi,%ecx
jne    110a <a_cas+0xa>
mov    %edx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @a_cas(i32* %0, i32 returned %1, i32 %2) {
%4 = load volatile i32, i32* %0
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store volatile i32 %2, i32* %0
br label %7
7: ; preds = %6, %3
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ service();
int main() {
  service();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @service()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int canJump(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x[] = {2, 0};
  printf("%d\n", canJump(x, sizeof(x) / sizeof(int)));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x2,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <canJump@plt>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 2, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @canJump(i32* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int calc_offset(int total, int part, int nthreads) {
  return (part * (total / nthreads));
}


x86 assembly (clang, -O0):
<calc_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_offset>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @calc_offset(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = sdiv i32 %8, %9
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @calc_offset(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %2
%5 = mul nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello,world!!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hello,world!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello,world!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
bool isOpen_5(FILE *this) { return this != NULL; }


x86 assembly (clang, -O0):
<isOpen_5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOpen_5>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @isOpen_5(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isOpen_5(i32* readnone %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, long);
int long2str(long value, char *buf, size_t len) {
  return mysnprintf(buf, len, "%ld", value);
}


x86 assembly (clang, -O0):
<long2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <mysnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long2str>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <mysnprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @long2str(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @mysnprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 %4
}
int fun1168() { return 1168; }


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

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

LLVM IR (-O0):
define i32 @fun1168() {
ret i32 1168
}

LLVM IR (-O2):
define i32 @fun1168() {
ret i32 1168
}
void rop3_239_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D | stk3;
  stk1 = S | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_239_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_239_1_0>:
not    %dl
mov    (%rdi),%al
or     %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_239_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = and i32 %28, %31
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8, i8* %5
%37 = zext i8 %36 to i32
%38 = and i32 %35, %37
%39 = or i32 %32, %38
%40 = trunc i32 %39 to i8
%41 = load i8*, i8** %4
store i8 %40, i8* %41
ret void
}

LLVM IR (-O2):
define void @rop3_239_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %1, -1
%8 = and i8 %6, %7
%9 = and i8 %5, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ setjmp(int /*<<< orphan*/);
int main(void) {
  jmp_buf buf;
  setjmp(buf);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = call i32 @setjmp(i32 undef)
ret i32 0
}
h() { return 12; }


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

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

LLVM IR (-O0):
define i32 @h() {
ret i32 12
}

LLVM IR (-O2):
define i32 @h() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pcap_import_help(void) {
  printf("usage: pig --sub-task=pcap-import --pcap=<pcap-file-path> "
         "--pigsty=<pigsty-file-path> --include-ethernet-frames\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<pcap_import_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [113 x i8] c"usage: pig --sub-task=pcap-import --pcap=<pcap-file-path> --pigsty=<pigsty-file-path> --include-ethernet-frames\0A\00"
define i32 @pcap_import_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [112 x i8] c"usage: pig --sub-task=pcap-import --pcap=<pcap-file-path> --pigsty=<pigsty-file-path> --include-ethernet-frames\00"
define i32 @pcap_import_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([112 x i8], [112 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void function_empty_real_date_end() { write("csv-task.csv", ",", NULL); }


x86 assembly (clang, -O0):
<function_empty_real_date_end>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_empty_real_date_end>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_real_date_end() {
%1 = call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"csv-task.csv\00"
@.str.1 = [2 x i8] c",\00"
define void @function_empty_real_date_end() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
scalar_t__ I2C_IF_ReadFrom(int, unsigned char *, int, unsigned char *,
                           unsigned char);
int /*<<< orphan*/ Report(char *);
int BlockRead(unsigned char ucRegAddr, unsigned char *pucBlkData,
              unsigned char ucBlkDataSz) {
  if (I2C_IF_ReadFrom(0x18, &ucRegAddr, 1, pucBlkData, ucBlkDataSz) != 0) {
    Report("I2C readfrom failed\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<BlockRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x18,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x11(%rbp),%r8d
call   1030 <I2C_IF_ReadFrom@plt>
cmp    $0x0,%rax
je     1175 <BlockRead+0x55>
lea    0xe9c(%rip),%rdi
call   1040 <Report@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <BlockRead+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockRead>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x18,%edi
mov    $0x1,%edx
call   1030 <I2C_IF_ReadFrom@plt>
test   %rax,%rax
je     1158 <BlockRead+0x38>
lea    0xeb4(%rip),%rdi
call   1040 <Report@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"I2C readfrom failed\0A\00"
define i32 @BlockRead(i8 zeroext %0, i8* %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i8
store i8 %0, i8* %5
store i8* %1, i8** %6
store i8 %2, i8* %7
%8 = load i8*, i8** %6
%9 = load i8, i8* %7
%10 = call i64 @I2C_IF_ReadFrom(i32 24, i8* %5, i32 1, i8* %8, i8 zeroext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @Report(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %15
14: ; preds = %3
store i32 0, i32* %4
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"I2C readfrom failed\0A\00"
define i32 @BlockRead(i8 zeroext %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8
store i8 %0, i8* %4
%5 = call i64 @I2C_IF_ReadFrom(i32 24, i8* %4, i32 1, i8* %1, i8 zeroext %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = call i32 @Report(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ -1, %7 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ PutChar(int);
void _PrintChar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else
    PutChar(c);
}


x86 assembly (clang, -O0):
<_PrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <_PrintChar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <_PrintChar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <PutChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_PrintChar>:
test   %rdi,%rdi
je     1120 <_PrintChar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <PutChar@plt>

LLVM IR (-O0):
define void @_PrintChar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @PutChar(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @_PrintChar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @PutChar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
void GPMCBaseAddrSet(unsigned int baseAddr, unsigned int csNum,
                     unsigned int addr) {
  (*((volatile unsigned int *)(baseAddr + (0x78 + (csNum * (0x30)))))) &=
      ~(0x0000003Fu);
  (*((volatile unsigned int *)(baseAddr + (0x78 + (csNum * (0x30)))))) |=
      ((addr << (0x00000000u)) & (0x0000003Fu));
}


x86 assembly (clang, -O0):
<GPMCBaseAddrSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x78,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffc0,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x0,%edx
and    $0x3f,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x78,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCBaseAddrSet>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x78,%eax
andl   $0xffffffc0,(%rax)
and    $0x3f,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCBaseAddrSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 120, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -64
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 0
%18 = and i32 %17, 63
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 120, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCBaseAddrSet(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 120
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -64
store volatile i32 %10, i32* %8
%11 = and i32 %2, 63
%12 = load volatile i32, i32* %8
%13 = or i32 %12, %11
store volatile i32 %13, i32* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ lex(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  FILE *myfile;
  myfile = fopen(argv[1], "r");
  if (myfile == NULL)
    return -1;
  lex(myfile);
  fclose(myfile);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1175 <main+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    -0x18(%rbp),%rdi
call   1030 <lex@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115d <main+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <lex@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
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 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %10, i32** %6
%11 = load i32*, i32** %6
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %19
14: ; preds = %2
%15 = load i32*, i32** %6
%16 = call i32 @lex(i32* %15)
%17 = load i32*, i32** %6
%18 = call i32 @fclose(i32* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @lex(i32* %5)
%9 = tail call i32 @fclose(i32* %5)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test(double);
int /*<<< orphan*/ test2(double, double, double);
int main() {
  test(2.0);
  test2(2.0, 3.0, 4.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <test@plt>
movsd  0xebc(%rip),%xmm0
movsd  0xebc(%rip),%xmm1
movsd  0xebc(%rip),%xmm2
call   1030 <test2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <test@plt>
movsd  0xed2(%rip),%xmm1
movsd  0xed2(%rip),%xmm2
movsd  0xeba(%rip),%xmm0
call   1030 <test2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(double 2.000000e+00)
%3 = call i32 @test2(double 2.000000e+00, double 3.000000e+00, double 4.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(double 2.000000e+00)
%2 = tail call i32 @test2(double 2.000000e+00, double 3.000000e+00, double 4.000000e+00)
ret i32 0
}
void funcion_v_ii(int a, int b) {
  int z;
  z = 30;
}


x86 assembly (clang, -O0):
<funcion_v_ii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @funcion_v_ii(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 30, i32* %5
ret void
}

LLVM IR (-O2):
define void @funcion_v_ii(i32 %0, i32 %1) {
ret void
}
void testMyFunc(void) {}


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

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

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

LLVM IR (-O2):
define void @testMyFunc() {
ret void
}
void put_device(struct device *dev) { return; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @put_device(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @put_device(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int IPC_CREAT;
int IPC_EXCL;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmget(int, int, int);
int main() {
  int shm;
  shm = shmget(2555, sizeof(int), IPC_CREAT | IPC_EXCL);
  if (shm == -1) {
    perror("shmget:");
    exit(-1);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
mov    $0x9fb,%edi
mov    $0x4,%esi
call   1040 <shmget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1183 <main+0x53>
lea    0xe8c(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    $0x9fb,%edi
mov    $0x4,%esi
call   1040 <shmget@plt>
cmp    $0xffffffff,%eax
jne    116d <main+0x3d>
lea    0xea2(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
@.str = [8 x i8] c"shmget:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_CREAT
%4 = load i32, i32* @IPC_EXCL
%5 = or i32 %3, %4
%6 = call i32 @shmget(i32 2555, i32 4, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %0
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@IPC_EXCL = global i32 0
@.str = [8 x i8] c"shmget:\00"
define i32 @main() {
%1 = load i32, i32* @IPC_CREAT
%2 = load i32, i32* @IPC_EXCL
%3 = or i32 %2, %1
%4 = tail call i32 @shmget(i32 2555, i32 4, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc15(void) {
  printf("Executing exitfunc15.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc15.\0A\00"
define void @exitfunc15() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc15.\00"
define void @exitfunc15() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t log_sense_page_code(uint8_t *data) { return data[0] & 0x3F; }


x86 assembly (clang, -O0):
<log_sense_page_code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_sense_page_code>:
mov    (%rdi),%eax
and    $0x3f,%eax
ret

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

LLVM IR (-O2):
define i32 @log_sense_page_code(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 63
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *PageAlloc(size_t _Block) { return malloc(_Block); }


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

x86 assembly (clang, -O2):
<PageAlloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @PageAlloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @PageAlloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printUsage(FILE *out) {
  fprintf(out, "Usage: qmake -query QT_VERSION\n\n");
  fprintf(out, "This is a minimal QMake stub so that CMake may find "
               "the Qt distribution bundled with the Mitsuba dependencies.\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeea(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xeed(%rip),%rdi
mov    $0x6f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: qmake -query QT_VERSION\0A\0A\00"
@.str.1 = [112 x i8] c"This is a minimal QMake stub so that CMake may find the Qt distribution bundled with the Mitsuba dependencies.\0A\00"
define void @printUsage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: qmake -query QT_VERSION\0A\0A\00"
@.str.1 = [112 x i8] c"This is a minimal QMake stub so that CMake may find the Qt distribution bundled with the Mitsuba dependencies.\0A\00"
define void @printUsage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.1, i64 0, i64 0), i64 111, i64 1, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ CL_CDKeyValidate(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (CL_CDKeyValidate("ICENINJAMENRULES", "08FF")) {
    printf("Key is bad\n");
  } else {
    printf("Key is good\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <CL_CDKeyValidate@plt>
cmp    $0x0,%rax
je     115d <main+0x3d>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <main+0x49>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1040 <CL_CDKeyValidate@plt>
test   %rax,%rax
lea    0xed8(%rip),%rax
lea    0xedd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"ICENINJAMENRULES\00"
@.str.1 = [5 x i8] c"08FF\00"
@.str.2 = [12 x i8] c"Key is bad\0A\00"
@.str.3 = [13 x i8] c"Key is good\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @CL_CDKeyValidate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"ICENINJAMENRULES\00"
@.str.1 = [5 x i8] c"08FF\00"
@str = [12 x i8] c"Key is good\00"
@str.4 = [11 x i8] c"Key is bad\00"
define i32 @main() {
%1 = tail call i64 @CL_CDKeyValidate(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str.4, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
void *malloc(long);
void *javacall_memory_heap_allocate(long size, long *outSize) {
  void *ptr = NULL;
  ptr = malloc(size);
  if (ptr == NULL) {
    *outSize = 0;
  } else {
    *outSize = size;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<javacall_memory_heap_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1150 <javacall_memory_heap_allocate+0x40>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    115b <javacall_memory_heap_allocate+0x4b>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<javacall_memory_heap_allocate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
cmove  %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @javacall_memory_heap_allocate(i64 %0, i64* nocapture writeonly %1) {
%3 = tail call i8* @malloc(i64 %0)
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i64 0, i64 %0
store i64 %5, i64* %1
ret i8* %3
}
/* Variables and functions */
double ___yn(int /*<<< orphan*/, double *);
double y0(double x) { return ___yn(0, &x); }


x86 assembly (clang, -O0):
<y0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <___yn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y0>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <___yn@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @y0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @___yn(i32 0, double* %2)
ret double %3
}

LLVM IR (-O2):
define double @y0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @___yn(i32 0, double* %2)
ret double %3
}
/* Type definitions */
typedef char const int32_t;

/* Variables and functions */
char *strrchr(const char *s, int32_t c) {
  char *returnval = NULL;
  do {
    if (*s == c)
      returnval = (char *)s;
  } while (*s++);
  return returnval;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strrchr+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1136 <strrchr+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1116 <strrchr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
cmp    %sil,%cl
cmove  %rdi,%rax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = phi i8* [ null, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, %1
%8 = select i1 %7, i8* %4, i8* %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %8
}