xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long, unsigned long,
                          unsigned long, unsigned long);
void print_local_dynamic(unsigned long l1, unsigned long l2) {
  unsigned long ll1 = (unsigned long)&l1;
  unsigned long ll2 = (unsigned long)&l2;
  printf("  punteros locales....: %lx %lx (diferencia: %lu) %lx %lx\n", ll1,
         ll2, ll1 - ll2, (unsigned long)l1, (unsigned long)l2);
}


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

x86 assembly (clang, -O2):
<print_local_dynamic>:
sub    $0x18,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rsi
mov    %rsi,%rcx
sub    %rdx,%rcx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [59 x i8] c" punteros locales....: %lx %lx (diferencia: %lu) %lx %lx\0A\00"
define void @print_local_dynamic(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = ptrtoint i64* %3 to i64
store i64 %7, i64* %5
%8 = ptrtoint i64* %4 to i64
store i64 %8, i64* %6
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = sub i64 %11, %12
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c" punteros locales....: %lx %lx (diferencia: %lu) %lx %lx\0A\00"
define void @print_local_dynamic(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = ptrtoint i64* %3 to i64
%6 = ptrtoint i64* %4 to i64
%7 = sub i64 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6, i64 %7, i64 %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_event_inquiry_result_with_rssi_get_clock_offset(const uint8_t *event) {
  return little_endian_read_16(event, 14);
}


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

x86 assembly (clang, -O2):
<hci_event_inquiry_result_with_rssi_get_clock_offset>:
mov    $0xe,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_inquiry_result_with_rssi_get_clock_offset(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 14)
ret i32 %2
}
int intcmp(int a, int b) {
  if (a > b) {
    return 1;
  } else if (a < b) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <intcmp+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <intcmp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <intcmp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <intcmp+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intcmp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void NCONF_free_data(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_free_data() {
ret void
}
int m68k_cannot_fetch_register(int regno) { return (regno >= 29); }


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

x86 assembly (clang, -O2):
<m68k_cannot_fetch_register>:
xor    %eax,%eax
cmp    $0x1d,%edi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @m68k_cannot_fetch_register(i32 %0) {
%2 = icmp sgt i32 %0, 28
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int print_string(char *s) {
  int count = 0;
  while (*s) {
    putchar(*s++);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <print_string+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_string+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <print_string+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_string+0x10>
jmp    113a <print_string+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @print_string(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 i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw nsw i32 %6, 1
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
void prom_pause(char *message) {
  if (message == ((void *)0)) {
    message = "Type go<return> to continue.\n";
  }
  printk("%s", message);
  call_prom("enter", 0, 0);
  printk("\n");
}


x86 assembly (clang, -O0):
<prom_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1142 <prom_pause+0x22>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
lea    0xec6(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <call_prom@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prom_pause>:
push   %rax
test   %rdi,%rdi
lea    0xed5(%rip),%rsi
cmovne %rdi,%rsi
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printk@plt>
lea    0xedd(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <call_prom@plt>
lea    0xec6(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printk@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Type go<return> to continue.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"enter\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @prom_pause(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @call_prom to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Type go<return> to continue.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"enter\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @prom_pause(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @call_prom to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ mvprintw(int, int, char *);
int quit_game() {
  int c;
  mvprintw(17, 1, "Really quit? [y/N]");
  c = getch();
  if (c == 'y') {
    mvprintw(17, 1, "                  ");
    return 1;
  } else {
    mvprintw(17, 1, "                  ");
    return 0;
  }
}


x86 assembly (clang, -O0):
<quit_game>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
mov    $0x1,%esi
lea    0xec7(%rip),%rdx
call   1040 <mvprintw@plt>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x79,-0x8(%rbp)
jne    1174 <quit_game+0x54>
mov    $0x11,%edi
mov    $0x1,%esi
lea    0xeb0(%rip),%rdx
call   1040 <mvprintw@plt>
movl   $0x1,-0x4(%rbp)
jmp    1191 <quit_game+0x71>
mov    $0x11,%edi
mov    $0x1,%esi
lea    0xe8e(%rip),%rdx
call   1040 <mvprintw@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit_game>:
push   %rbx
lea    0xed8(%rip),%rdx
mov    $0x11,%edi
mov    $0x1,%esi
call   1040 <mvprintw@plt>
xor    %eax,%eax
call   1030 <getch@plt>
xor    %ebx,%ebx
cmp    $0x79,%eax
sete   %bl
lea    0xec6(%rip),%rdx
mov    $0x11,%edi
mov    $0x1,%esi
call   1040 <mvprintw@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Really quit? [y/N]\00"
@.str.1 = [19 x i8] c" \00"
define i32 @quit_game() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @mvprintw(i32 17, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getch()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 121
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @mvprintw(i32 17, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 @mvprintw(i32 17, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [19 x i8] c"Really quit? [y/N]\00"
@.str.1 = [19 x i8] c" \00"
define i32 @quit_game() {
%1 = tail call i32 @mvprintw(i32 17, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
%3 = icmp eq i32 %2, 121
%4 = tail call i32 @mvprintw(i32 17, i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = zext i1 %3 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bit_set(uint8_t *v, uint8_t bit) { *v |= bit; }


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @bit_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = or i32 %7, %5
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @bit_set(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = or i32 %3, %1
store i32 %4, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadByte(int /*<<< orphan*/, int);
uint8_t wiznetGetSocketTypeOfService(uint8_t socket) {
  return wiznetRegReadByte(socket, (0x0000 + 0x0015));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketTypeOfService>:
mov    $0x15,%esi
jmp    1030 <wiznetRegReadByte@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketTypeOfService(i32 %0) {
%2 = tail call i32 @wiznetRegReadByte(i32 %0, i32 21)
ret i32 %2
}
/* Type definitions */
struct wl_shell_surface_listener {
  int dummy;
};
struct wl_shell_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_shell_surface_add_listener(
    struct wl_shell_surface *wl_shell_surface,
    const struct wl_shell_surface_listener *listener, void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_shell_surface,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<wl_shell_surface_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_shell_surface = type { i32 }
%struct.wl_shell_surface_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shell_surface_add_listener(%struct.wl_shell_surface* %0, %struct.wl_shell_surface_listener* %1, i8* %2) {
%4 = alloca %struct.wl_shell_surface*
%5 = alloca %struct.wl_shell_surface_listener*
%6 = alloca i8*
store %struct.wl_shell_surface* %0, %struct.wl_shell_surface** %4
store %struct.wl_shell_surface_listener* %1, %struct.wl_shell_surface_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_shell_surface*, %struct.wl_shell_surface** %4
%8 = bitcast %struct.wl_shell_surface* %7 to %struct.wl_proxy*
%9 = load %struct.wl_shell_surface_listener*, %struct.wl_shell_surface_listener** %5
%10 = bitcast %struct.wl_shell_surface_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_shell_surface_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_shell_surface_add_listener(%struct.wl_shell_surface* %0, %struct.wl_shell_surface_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_shell_surface_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
void SteamAPI_ISteamUtils_RunFrame(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamUtils_RunFrame>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_RunFrame = [30 x i8] c"SteamAPI_ISteamUtils_RunFrame\00"
define void @SteamAPI_ISteamUtils_RunFrame(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamUtils_RunFrame, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_RunFrame = [30 x i8] c"SteamAPI_ISteamUtils_RunFrame\00"
define void @SteamAPI_ISteamUtils_RunFrame(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamUtils_RunFrame, i64 0, i64 0), i8* %0)
ret void
}
int fun1139() { return 1139; }


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

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

LLVM IR (-O0):
define i32 @fun1139() {
ret i32 1139
}

LLVM IR (-O2):
define i32 @fun1139() {
ret i32 1139
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      state[local1] *= state[local1];
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 809088178UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    115a <RandomFunc+0x5a>
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%edx
movzwl -0x14(%rbp),%eax
movzwl -0x12(%rbp,%rax,2),%ecx
imul   %edx,%ecx
mov    %cx,-0x12(%rbp,%rax,2)
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
imul   $0x3039b4b2,%rax,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
imul   $0xffffb4b2,%eax,%eax
add    $0x59fa,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = add nsw i32 %10, 2885
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
store i16 0, i16* %6
br label %14
14: ; preds = %18, %2
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %14
%19 = load i16, i16* %6
%20 = zext i16 %19 to i64
%21 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %20
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = load i16, i16* %6
%25 = zext i16 %24 to i64
%26 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 %25
%27 = load i16, i16* %26
%28 = zext i16 %27 to i32
%29 = mul nsw i32 %28, %23
%30 = trunc i32 %29 to i16
store i16 %30, i16* %26
%31 = load i16, i16* %6
%32 = zext i16 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i16
store i16 %34, i16* %6
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%37 = load i16, i16* %36
%38 = zext i16 %37 to i64
%39 = mul i64 %38, 809088178
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = mul i16 %3, -19278
%5 = add i16 %4, 23034
store i16 %5, i16* %1
ret void
}
void minusOne(int *start, int count) {
  int i;
  for (i = 0; i < count; i++) {
    start[i] = -1;
  }
}


x86 assembly (clang, -O0):
<minusOne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <minusOne+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <minusOne+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<minusOne>:
test   %esi,%esi
jle    1129 <minusOne+0x19>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @minusOne(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ challenge1();
int /*<<< orphan*/ challenge2();
int /*<<< orphan*/ challenge3();
int /*<<< orphan*/ challenge4();
int /*<<< orphan*/ challenge5();
int /*<<< orphan*/ challenge6();
int main(void) {
  challenge1();
  challenge2();
  challenge3();
  challenge4();
  challenge5();
  challenge6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <challenge1@plt>
mov    $0x0,%al
call   1050 <challenge2@plt>
mov    $0x0,%al
call   1060 <challenge3@plt>
mov    $0x0,%al
call   1030 <challenge4@plt>
mov    $0x0,%al
call   1070 <challenge5@plt>
mov    $0x0,%al
call   1040 <challenge6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <challenge1@plt>
xor    %eax,%eax
call   1050 <challenge2@plt>
xor    %eax,%eax
call   1060 <challenge3@plt>
xor    %eax,%eax
call   1030 <challenge4@plt>
xor    %eax,%eax
call   1070 <challenge5@plt>
xor    %eax,%eax
call   1040 <challenge6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @challenge1()
%3 = call i32 (...) @challenge2()
%4 = call i32 (...) @challenge3()
%5 = call i32 (...) @challenge4()
%6 = call i32 (...) @challenge5()
%7 = call i32 (...) @challenge6()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @challenge1()
%2 = tail call i32 (...) @challenge2()
%3 = tail call i32 (...) @challenge3()
%4 = tail call i32 (...) @challenge4()
%5 = tail call i32 (...) @challenge5()
%6 = tail call i32 (...) @challenge6()
ret i32 0
}
/* Variables and functions */
char jm_getch_(int);
char jm_getche(void) { return jm_getch_(1); }


x86 assembly (clang, -O0):
<jm_getche>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <jm_getch_@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jm_getche>:
mov    $0x1,%edi
jmp    1030 <jm_getch_@plt>

LLVM IR (-O0):
define signext i8 @jm_getche() {
%1 = call signext i8 @jm_getch_(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @jm_getche() {
%1 = tail call signext i8 @jm_getch_(i32 1)
ret i8 %1
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) {
  const unsigned char *p = (const unsigned char *)s;
  while (n--) {
    if (*p == (unsigned char)c) {
      return (void *)p;
    }
    ++p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1163 <memchr+0x63>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1152 <memchr+0x52>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <memchr+0x6b>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
test   %rdx,%rdx
je     1122 <memchr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     1124 <memchr+0x24>
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %rdx,%rdx
jne    1110 <memchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%9 = load i8*, i8** %5
store i8* %9, i8** %8
br label %10
10: ; preds = %24, %3
%11 = load i64, i64* %7
%12 = add i64 %11, -1
store i64 %12, i64* %7
%13 = icmp ne i64 %11, 0
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i32, i32* %6
%19 = trunc i32 %18 to i8
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i8*, i8** %8
store i8* %23, i8** %4
br label %28
24: ; preds = %14
%25 = load i8*, i8** %8
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %8
br label %10
27: ; preds = %10
store i8* null, i8** %4
br label %28
28: ; preds = %27, %22
%29 = load i8*, i8** %4
ret i8* %29
}

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %13
%8 = phi i64 [ %2, %5 ], [ %10, %13 ]
%9 = phi i8* [ %0, %5 ], [ %14, %13 ]
%10 = add i64 %8, -1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, %6
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = icmp eq i64 %10, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13, %3
%17 = phi i8* [ null, %3 ], [ null, %13 ], [ %9, %7 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *safe_malloc(size_t size) {
  void *tmp;
  tmp = malloc(size);
  assert(tmp != NULL);
  return tmp;
}


x86 assembly (clang, -O0):
<safe_malloc>:
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)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_malloc(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 ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
char *save_string(s, len) const char *s;
int len;
{
  register char *result = xmalloc(len + 1);
  memmove((result), (s), (len));
  result[len] = 0;
  return result;
}


x86 assembly (clang, -O0):
<save_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x0,%al
call   1030 <xmalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1040 <memmove@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_string>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
xor    %eax,%eax
call   1030 <xmalloc@plt>
movslq %eax,%rbx
movslq %r15d,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memmove@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @save_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @save_string(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @xmalloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %7, i1 false)
%8 = getelementptr inbounds i8, i8* %6, i64 %7
store i8 0, i8* %8
ret i8* %6
}
int main() {
  int a = 3;
  int b = 1, c;
  c = a + b;
  return c - 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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 3, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 4
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ thm_get_relative_grid_address(long ***, double **);
void ksp_get_thm_relative_grid_addresses(long relative_grid_addresses[24][4][3],
                                         double rec_lattice[3][3]) {
  thm_get_relative_grid_address(relative_grid_addresses, rec_lattice);
}


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

x86 assembly (clang, -O2):
<ksp_get_thm_relative_grid_addresses>:
jmp    1030 <thm_get_relative_grid_address@plt>

LLVM IR (-O0):
define void @ksp_get_thm_relative_grid_addresses([4 x [3 x i64]]* %0, [3 x double]* %1) {
%3 = alloca [4 x [3 x i64]]*
%4 = alloca [3 x double]*
store [4 x [3 x i64]]* %0, [4 x [3 x i64]]** %3
store [3 x double]* %1, [3 x double]** %4
%5 = load [4 x [3 x i64]]*, [4 x [3 x i64]]** %3
%6 = bitcast [4 x [3 x i64]]* %5 to i64***
%7 = load [3 x double]*, [3 x double]** %4
%8 = bitcast [3 x double]* %7 to double**
%9 = call i32 @thm_get_relative_grid_address(i64*** %6, double** %8)
ret void
}

LLVM IR (-O2):
define void @ksp_get_thm_relative_grid_addresses([4 x [3 x i64]]* %0, [3 x double]* %1) {
%3 = bitcast [4 x [3 x i64]]* %0 to i64***
%4 = bitcast [3 x double]* %1 to double**
%5 = tail call i32 @thm_get_relative_grid_address(i64*** %3, double** %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void f_print(const char *str) { printf("%s", str); }


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

x86 assembly (clang, -O2):
<f_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @f_print(i8* %0) {
%2 = alloca i8*
store i8* %0, 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* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @f_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
rectfs_(x1, y1, x2, y2) short *x1, *y1, *x2, *y2;
{ rectf((float)*x1, (float)*y1, (float)*x2, (float)*y2); }


x86 assembly (clang, -O0):
<rectfs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x28(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm3
cvtss2sd %xmm3,%xmm3
mov    $0x4,%al
call   1030 <rectf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectfs_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
movswl (%rcx),%eax
cvtsi2sd %eax,%xmm3
mov    $0x4,%al
jmp    1030 <rectf@plt>

LLVM IR (-O0):
define i32 @rectfs_(i16* %0, i16* %1, i16* %2, i16* %3) {
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i16*
store i16* %0, i16** %6
store i16* %1, i16** %7
store i16* %2, i16** %8
store i16* %3, i16** %9
%10 = load i16*, i16** %6
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = fpext float %12 to double
%14 = load i16*, i16** %7
%15 = load i16, i16* %14
%16 = sitofp i16 %15 to float
%17 = fpext float %16 to double
%18 = load i16*, i16** %8
%19 = load i16, i16* %18
%20 = sitofp i16 %19 to float
%21 = fpext float %20 to double
%22 = load i16*, i16** %9
%23 = load i16, i16* %22
%24 = sitofp i16 %23 to float
%25 = fpext float %24 to double
%26 = call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rectf to i32 (double, double, double, double, ...)*)(double %13, double %17, double %21, double %25)
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @rectfs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2, i16* nocapture %3) {
%5 = load i16, i16* %0
%6 = sitofp i16 %5 to double
%7 = load i16, i16* %1
%8 = sitofp i16 %7 to double
%9 = load i16, i16* %2
%10 = sitofp i16 %9 to double
%11 = load i16, i16* %3
%12 = sitofp i16 %11 to double
%13 = tail call i32 (double, double, double, double, ...) bitcast (i32 (...)* @rectf to i32 (double, double, double, double, ...)*)(double %6, double %8, double %10, double %12)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __streadd(char *, char const *, char const *, char *);
char *strecpy(char *output, const char *input, const char *exceptions) {
  (void)__streadd(output, input, exceptions, "\\");
  return (output);
}


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

x86 assembly (clang, -O2):
<strecpy>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rcx
call   1030 <__streadd@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\\\00"
define i8* @strecpy(i8* returned %0, i8* %1, i8* %2) {
%4 = tail call i32 @__streadd(i8* %0, i8* %1, i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %0
}
int function(int a) {
  a = a + 1;
  return a;
}


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

x86 assembly (clang, -O2):
<function>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @function(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
unsigned int lfsr_iterate(unsigned int state) {
  return (state >> 1) ^ (-(state & 1u) & 0xB400u);
}


x86 assembly (clang, -O0):
<lfsr_iterate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
and    $0xb400,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfsr_iterate>:
mov    %edi,%eax
shr    %eax
and    $0x1,%edi
neg    %edi
and    $0xb400,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @lfsr_iterate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = sub i32 0, %6
%8 = and i32 %7, 46080
%9 = xor i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @lfsr_iterate(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %0, 1
%4 = sub nsw i32 0, %3
%5 = and i32 %4, 46080
%6 = xor i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int errno;
long __set_errno(int n) {
  errno = n;
  return -1;
}


x86 assembly (clang, -O0):
<__set_errno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_errno>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @__set_errno(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* @errno
ret i64 -1
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @__set_errno(i32 %0) {
store i32 %0, i32* @errno
ret i64 -1
}
int first_divisor(int n) {
  int i;
  if (n == 1)
    return 1;
  for (i = 2; i <= n; i++)
    if (n % i == 0)
      return i;
  return 0;
}


x86 assembly (clang, -O0):
<first_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <first_divisor+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1165 <first_divisor+0x65>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115e <first_divisor+0x5e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114b <first_divisor+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <first_divisor+0x65>
jmp    1150 <first_divisor+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <first_divisor+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_divisor>:
mov    $0x1,%r8d
cmp    $0x1,%edi
je     1137 <first_divisor+0x37>
xor    %r8d,%r8d
cmp    $0x2,%edi
jl     1137 <first_divisor+0x37>
mov    %edi,%esi
neg    %esi
mov    $0x2,%ecx
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     113b <first_divisor+0x3b>
lea    (%rsi,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1120 <first_divisor+0x20>
mov    %r8d,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @first_divisor(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 2
br i1 %4, label %12, label %5
5: ; preds = %3, %9
%6 = phi i32 [ %10, %9 ], [ 2, %3 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = add nuw i32 %6, 1
%11 = icmp eq i32 %6, %0
br i1 %11, label %12, label %5
12: ; preds = %5, %9, %3, %1
%13 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %6, %5 ], [ 0, %9 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void crash_fputc() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  fputc(42, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x2a,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fputc>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0x2a,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fputc() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fputc(i32 42, i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_fputc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fputc(i32 42, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_NULL;

/* Variables and functions */
int /*<<< orphan*/ ASN1_NULL_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, const unsigned char **in, long len) {
  return (ASN1_NULL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &ASN1_NULL_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_NULL>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_NULL_it = global i32 0
define i32* @d2i_ASN1_NULL(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_NULL_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_NULL_it = global i32 0
define i32* @d2i_ASN1_NULL(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_NULL_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int check_bit(int /*<<< orphan*/, int);
int /*<<< orphan*/ get_status();
bool get_input_status() { return check_bit(get_status(), 1); }


x86 assembly (clang, -O0):
<get_input_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_status@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <check_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_input_status>:
push   %rax
xor    %eax,%eax
call   1040 <get_status@plt>
mov    %eax,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <check_bit@plt>

LLVM IR (-O0):
define i32 @get_input_status() {
%1 = call i32 (...) @get_status()
%2 = call i32 @check_bit(i32 %1, i32 1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_input_status() {
%1 = tail call i32 (...) @get_status()
%2 = tail call i32 @check_bit(i32 %1, i32 1)
ret i32 %2
}
int pvr_debugfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pvr_debugfs_init() {
ret i32 0
}