xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int test(int *, int);
int main() {
  int arr[3] = {1, 2, 3};
  int ret = test(arr, 3);
  printf("sum is %d\n", ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1040 <test@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1040 <test@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [3 x i32] [i32 1, i32 2, i32 3]
@.str = [11 x i8] c"sum is %d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @test(i32* %3, i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void gtk_fixed_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_new() {
ret void
}
int update(char *text) {}


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @update(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _sp_realloc(void *, int /*<<< orphan*/);
void sp_mem_free(void *ptr) { _sp_realloc(ptr, 0); }


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

x86 assembly (clang, -O2):
<sp_mem_free>:
xor    %esi,%esi
jmp    1030 <_sp_realloc@plt>

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

LLVM IR (-O2):
define void @sp_mem_free(i8* %0) {
%2 = tail call i32 @_sp_realloc(i8* %0, i32 0)
ret void
}
unsigned int get_hash_from_key(void *key) {
  char *str = (char *)key;
  unsigned int hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<get_hash_from_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1149 <get_hash_from_key+0x49>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <get_hash_from_key+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hash_from_key>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <get_hash_from_key+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <get_hash_from_key+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @get_hash_from_key(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ unix_error(char *);
int Close(int fd) {
  int rc;
  if ((rc = close(fd)) < 0)
    unix_error("Close error");
  return rc;
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    114b <Close+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <unix_error@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rbx
call   1030 <close@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Close+0x18>
lea    0xecd(%rip),%rdi
call   1040 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Close error\00"
define i32 @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"Close error\00"
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
void foo066() {}


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

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

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

LLVM IR (-O2):
define void @foo066() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ends_with_cvc(char const *);
int word_size(char const *);
int remove_an_e(const char *word) {
  return ((1 == word_size(word)) && !ends_with_cvc(word));
}


x86 assembly (clang, -O0):
<remove_an_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <word_size@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
mov    %al,-0x9(%rbp)
jne    115d <remove_an_e+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <ends_with_cvc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_an_e>:
push   %rbx
mov    %rdi,%rbx
call   1040 <word_size@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1143 <remove_an_e+0x23>
mov    %rbx,%rdi
call   1030 <ends_with_cvc@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @remove_an_e(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @word_size(i8* %3)
%5 = icmp eq i32 1, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @ends_with_cvc(i8* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @remove_an_e(i8* %0) {
%2 = tail call i32 @word_size(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @ends_with_cvc(i8* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *arr, int strLength) {
  for (int i = 0; i < strLength; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
void gtk_tree_drag_dest_drag_data_received() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_drag_dest_drag_data_received() {
ret void
}
void copy_velocities_gpu(int option) {}


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

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

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

LLVM IR (-O2):
define void @copy_velocities_gpu(i32 %0) {
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
struct page *vmalloc_to_page(void *);
struct page *pcpu_addr_to_page(void *addr) {
  return vmalloc_to_page(addr);
}


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

x86 assembly (clang, -O2):
<pcpu_addr_to_page>:
jmp    1030 <vmalloc_to_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define %struct.page* @pcpu_addr_to_page(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.page* @vmalloc_to_page(i8* %3)
ret %struct.page* %4
}

LLVM IR (-O2):
%struct.page = type { i32 }
define %struct.page* @pcpu_addr_to_page(i8* %0) {
%2 = tail call %struct.page* @vmalloc_to_page(i8* %0)
ret %struct.page* %2
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ putch(int);
int getche() {
  int c = getch();
  putch(c);
  return c;
}


x86 assembly (clang, -O0):
<getche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <putch@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getche>:
push   %rbx
xor    %eax,%eax
call   1030 <getch@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <putch@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getche() {
%1 = alloca i32
%2 = call i32 (...) @getch()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @putch(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @getche() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @putch(i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf_verbose(char *);
int oss_pcm_open(void) {
  printf_verbose("oss_pcm_open(...) = BLOCKED;");
  return -1;
}


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

x86 assembly (clang, -O2):
<oss_pcm_open>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"oss_pcm_open(...) = BLOCKED;\00"
define i32 @oss_pcm_open() {
%1 = call i32 @printf_verbose(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [29 x i8] c"oss_pcm_open(...) = BLOCKED;\00"
define i32 @oss_pcm_open() {
%1 = tail call i32 @printf_verbose(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void batadv_socket_init(void) {}


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

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

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

LLVM IR (-O2):
define void @batadv_socket_init() {
ret void
}
/* Variables and functions */
double getJuldayOrigin();
double gregorianDateToJulianDay(int, int, int);
double ut_encode_date(int year, int month, int day) {
  return 86400.0 *
         (gregorianDateToJulianDay(year, month, day) - getJuldayOrigin());
}


x86 assembly (clang, -O0):
<ut_encode_date>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <gregorianDateToJulianDay@plt>
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getJuldayOrigin@plt>
movsd  -0x18(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xea4(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_encode_date>:
push   %rax
call   1030 <gregorianDateToJulianDay@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <getJuldayOrigin@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xebd(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ut_encode_date(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 = load i32, i32* %6
%10 = call double @gregorianDateToJulianDay(i32 %7, i32 %8, i32 %9)
%11 = call double (...) @getJuldayOrigin()
%12 = fsub double %10, %11
%13 = fmul double 8.640000e+04, %12
ret double %13
}

LLVM IR (-O2):
define double @ut_encode_date(i32 %0, i32 %1, i32 %2) {
%4 = tail call double @gregorianDateToJulianDay(i32 %0, i32 %1, i32 %2)
%5 = tail call double (...) @getJuldayOrigin()
%6 = fsub double %4, %5
%7 = fmul double %6, 8.640000e+04
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void ace_tu_fs_append_str_to_file(char *path, char *str) {
  FILE *file = fopen(path, "a");
  fputs(str, file);
  fclose(file);
}


x86 assembly (clang, -O0):
<ace_tu_fs_append_str_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ace_tu_fs_append_str_to_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define void @ace_tu_fs_append_str_to_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = call i32 @fputs(i8* %8, i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define void @ace_tu_fs_append_str_to_file(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fputs(i8* %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
void computeRates(double voi, double *states, double *rates,
                  double *variables) {
  rates[0] = 1.23;
}


x86 assembly (clang, -O0):
<computeRates>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xedf(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeRates>:
movabs $0x3ff3ae147ae147ae,%rax
ae f3 3f
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @computeRates(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %7
%10 = getelementptr inbounds double, double* %9, i64 0
store double 1.230000e+00, double* %10
ret void
}

LLVM IR (-O2):
define void @computeRates(double %0, double* nocapture readnone %1, double* nocapture writeonly %2, double* nocapture readnone %3) {
store double 1.230000e+00, double* %2
ret void
}
/* Variables and functions */
unsigned int rapl_get_cpu_id();
int rapl_get_cpu_model() {
  unsigned int eax;
  eax = rapl_get_cpu_id();
  return (((eax >> 16) & 0xF) << 4) + ((eax >> 4) & 0xF);
}


x86 assembly (clang, -O0):
<rapl_get_cpu_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rapl_get_cpu_id@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xf,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_get_cpu_model>:
push   %rax
xor    %eax,%eax
call   1030 <rapl_get_cpu_id@plt>
mov    %eax,%ecx
shr    $0xc,%ecx
and    $0xf0,%ecx
shr    $0x4,%eax
and    $0xf,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rapl_get_cpu_model() {
%1 = alloca i32
%2 = call i32 (...) @rapl_get_cpu_id()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = lshr i32 %3, 16
%5 = and i32 %4, 15
%6 = shl i32 %5, 4
%7 = load i32, i32* %1
%8 = lshr i32 %7, 4
%9 = and i32 %8, 15
%10 = add i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @rapl_get_cpu_model() {
%1 = tail call i32 (...) @rapl_get_cpu_id()
%2 = lshr i32 %1, 12
%3 = and i32 %2, 240
%4 = lshr i32 %1, 4
%5 = and i32 %4, 15
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
char *_realpath(char *, int);
int /*<<< orphan*/ strcpy(char *, char const *);
char *my_realpath(const char *path1, char path2[], int decomp) {
  strcpy(path2, path1);
  return _realpath(path2, decomp);
}


x86 assembly (clang, -O0):
<my_realpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <_realpath@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_realpath>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_realpath@plt>

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

LLVM IR (-O2):
define i8* @my_realpath(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strcpy(i8* %1, i8* %0)
%5 = tail call i8* @_realpath(i8* %1, i32 %2)
ret i8* %5
}
int mul(int x, int y, int z) { return x * y; }


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

x86 assembly (clang, -O2):
<mul>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mul(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 nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @mul(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le16(int, int /*<<< orphan*/ *);
void put_unaligned_le32(uint32_t val, uint8_t *p) {
  __put_unaligned_le16(val >> 16, p + 2);
  __put_unaligned_le16(val, p);
}


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

x86 assembly (clang, -O2):
<put_unaligned_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
add    $0x8,%rsi
call   1030 <__put_unaligned_le16@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_le16@plt>

LLVM IR (-O0):
define void @put_unaligned_le32(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 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @__put_unaligned_le16(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_le16(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @put_unaligned_le32(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = getelementptr inbounds i32, i32* %1, i64 2
%5 = tail call i32 @__put_unaligned_le16(i32 %3, i32* %4)
%6 = tail call i32 @__put_unaligned_le16(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void wcsutrnfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<wcsutrnfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @wcsutrnfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int sigsegv_get_vma(unsigned long address, struct vma_struct *vma) {
  return -1;
}


x86 assembly (clang, -O0):
<sigsegv_get_vma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vma_struct = type opaque
define i32 @sigsegv_get_vma(i64 %0, %struct.vma_struct* %1) {
%3 = alloca i64
%4 = alloca %struct.vma_struct*
store i64 %0, i64* %3
store %struct.vma_struct* %1, %struct.vma_struct** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.vma_struct = type opaque
define i32 @sigsegv_get_vma(i64 %0, %struct.vma_struct* nocapture readnone %1) {
ret i32 -1
}
unsigned long hash_int(int fd, int total) { return fd % total; }


x86 assembly (clang, -O0):
<hash_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
movslq %edx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_int>:
mov    %edi,%eax
cltd
idiv   %esi
movslq %edx,%rax
ret

LLVM IR (-O0):
define i64 @hash_int(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 = srem i32 %5, %6
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_int(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int *arr, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    mergeSort(arr, p, q);
    mergeSort(arr, q + 1, r);
    merge(arr, p, q, r);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @mergeSort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
int is_unquote_start(int c) { return c == ','; }


x86 assembly (clang, -O0):
<is_unquote_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2c,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unquote_start>:
xor    %eax,%eax
cmp    $0x2c,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_unquote_start(i32 %0) {
%2 = icmp eq i32 %0, 44
%3 = zext i1 %2 to i32
ret i32 %3
}
void enable_interrupts() { asm volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
off_t __attribute__((const))
align_to_next_block(const off_t offset, const size_t bs) {
  return (offset + (off_t)bs - 1) & ~((off_t)bs - 1);
}


x86 assembly (clang, -O0):
<align_to_next_block>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
sub    $0x1,%eax
mov    -0x10(%rbp),%rcx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_to_next_block>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
neg    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @align_to_next_block(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %5, %7
%9 = sub nsw i32 %8, 1
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = sub nsw i32 %11, 1
%13 = xor i32 %12, -1
%14 = and i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @align_to_next_block(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = sub i32 0, %3
%7 = and i32 %5, %6
ret i32 %7
}
void dfn_acll(_Complex long long ll) {}


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

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

LLVM IR (-O0):
define void @dfn_acll(i64 %0, i64 %1) {
%3 = alloca { i64, i64 }
%4 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0
store i64 %0, i64* %4
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 1
store i64 %1, i64* %5
ret void
}

LLVM IR (-O2):
define void @dfn_acll(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int fchmod(int fd, mode_t mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fchmod(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void getWebRootPath(char *path) { strcpy(path, ""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @getWebRootPath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @getWebRootPath(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
__u64 vfio_pci_space_to_offset(int sp) { return (__u64)(sp) << 32; }


x86 assembly (clang, -O0):
<vfio_pci_space_to_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vfio_pci_space_to_offset(i32 %0) {
ret i32 poison
}
int ft_isdir(char *path) {
  (void)path;
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @ft_isdir(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdin;
char readchar(void) {
  int c;
  c = getchar();
  if (c == EOF && ferror(stdin)) {
    perror("read");
    exit(1);
  }
  return (c);
}


x86 assembly (clang, -O0):
<readchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%eax
jne    1192 <readchar+0x52>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     1192 <readchar+0x52>
lea    0xe7d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readchar>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2e8f(%rip),%rax
cmp    (%rax),%ebx
jne    1168 <readchar+0x28>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
test   %rax,%rax
jne    116c <readchar+0x2c>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe8d(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
@.str = [5 x i8] c"read\00"
define signext i8 @readchar() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32, i32* @stdin
%8 = call i64 @ferror(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %6, %0
%14 = load i32, i32* %1
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
@.str = [5 x i8] c"read\00"
define signext i8 @readchar() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %4, label %11
4: ; preds = %0
%5 = load i32, i32* @stdin
%6 = tail call i64 @ferror(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4, %0
%12 = trunc i32 %1 to i8
ret i8 %12
}
void foo_1_1_2_2_2_2_1_2_2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ARGBToYRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned char);
void Delay(unsigned char n) { sleep(n); }


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @Delay(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @sleep(i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @Delay(i8 zeroext %0) {
%2 = tail call i32 @sleep(i8 zeroext %0)
ret void
}
void fun3(void) {
  float *fp;
#pragma acc data deviceptr(fp, fp)
  ;
#pragma acc parallel deviceptr(fp) deviceptr(fp)
  ;
#pragma acc kernels copy(fp) deviceptr(fp)
  ;
}


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

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

LLVM IR (-O0):
define void @fun3() {
%1 = alloca float*
ret void
}

LLVM IR (-O2):
define void @fun3() {
ret void
}
/* Variables and functions */
int *malloc(int);
int *verticesFromFace(int v1, int v2, int v3, int v4) {
  int *vertices = malloc(4 * sizeof(int));
  return vertices;
}


x86 assembly (clang, -O0):
<verticesFromFace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verticesFromFace>:
mov    $0x10,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @verticesFromFace(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @malloc(i32 16)
ret i32* %5
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_splashscreen_image3(void *data, unsigned sz) {
  return flash_image(data, sz, "splashscreen3");
}


x86 assembly (clang, -O0):
<flash_splashscreen_image3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"splashscreen3\00"
define i32 @flash_splashscreen_image3(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @flash_image(i8* %5, i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"splashscreen3\00"
define i32 @flash_splashscreen_image3(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
char *xmemdupz(char const *, int);
char *xstrndup(const char *str, size_t len) {
  char *p = memchr(str, '\0', len);
  return xmemdupz(str, p ? p - str : len);
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <memchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <xstrndup+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    1172 <xstrndup+0x52>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    %eax,%esi
call   1030 <xmemdupz@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memchr@plt>
mov    %eax,%ecx
sub    %r14d,%ecx
test   %rax,%rax
cmovne %ecx,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xmemdupz@plt>

LLVM IR (-O0):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @memchr(i8* %6, i8 signext 0, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
br label %20
18: ; preds = %2
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %12
%21 = phi i64 [ %17, %12 ], [ %19, %18 ]
%22 = trunc i64 %21 to i32
%23 = call i8* @xmemdupz(i8* %9, i32 %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
%9 = trunc i64 %8 to i32
%10 = tail call i8* @xmemdupz(i8* %0, i32 %9)
ret i8* %10
}
/* Variables and functions */
int detect();
int /*<<< orphan*/ printf(char *);
void get_subarchitecture(void) {
  if (detect() == 1 || detect() == 2 || detect() == 3) {
    printf("P5600");
  } else {
    printf("UNKNOWN");
  }
}


x86 assembly (clang, -O0):
<get_subarchitecture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <detect@plt>
cmp    $0x1,%eax
je     1154 <get_subarchitecture+0x34>
mov    $0x0,%al
call   1040 <detect@plt>
cmp    $0x2,%eax
je     1154 <get_subarchitecture+0x34>
mov    $0x0,%al
call   1040 <detect@plt>
cmp    $0x3,%eax
jne    1165 <get_subarchitecture+0x45>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <get_subarchitecture+0x51>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_subarchitecture>:
push   %rbx
xor    %eax,%eax
call   1040 <detect@plt>
lea    0xed1(%rip),%rbx
cmp    $0x1,%eax
je     115c <get_subarchitecture+0x3c>
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x2,%eax
je     115c <get_subarchitecture+0x3c>
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x3,%eax
lea    0xeaf(%rip),%rax
lea    0xeae(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"P5600\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i32 (...) @detect()
%5 = icmp eq i32 %4, 2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = call i32 (...) @detect()
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %6, %3, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"P5600\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = tail call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @detect()
%5 = icmp eq i32 %4, 2
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @detect()
%8 = icmp eq i32 %7, 3
%9 = select i1 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
br label %10
10: ; preds = %6, %0, %3
%11 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %0 ], [ %9, %6 ]
%12 = tail call i32 @printf(i8* dereferenceable(1) %11)
ret void
}
/* Variables and functions */
void *malloc(int);
void *klock_getT2() { return malloc(4); }


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

x86 assembly (clang, -O2):
<klock_getT2>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @klock_getT2() {
%1 = call i8* @malloc(i32 4)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @klock_getT2() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
ret i8* %1
}