xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *, int, char *);
void *malloc(size_t);
void *h2o_mem_alloc(size_t sz) {
  void *p = malloc(sz);
  if (p == NULL)
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/"
               "master/include/h2o/h2o/memory.h",
               373, "no memory");
  return p;
}


x86 assembly (clang, -O0):
<h2o_mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <h2o_mem_alloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x175,%esi
lea    0xf3b(%rip),%rdx
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <h2o_mem_alloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf56(%rip),%rdx
mov    $0x175,%esi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/master/include/h2o/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define i8* @h2o_mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @h2o__fatal(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 373, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/deweerdt/h2o/refs/heads/master/include/h2o/h2o/memory.h\00"
@.str.1 = [10 x i8] c"no memory\00"
define noalias i8* @h2o_mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 373, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int is_arg_marker(char c) { return (c == '/' || c == '-'); }


x86 assembly (clang, -O0):
<is_arg_marker>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_arg_marker+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_arg_marker>:
and    $0xfd,%dil
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_arg_marker(i8 signext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dec2hex(int);
int main() {
  int a = 12;
  dec2hex(a);
  int b = 34;
  dec2hex(b);
  int c = 75;
  dec2hex(c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1030 <dec2hex@plt>
mov    $0x22,%edi
call   1030 <dec2hex@plt>
mov    $0x4b,%edi
call   1030 <dec2hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 12, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @dec2hex(i32 %5)
store i32 34, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @dec2hex(i32 %7)
store i32 75, i32* %4
%9 = load i32, i32* %4
%10 = call i32 @dec2hex(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dec2hex(i32 12)
%2 = tail call i32 @dec2hex(i32 34)
%3 = tail call i32 @dec2hex(i32 75)
ret i32 0
}
int test_imm_ECint8_reg(signed char val) {
  return ((val) & (0xEC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ECint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ECint8_reg>:
test   $0xec,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ECint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 236
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_ECint8_reg(i8 signext %0) {
%2 = and i8 %0, -20
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test_two(int x, int y) {
#pragma omp target
#pragma omp teams distribute parallel for
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *paranoia_malloc(size_t size) { return malloc(size); }


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

LLVM IR (-O0):
define i8* @paranoia_malloc(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* @paranoia_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int pell(int n) {
  if (n == 0 || n == 1)
    return n;
  return 2 * pell(n - 1) + pell(n - 2);
}


x86 assembly (clang, -O0):
<pell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <pell+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <pell+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <pell+0x50>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <pell@plt>
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <pell@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pell>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x2,%edi
jb     1144 <pell+0x34>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <pell@plt>
add    $0xfffffffe,%ebx
lea    (%r14,%rax,2),%r14d
cmp    $0x1,%ebx
ja     1130 <pell+0x20>
add    %ebx,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @pell(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %10, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @pell(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %5
%11 = icmp ult i32 %9, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
%14 = phi i32 [ %0, %1 ], [ %9, %3 ]
%15 = add nsw i32 %14, %13
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void signal_int(int unused __attribute__((unused))) { die("Interrupted."); }


x86 assembly (clang, -O0):
<signal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Interrupted.\00"
define void @signal_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Interrupted.\00"
define void @signal_int(i32 %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *stuff) {
  if (stuff != NULL)
    free(stuff);
}


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

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

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

LLVM IR (-O2):
define void @my_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int **ksum(int *, int, int, int, int *);
int **fourSum(int *nums, int numsSize, int target, int *returnSize) {
  return ksum(nums, numsSize, target, 4, returnSize);
}


x86 assembly (clang, -O0):
<fourSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x4,%ecx
call   1030 <ksum@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourSum>:
mov    %rcx,%r8
mov    $0x4,%ecx
jmp    1030 <ksum@plt>

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

LLVM IR (-O2):
define i32** @fourSum(i32* %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32** @ksum(i32* %0, i32 %1, i32 %2, i32 4, i32* %3)
ret i32** %5
}
/* Type definitions */
typedef int /*<<< orphan*/ nfds_t;

/* Variables and functions */
int /*<<< orphan*/ collect_pipe();
int /*<<< orphan*/ do_output(int /*<<< orphan*/);
void run(void) {
  nfds_t nfds;
  while ((nfds = collect_pipe()) != 0) {
    do_output(nfds);
  }
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <collect_pipe@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1148 <run+0x28>
mov    -0x4(%rbp),%edi
call   1030 <do_output@plt>
jmp    1128 <run+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <collect_pipe@plt>
test   %eax,%eax
je     1144 <run+0x24>
mov    %eax,%edi
call   1030 <do_output@plt>
jmp    1130 <run+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @run() {
%1 = tail call i32 (...) @collect_pipe()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @do_output(i32 %4)
%6 = tail call i32 (...) @collect_pipe()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_setresuid;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ printf(char *, long);
long syscall(int /*<<< orphan*/, int, int, int);
void change_thread_ids(void) {
  long ret = syscall(__NR_setresuid, 2001, 2002, 2003);
  if (ret != 0)
    do {
      printf("FAIL: "
             "setresuid (2001, 2002, 2003): %ld"
             "\n",
             ret);
      _exit(1);
    } while (0);
}


x86 assembly (clang, -O0):
<change_thread_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    $0x7d1,%esi
mov    $0x7d2,%edx
mov    $0x7d3,%ecx
call   1050 <syscall@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1183 <change_thread_ids+0x53>
jmp    1169 <change_thread_ids+0x39>
mov    -0x8(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_thread_ids>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    $0x7d1,%esi
mov    $0x7d2,%edx
mov    $0x7d3,%ecx
call   1050 <syscall@plt>
test   %rax,%rax
jne    1155 <change_thread_ids+0x25>
pop    %rax
ret
lea    0xea4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@__NR_setresuid = global i32 0
@.str = [41 x i8] c"FAIL: setresuid (2001, 2002, 2003): %ld\0A\00"
define void @change_thread_ids() {
%1 = alloca i64
%2 = load i32, i32* @__NR_setresuid
%3 = call i64 @syscall(i32 %2, i32 2001, i32 2002, i32 2003)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
br label %7
7: ; preds = %6
%8 = load i64, i64* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 @_exit(i32 1)
unreachable
11: ; No predecessors!
br label %12
12: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
@__NR_setresuid = global i32 0
@.str = [41 x i8] c"FAIL: setresuid (2001, 2002, 2003): %ld\0A\00"
define void @change_thread_ids() {
%1 = load i32, i32* @__NR_setresuid
%2 = tail call i64 @syscall(i32 %1, i32 2001, i32 2002, i32 2003)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %2)
%6 = tail call i32 @_exit(i32 1)
unreachable
7: ; preds = %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ *cl_mem;
typedef int /*<<< orphan*/ cl_context;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int CreateBuffer(cl_mem *a_dev, cl_mem *b_dev, cl_mem *c_dev, cl_context ctx,
                 const size_t size) {
  assert(*a_dev != NULL);
  assert(*b_dev != NULL);
  assert(*c_dev != NULL);
  return 0;
}


x86 assembly (clang, -O0):
<CreateBuffer>:
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    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateBuffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
xor    %eax,%eax
cmpq   $0x0,(%rdi)
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%r14)
setne  %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @CreateBuffer(i32** %0, i32** %1, i32** %2, i32 %3, i64 %4) {
%6 = alloca i32**
%7 = alloca i32**
%8 = alloca i32**
%9 = alloca i32
%10 = alloca i64
store i32** %0, i32*** %6
store i32** %1, i32*** %7
store i32** %2, i32*** %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32**, i32*** %6
%12 = load i32*, i32** %11
%13 = icmp ne i32* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32**, i32*** %7
%17 = load i32*, i32** %16
%18 = icmp ne i32* %17, null
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32**, i32*** %8
%22 = load i32*, i32** %21
%23 = icmp ne i32* %22, null
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
ret i32 0
}

LLVM IR (-O2):
define i32 @CreateBuffer(i32** nocapture %0, i32** nocapture %1, i32** nocapture %2, i32 %3, i64 %4) {
%6 = load i32*, i32** %0
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = load i32*, i32** %1
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = load i32*, i32** %2
%15 = icmp ne i32* %14, null
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
ret i32 0
}
double wrap(double voxel_value) {
  double wrapped_voxel_value;
  if (voxel_value > 3.1415926535897932384626433832795)
    wrapped_voxel_value = voxel_value - (2 * 3.1415926535897932384626433832795);
  else if (voxel_value < -3.1415926535897932384626433832795)
    wrapped_voxel_value = voxel_value + (2 * 3.1415926535897932384626433832795);
  else
    wrapped_voxel_value = voxel_value;
  return wrapped_voxel_value;
}


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <wrap+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <wrap+0x74>
movsd  0xec5(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1165 <wrap+0x65>
movsd  0xeba(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116f <wrap+0x6f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <wrap+0x74>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap>:
ucomisd 0xef8(%rip),%xmm0
jbe    1113 <wrap+0x13>
addsd  0xf06(%rip),%xmm0
ret
movsd  0xeed(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1129 <wrap+0x29>
addsd  0xee7(%rip),%xmm0
ret

LLVM IR (-O0):
define double @wrap(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0x400921FB54442D18
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = fsub double %7, 0x401921FB54442D18
store double %8, double* %3
br label %18
9: ; preds = %1
%10 = load double, double* %2
%11 = fcmp olt double %10, 0xC00921FB54442D18
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %2
%14 = fadd double %13, 0x401921FB54442D18
store double %14, double* %3
br label %17
15: ; preds = %9
%16 = load double, double* %2
store double %16, double* %3
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %6
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @wrap(double %0) {
%2 = fcmp ogt double %0, 0x400921FB54442D18
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fadd double %0, 0xC01921FB54442D18
br label %9
5: ; preds = %1
%6 = fcmp olt double %0, 0xC00921FB54442D18
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = fadd double %0, 0x401921FB54442D18
br label %9
9: ; preds = %5, %7, %3
%10 = phi double [ %4, %3 ], [ %8, %7 ], [ %0, %5 ]
ret double %10
}
/* Variables and functions */
int rom_present(char *);
int et4000_available(void) {
  return rom_present(L"roms/video/et4000/et4000.bin");
}


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

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

LLVM IR (-O0):
@.str = [29 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @et4000_available() {
%1 = call i32 @rom_present(i8* bitcast ([29 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [29 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @et4000_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([29 x i32]* @.str to i8*))
ret i32 %1
}
int ft_isalpha(int c) {
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <ft_isalpha+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    112f <ft_isalpha+0x2f>
cmpl   $0x61,-0x8(%rbp)
jl     113b <ft_isalpha+0x3b>
cmpl   $0x7a,-0x8(%rbp)
jg     113b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 122
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char arif;
  arif = 'a';
  printf("%c", arif);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int ntohll(int);
uint64_t get_unaligned_u64(const uint64_t *p_) {
  const uint8_t *p = (const uint8_t *)p_;
  return ntohll(((uint64_t)p[0] << 56) | ((uint64_t)p[1] << 48) |
                ((uint64_t)p[2] << 40) | ((uint64_t)p[3] << 32) | (p[4] << 24) |
                (p[5] << 16) | (p[6] << 8) | p[7]);
}


x86 assembly (clang, -O0):
<get_unaligned_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x38,%ecx
shl    %cl,%edi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    $0x30,%ecx
shl    %cl,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
shl    $0x18,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%eax
shl    $0x8,%eax
or     %eax,%edi
mov    -0x10(%rbp),%rax
or     0x1c(%rax),%edi
call   1030 <ntohll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_u64>:
jmp    1030 <ntohll@plt>

LLVM IR (-O0):
define i32 @get_unaligned_u64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 56
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 48
%13 = or i32 %8, %12
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = shl i32 %16, 40
%18 = or i32 %13, %17
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = shl i32 %21, 32
%23 = or i32 %18, %22
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 4
%26 = load i32, i32* %25
%27 = shl i32 %26, 24
%28 = or i32 %23, %27
%29 = load i32*, i32** %3
%30 = getelementptr inbounds i32, i32* %29, i64 5
%31 = load i32, i32* %30
%32 = shl i32 %31, 16
%33 = or i32 %28, %32
%34 = load i32*, i32** %3
%35 = getelementptr inbounds i32, i32* %34, i64 6
%36 = load i32, i32* %35
%37 = shl i32 %36, 8
%38 = or i32 %33, %37
%39 = load i32*, i32** %3
%40 = getelementptr inbounds i32, i32* %39, i64 7
%41 = load i32, i32* %40
%42 = or i32 %38, %41
%43 = call i32 @ntohll(i32 %42)
ret i32 %43
}

LLVM IR (-O2):
define i32 @get_unaligned_u64(i32* nocapture readnone %0) {
%2 = tail call i32 @ntohll(i32 poison)
ret i32 %2
}
double pow2(double a) { return a * a; }


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

x86 assembly (clang, -O2):
<pow2>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pow2(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void minipack_pack_bin8(void *ptr, uint8_t length, size_t *sz) {
  *sz = 2;
  *((uint8_t *)ptr) = 0xC4;
  *((uint8_t *)(ptr + 1)) = length;
}


x86 assembly (clang, -O0):
<minipack_pack_bin8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xc4,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_pack_bin8>:
movq   $0x2,(%rdx)
movl   $0xc4,(%rdi)
mov    %esi,0x1(%rdi)
ret

LLVM IR (-O0):
define void @minipack_pack_bin8(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 2, i64* %7
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32 196, i32* %9
%10 = load i32, i32* %5
%11 = load i8*, i8** %4
%12 = getelementptr i8, i8* %11, i64 1
%13 = bitcast i8* %12 to i32*
store i32 %10, i32* %13
ret void
}

LLVM IR (-O2):
define void @minipack_pack_bin8(i8* nocapture writeonly %0, i32 %1, i64* nocapture writeonly %2) {
store i64 2, i64* %2
%4 = bitcast i8* %0 to i32*
store i32 196, i32* %4
%5 = getelementptr i8, i8* %0, i64 1
%6 = bitcast i8* %5 to i32*
store i32 %1, i32* %6
ret void
}
int i_ceil(float x) {
  int z;
  z = x;
  if (z > x) {
    return z;
  } else {
    return (z + 1);
  }
}


x86 assembly (clang, -O0):
<i_ceil>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112b <i_ceil+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <i_ceil+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_ceil>:
cvttss2si %xmm0,%ecx
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @i_ceil(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
%5 = load float, float* %3
%6 = fptosi float %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to float
%9 = load float, float* %3
%10 = fcmp ogt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @i_ceil(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp ule float %3, %0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %5, %2
ret i32 %6
}
void file4(void) { printf("Control in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<file4>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file4 = [6 x i8] c"file4\00"
define void @file4() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file4 = [6 x i8] c"file4\00"
define void @file4() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file4, i64 0, i64 0))
ret void
}
int fun_call_by_other(int a, int b) { return 1; }


x86 assembly (clang, -O0):
<fun_call_by_other>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fun_call_by_other(i32 %0, i32 %1) {
ret i32 1
}
int libmesh_C_isnan_float(float a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libmesh_C_isnan_float(float %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lmrglo_(double *, double *, int *);
void clmrglo(double *para, double *xmom, int nmom) {
  lmrglo_(para, xmom, &nmom);
}


x86 assembly (clang, -O0):
<clmrglo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <lmrglo_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clmrglo>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <lmrglo_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clmrglo(double* %0, double* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @lmrglo_(double* %0, double* %1, i32* %4)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int c) {
  if (isupper(c) || islower(c))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
jne    114f <isalpha+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     115b <isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <islower@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @islower(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_PEKEYR() {
  return mem_get_reg32(0x40023C00 + 0x0C);
}


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

x86 assembly (clang, -O2):
<flash_get_PEKEYR>:
mov    $0x40023c0c,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_PEKEYR() {
%1 = call i32* @mem_get_reg32(i32 1073888268)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_PEKEYR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888268)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ CP15DCacheCleanFlush();
void CacheDataCleanInvalidateAll(void) { CP15DCacheCleanFlush(); }


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

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

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

LLVM IR (-O2):
define void @CacheDataCleanInvalidateAll() {
%1 = tail call i32 (...) @CP15DCacheCleanFlush()
ret void
}
void Fun_s4_Found_TRANSITION(void) {}


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

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

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

LLVM IR (-O2):
define void @Fun_s4_Found_TRANSITION() {
ret void
}
long long unsigned as_uint64(long long a) {
  return *((long long unsigned *)&a);
}


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

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

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

LLVM IR (-O2):
define i64 @as_uint64(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ symlink(char const *, char const *);
int32_t mz_os_make_symlink(const char *path, const char *target_path) {
  if (symlink(target_path, path) != 0)
    return (-104);
  return (0);
}


x86 assembly (clang, -O0):
<mz_os_make_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <symlink@plt>
cmp    $0x0,%rax
je     1143 <mz_os_make_symlink+0x33>
movl   $0xffffff98,-0x4(%rbp)
jmp    114a <mz_os_make_symlink+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_os_make_symlink>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <symlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0xffffff98,%eax
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mz_os_make_symlink(i8* %0, i8* %1) {
%3 = tail call i64 @symlink(i8* %1, i8* %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 0, i32 -104
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __gxx_personality_v0() { abort(); }


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

x86 assembly (clang, -O2):
<__gxx_personality_v0>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__gxx_personality_v0() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__gxx_personality_v0() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_registers(int, int *, struct user_regs_struct *);
void register_back_up(int variant_count, int *child,
                      struct user_regs_struct *back_up_regs) {
  get_registers(variant_count, child, back_up_regs);
}


x86 assembly (clang, -O0):
<register_back_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <get_registers@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_back_up>:
jmp    1030 <get_registers@plt>

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

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @register_back_up(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = tail call i32 @get_registers(i32 %0, i32* %1, %struct.user_regs_struct* %2)
ret void
}
void search1() {}


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

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

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

LLVM IR (-O2):
define void @search1() {
ret void
}
int gx_pos(int i, int sep_x, int nx, int nx_whole, int ng, int td_num) {
  int gx_position = ((td_num % sep_x) * nx + i - ng + nx_whole) % nx_whole;
  return gx_position;
}


x86 assembly (clang, -O0):
<gx_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gx_pos>:
mov    %r9d,%eax
mov    %edx,%r9d
cltd
idiv   %esi
imul   %edx,%r9d
lea    (%rdi,%rcx,1),%eax
sub    %r8d,%eax
add    %r9d,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @gx_pos(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%14 = load i32, i32* %12
%15 = load i32, i32* %8
%16 = srem i32 %14, %15
%17 = load i32, i32* %9
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %7
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %11
%22 = sub nsw i32 %20, %21
%23 = load i32, i32* %10
%24 = add nsw i32 %22, %23
%25 = load i32, i32* %10
%26 = srem i32 %24, %25
store i32 %26, i32* %13
%27 = load i32, i32* %13
ret i32 %27
}

LLVM IR (-O2):
define i32 @gx_pos(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = srem i32 %5, %1
%8 = mul nsw i32 %7, %2
%9 = add i32 %3, %0
%10 = sub i32 %9, %4
%11 = add i32 %10, %8
%12 = srem i32 %11, %3
ret i32 %12
}
int fun1364() { return 1364; }


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

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

LLVM IR (-O0):
define i32 @fun1364() {
ret i32 1364
}

LLVM IR (-O2):
define i32 @fun1364() {
ret i32 1364
}
/* Variables and functions */
int js0n(unsigned char *, int, unsigned short *, int);
int strlen(char *);
char *j0g(char *json, unsigned short *index, int ilen) {
  int ret, len;
  if (!json)
    return NULL;
  len = strlen(json);
  ret = js0n((unsigned char *)json, len, index, ilen);
  if (ret)
    *index = 0;
  return json;
}


x86 assembly (clang, -O0):
<j0g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <j0g+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1188 <j0g+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <js0n@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1180 <j0g+0x60>
mov    -0x18(%rbp),%rax
movw   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j0g>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1152 <j0g+0x32>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <js0n@plt>
test   %eax,%eax
je     1152 <j0g+0x32>
movw   $0x0,(%r14)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @j0g(i8* %0, i16* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @js0n(i8* %0, i32 %6, i16* %1, i32 %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %5
store i16 0, i16* %1
br label %10
10: ; preds = %5, %9, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _shutdownHandler() { printf("\n Shutting down!"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0A Shutting down!\00"
define void @_shutdownHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A Shutting down!\00"
define void @_shutdownHandler() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f440(int *);
int f441(int *p) { return f440(p); }


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

x86 assembly (clang, -O2):
<f441>:
jmp    1030 <f440@plt>

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

LLVM IR (-O2):
define i32 @f441(i32* %0) {
%2 = tail call i32 @f440(i32* %0)
ret i32 %2
}