xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ darken_world_window();
int /*<<< orphan*/ set_keyboard_controller_status(int /*<<< orphan*/);
int /*<<< orphan*/ stop_fade();
void pause_game(void) {
  stop_fade();
  darken_world_window();
  set_keyboard_controller_status(0);
  return;
}


x86 assembly (clang, -O0):
<pause_game>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <stop_fade@plt>
mov    $0x0,%al
call   1030 <darken_world_window@plt>
xor    %edi,%edi
call   1050 <set_keyboard_controller_status@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause_game>:
push   %rax
xor    %eax,%eax
call   1040 <stop_fade@plt>
xor    %eax,%eax
call   1030 <darken_world_window@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <set_keyboard_controller_status@plt>

LLVM IR (-O0):
define void @pause_game() {
%1 = call i32 (...) @stop_fade()
%2 = call i32 (...) @darken_world_window()
%3 = call i32 @set_keyboard_controller_status(i32 0)
ret void
}

LLVM IR (-O2):
define void @pause_game() {
%1 = tail call i32 (...) @stop_fade()
%2 = tail call i32 (...) @darken_world_window()
%3 = tail call i32 @set_keyboard_controller_status(i32 0)
ret void
}
int equal_int(void *ip, void *jp) {
  int i = *((int *)ip);
  int j = *((int *)jp);
  if (i == j) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <equal_int+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <equal_int+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void result_best_str(char *result_str) {
  if (result_str == NULL) {
    printf("[failed]\n");
  } else {
    printf("               <<%s>>\n", result_str);
  }
}


x86 assembly (clang, -O0):
<result_best_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <result_best_str+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <result_best_str+0x3c>
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<result_best_str>:
test   %rdi,%rdi
je     1136 <result_best_str+0x16>
mov    %rdi,%rsi
lea    0xed1(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xeda(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"[failed]\0A\00"
@.str.1 = [23 x i8] c" <<%s>>\0A\00"
define void @result_best_str(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 %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c" <<%s>>\0A\00"
@str = [9 x i8] c"[failed]\00"
define void @result_best_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ gpio_clr_bits(int);
int /*<<< orphan*/ gpio_set_bits(int);
void gpio_write_masked_bits(uint32_t value, uint32_t mask) {
  gpio_clr_bits(~value & mask);
  gpio_set_bits(value & mask);
}


x86 assembly (clang, -O0):
<gpio_write_masked_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
and    -0x8(%rbp),%edi
call   1030 <gpio_clr_bits@plt>
mov    -0x4(%rbp),%edi
and    -0x8(%rbp),%edi
call   1040 <gpio_set_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_write_masked_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
not    %edi
and    %esi,%edi
call   1030 <gpio_clr_bits@plt>
and    %ebp,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gpio_set_bits@plt>

LLVM IR (-O0):
define void @gpio_write_masked_bits(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = call i32 @gpio_clr_bits(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
%13 = call i32 @gpio_set_bits(i32 %12)
ret void
}

LLVM IR (-O2):
define void @gpio_write_masked_bits(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
%5 = tail call i32 @gpio_clr_bits(i32 %4)
%6 = and i32 %1, %0
%7 = tail call i32 @gpio_set_bits(i32 %6)
ret void
}
unsigned long getlongb(unsigned char *p) {
  return p[3] + p[2] * 256 + (p[1] + p[0] * 256) * 65536;
}


x86 assembly (clang, -O0):
<getlongb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
shl    $0x8,%edx
add    %edx,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlongb>:
mov    (%rdi),%eax
bswap  %eax
cltq
ret

LLVM IR (-O0):
define i64 @getlongb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = mul nsw i32 %10, 256
%12 = add nsw i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = mul nsw i32 %20, 256
%22 = add nsw i32 %16, %21
%23 = mul nsw i32 %22, 65536
%24 = add nsw i32 %12, %23
%25 = sext i32 %24 to i64
ret i64 %25
}

LLVM IR (-O2):
define i64 @getlongb(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = getelementptr inbounds i8, i8* %0, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %0
%13 = zext i8 %12 to i32
%14 = shl nuw i32 %13, 24
%15 = shl nuw nsw i32 %11, 16
%16 = or i32 %8, %4
%17 = or i32 %16, %15
%18 = or i32 %17, %14
%19 = sext i32 %18 to i64
ret i64 %19
}
int main(int argc, char **argv) {
  if (argc & 1) {
    return argc * argc;
  } else {
    return argc + 4;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <main+0x30>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <main+0x39>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%ecx
imul   %edi,%ecx
lea    0x4(%rdi),%eax
test   $0x1,%dil
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = mul nsw i32 %0, %0
%6 = add nsw i32 %0, 4
%7 = select i1 %4, i32 %6, i32 %5
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ minimum_k1(int *, int, int);
void main() {
  int arr[] = {10, 1, 103, 39, 129, 3, 94, 9, 222, 22, 2};
  int len = sizeof(arr) / sizeof(arr[0]);
  int k = 4;
  minimum_k1(arr, len, k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0xb,-0x34(%rbp)
movl   $0x4,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1030 <minimum_k1@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xb,%esi
mov    $0x4,%edx
call   1030 <minimum_k1@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [11 x i32] [i32 10, i32 1, i32 103, i32 39, i32 129, i32 3, i32 94, i32 9, i32 222, i32 22, i32 2]
define void @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [11 x i32]* %1 to i8*
store i32 11, i32* %2
store i32 4, i32* %3
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @minimum_k1(i32* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@__const.main.arr = [11 x i32] [i32 10, i32 1, i32 103, i32 39, i32 129, i32 3, i32 94, i32 9, i32 222, i32 22, i32 2]
define void @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @minimum_k1(i32* %3, i32 11, i32 4)
ret void
}
/* Variables and functions */
int execve(char *, char *const *, char *const *);
int /*<<< orphan*/ snprintf(char *, int, char const *, int);
int fexecve(int fd, char *const argv[], char *const envp[]) {
  static const char proc[] = "/proc/self/fd/%d";
  char buf[sizeof proc + 3 * sizeof(int)];
  snprintf(buf, sizeof buf, proc, fd);
  return execve(buf, argv, envp);
}


x86 assembly (clang, -O0):
<fexecve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x1d,%esi
lea    0xeba(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <execve@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexecve>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1d,%esi
call   1030 <snprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <execve@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@fexecve.proc = internal constant [17 x i8] c"/proc/self/fd/%d\00"
define i32 @fexecve(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca [29 x i8]
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @snprintf(i8* %8, i32 29, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @fexecve.proc, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [29 x i8], [29 x i8]* %7, i64 0, i64 0
%12 = load i8**, i8*** %5
%13 = load i8**, i8*** %6
%14 = call i32 @execve(i8* %11, i8** %12, i8** %13)
ret i32 %14
}

LLVM IR (-O2):
@fexecve.proc = internal constant [17 x i8] c"/proc/self/fd/%d\00"
define i32 @fexecve(i32 %0, i8** %1, i8** %2) {
%4 = alloca [29 x i8]
%5 = getelementptr inbounds [29 x i8], [29 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 29, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @fexecve.proc, i64 0, i64 0), i32 %0)
%7 = call i32 @execve(i8* %5, i8** %1, i8** %2)
ret i32 %7
}
int break_loop_with_t(int p, int t) {
  for (int i = 0; i < p; i++) {
    if (t < 0) {
      t++;
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<break_loop_with_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <break_loop_with_t+0x48>
cmpl   $0x0,-0x8(%rbp)
jge    1135 <break_loop_with_t+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <break_loop_with_t+0x48>
jmp    113a <break_loop_with_t+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <break_loop_with_t+0x11>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @break_loop_with_t(i32 %0, i32 %1) {
ret i32 0
}
unsigned char readPort1(unsigned short int port) {
  unsigned char v;
  __asm__ __volatile__("inb %w1,%0" : "=a"(v) : "Nd"(port));
  return v;
}


x86 assembly (clang, -O0):
<readPort1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readPort1>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @readPort1(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @readPort1(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
unsigned long xor128() {
  ;
  static unsigned long x = 123456789, y = 362436069, z = 521288629,
                       w = 88675123;
  unsigned long t;
  t = (x ^ (x << 11));
  x = y;
  y = z;
  z = w;
  return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
  ;
}


x86 assembly (clang, -O0):
<xor128>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
mov    0x2f0e(%rip),%rcx
shl    $0xb,%rcx
xor    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    0x2f04(%rip),%rax
mov    %rax,0x2ef5(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,0x2eef(%rip)
mov    0x2ef8(%rip),%rax
mov    %rax,0x2ee9(%rip)
mov    0x2eea(%rip),%rax
mov    0x2ee3(%rip),%rcx
shr    $0x13,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%rdx
shr    $0x8,%rdx
xor    %rdx,%rcx
xor    %rcx,%rax
mov    %rax,0x2ec3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor128>:
mov    0x2f19(%rip),%rcx
mov    %rcx,%rax
shl    $0xb,%rax
xor    %rcx,%rax
mov    0x2f10(%rip),%rcx
mov    %rcx,0x2f01(%rip)
mov    0x2f0a(%rip),%rcx
mov    %rcx,0x2efb(%rip)
mov    0x2f04(%rip),%rcx
mov    %rcx,0x2ef5(%rip)
mov    %rax,%rdx
shr    $0x8,%rdx
xor    %rcx,%rax
shr    $0x13,%rcx
xor    %rdx,%rax
xor    %rcx,%rax
mov    %rax,0x2ee2(%rip)
ret

LLVM IR (-O0):
@xor128.x = internal global i64 123456789
@xor128.y = internal global i64 362436069
@xor128.z = internal global i64 521288629
@xor128.w = internal global i64 88675123
define i64 @xor128() {
%1 = alloca i64
%2 = load i64, i64* @xor128.x
%3 = load i64, i64* @xor128.x
%4 = shl i64 %3, 11
%5 = xor i64 %2, %4
store i64 %5, i64* %1
%6 = load i64, i64* @xor128.y
store i64 %6, i64* @xor128.x
%7 = load i64, i64* @xor128.z
store i64 %7, i64* @xor128.y
%8 = load i64, i64* @xor128.w
store i64 %8, i64* @xor128.z
%9 = load i64, i64* @xor128.w
%10 = load i64, i64* @xor128.w
%11 = lshr i64 %10, 19
%12 = xor i64 %9, %11
%13 = load i64, i64* %1
%14 = load i64, i64* %1
%15 = lshr i64 %14, 8
%16 = xor i64 %13, %15
%17 = xor i64 %12, %16
store i64 %17, i64* @xor128.w
ret i64 %17
}

LLVM IR (-O2):
@xor128.x = internal unnamed_addr global i64 123456789
@xor128.y = internal unnamed_addr global i64 362436069
@xor128.z = internal unnamed_addr global i64 521288629
@xor128.w = internal unnamed_addr global i64 88675123
define i64 @xor128() {
%1 = load i64, i64* @xor128.x
%2 = shl i64 %1, 11
%3 = xor i64 %2, %1
%4 = load i64, i64* @xor128.y
store i64 %4, i64* @xor128.x
%5 = load i64, i64* @xor128.z
store i64 %5, i64* @xor128.y
%6 = load i64, i64* @xor128.w
store i64 %6, i64* @xor128.z
%7 = lshr i64 %6, 19
%8 = lshr i64 %3, 8
%9 = xor i64 %8, %3
%10 = xor i64 %9, %6
%11 = xor i64 %10, %7
store i64 %11, i64* @xor128.w
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ byte_swap(long *);
void fix_table(long *table) {
  long len = table[0];
  if ((len & 0xffff) == 0 && (len & 0xffff0000) != 0) {
    do {
      byte_swap(table);
      table++;
    } while (*table);
  }
}


x86 assembly (clang, -O0):
<fix_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
cmp    $0x0,%rax
jne    1180 <fix_table+0x70>
movabs $0xffff0000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1180 <fix_table+0x70>
jmp    1158 <fix_table+0x48>
mov    -0x8(%rbp),%rdi
call   1030 <byte_swap@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1158 <fix_table+0x48>
jmp    1180 <fix_table+0x70>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_table>:
push   %rbx
mov    (%rdi),%rax
test   %ax,%ax
jne    1143 <fix_table+0x33>
and    $0xffff0000,%eax
test   %rax,%rax
je     1143 <fix_table+0x33>
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <byte_swap@plt>
cmpq   $0x0,0x8(%rbx)
lea    0x8(%rbx),%rbx
jne    1130 <fix_table+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @fix_table(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 65535
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %1
%11 = load i64, i64* %3
%12 = and i64 %11, 4294901760
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %10
br label %15
15: ; preds = %20, %14
%16 = load i64*, i64** %2
%17 = call i32 @byte_swap(i64* %16)
%18 = load i64*, i64** %2
%19 = getelementptr inbounds i64, i64* %18, i32 1
store i64* %19, i64** %2
br label %20
20: ; preds = %15
%21 = load i64*, i64** %2
%22 = load i64, i64* %21
%23 = icmp ne i64 %22, 0
br i1 %23, label %15, label %24
24: ; preds = %20
br label %25
25: ; preds = %24, %10, %1
ret void
}

LLVM IR (-O2):
define void @fix_table(i64* %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 65535
%4 = icmp ne i64 %3, 0
%5 = and i64 %2, 4294901760
%6 = icmp eq i64 %5, 0
%7 = or i1 %4, %6
br i1 %7, label %14, label %8
8: ; preds = %1, %8
%9 = phi i64* [ %11, %8 ], [ %0, %1 ]
%10 = tail call i32 @byte_swap(i64* %9)
%11 = getelementptr inbounds i64, i64* %9, i64 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %1
ret void
}
double feetToMetres(double feet) { return feet / 3.2808; }


x86 assembly (clang, -O0):
<feetToMetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<feetToMetres>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @feetToMetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.280800e+00
ret double %4
}

LLVM IR (-O2):
define double @feetToMetres(double %0) {
%2 = fdiv double %0, 3.280800e+00
ret double %2
}
/* Type definitions */
typedef int u_int8_t;
typedef int u_int16_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, int *, int);
ssize_t be_write16(int fd, u_int16_t word) {
  u_int8_t buf[2];
  buf[1] = word & 0xff;
  buf[0] = (word & 0xff00) >> 8;
  return write(fd, buf, 2);
}


x86 assembly (clang, -O0):
<be_write16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_write16>:
push   %rax
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,0x4(%rsp)
movzbl %ah,%eax
mov    %eax,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @be_write16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %7, i32* %8
%9 = load i32, i32* %4
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %3
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%15 = call i32 @write(i32 %13, i32* %14, i32 2)
ret i32 %15
}

LLVM IR (-O2):
define i32 @be_write16(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = and i32 %1, 255
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %8, i32* %9
%10 = call i32 @write(i32 %0, i32* %9, i32 2)
ret i32 %10
}
int init_net() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_net() {
ret i32 0
}
int HelpItem119(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem119() {
ret i32 0
}
char *iupStrReturnBoolean(int b) {
  if (b)
    return "YES";
  else
    return "NO";
}


x86 assembly (clang, -O0):
<iupStrReturnBoolean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <iupStrReturnBoolean+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <iupStrReturnBoolean+0x2c>
lea    0xedc(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrReturnBoolean>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"YES\00"
@.str.1 = [3 x i8] c"NO\00"
define i8* @iupStrReturnBoolean(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
scalar_t__ wsimple_strtoul(int const *, int **, unsigned int, size_t);
long wsimple_strtol(const wchar_t *cp, wchar_t **endp, unsigned int base,
                    size_t field_width) {
  if (*cp == L'-')
    return -(long)wsimple_strtoul(cp + 1, endp, base, field_width);
  return (long)wsimple_strtoul(cp, endp, base, field_width);
}


x86 assembly (clang, -O0):
<wsimple_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x2d,(%rax)
jne    115d <wsimple_strtol+0x4d>
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <wsimple_strtoul@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <wsimple_strtol+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1030 <wsimple_strtoul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsimple_strtol>:
push   %rax
cmpl   $0x2d,(%rdi)
jne    1124 <wsimple_strtol+0x14>
add    $0x4,%rdi
call   1030 <wsimple_strtoul@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <wsimple_strtoul@plt>

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

LLVM IR (-O2):
define i64 @wsimple_strtol(i32* %0, i32** %1, i32 %2, i64 %3) {
%5 = load i32, i32* %0
%6 = icmp eq i32 %5, 45
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = tail call i64 @wsimple_strtoul(i32* %8, i32** %1, i32 %2, i64 %3)
%10 = sub nsw i64 0, %9
br label %13
11: ; preds = %4
%12 = tail call i64 @wsimple_strtoul(i32* %0, i32** %1, i32 %2, i64 %3)
br label %13
13: ; preds = %11, %7
%14 = phi i64 [ %10, %7 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_field_id(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gf", "f_id");
}


x86 assembly (clang, -O0):
<ssds_get_field_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_field_id>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"gf\00"
@.str.1 = [5 x i8] c"f_id\00"
define i32 @ssds_get_field_id(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ nothing();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("If you do not get back to your research now, we will have to "
         "implement corrective solutions.\n");
  nothing();
  _exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <nothing@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <nothing@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"If you do not get back to your research now, we will have to implement corrective solutions.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @nothing()
%4 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [93 x i8] c"If you do not get back to your research now, we will have to implement corrective solutions.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @nothing()
%3 = tail call i32 @_exit(i32 1)
unreachable
}
int f_d() {
  int ret, z;
  for (int i = 0; i < z; ++i)
    ret -= i * i;
  return ret;
}


x86 assembly (clang, -O0):
<f_d>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1134 <f_d+0x34>
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <f_d+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f_d() {
ret i32 undef
}
/* Variables and functions */
float __nv_sinf(float);
float sinf(float __a) { return __nv_sinf(__a); }


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
jmp    1030 <__nv_sinf@plt>

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float @__nv_sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ pi();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  printf("The Pi is %Lf.\n", pi());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"The Pi is %Lf.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @pi()
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"The Pi is %Lf.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @pi()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int isShortWord(char *term) {
  if (strlen(term) < 2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isShortWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jge    113a <isShortWord+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <isShortWord+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isShortWord>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isShortWord(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isShortWord(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct mtp2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mtp2_setstate(struct mtp2 *, int /*<<< orphan*/);
void t2_expiry(void *data) {
  struct mtp2 *link = data;
  mtp2_setstate(link, 0);
  return;
}


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

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

LLVM IR (-O0):
%struct.mtp2 = type { i32 }
define void @t2_expiry(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.mtp2*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.mtp2*
store %struct.mtp2* %5, %struct.mtp2** %3
%6 = load %struct.mtp2*, %struct.mtp2** %3
%7 = call i32 @mtp2_setstate(%struct.mtp2* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.mtp2 = type { i32 }
define void @t2_expiry(i8* %0) {
%2 = bitcast i8* %0 to %struct.mtp2*
%3 = tail call i32 @mtp2_setstate(%struct.mtp2* %2, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ip_set_cksum(uint8_t *p_ip, uint16_t cksum) {
  p_ip[10] = (cksum & 0xff00) >> 8;
  p_ip[11] = (cksum & 0xff);
}


x86 assembly (clang, -O0):
<ip_set_cksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_set_cksum>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x28(%rdi)
movzbl %al,%eax
mov    %eax,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @ip_set_cksum(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 = and i32 %5, 65280
%7 = ashr i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 10
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 11
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @ip_set_cksum(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 10
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 11
store i32 %6, i32* %7
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double Wtime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return ((double)t.tv_sec + (double)(t.tv_usec) / 1000000);
}


x86 assembly (clang, -O0):
<Wtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @Wtime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @Wtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
void ScalePlaneBilinearDown() {}


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

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

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

LLVM IR (-O2):
define void @ScalePlaneBilinearDown() {
ret void
}
/* Type definitions */
struct rng_state {
  int dummy;
};
typedef double int32_t;

/* Variables and functions */
double rng_under(struct rng_state *, double);
double rng_between(struct rng_state *st, int32_t min, int32_t max) {
  return rng_under(st, max - min) + min;
}


x86 assembly (clang, -O0):
<rng_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <rng_under@plt>
addsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_between>:
push   %rax
movsd  %xmm0,(%rsp)
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <rng_under@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.rng_state = type { i32 }
define double @rng_between(%struct.rng_state* %0, double %1, double %2) {
%4 = alloca %struct.rng_state*
%5 = alloca double
%6 = alloca double
store %struct.rng_state* %0, %struct.rng_state** %4
store double %1, double* %5
store double %2, double* %6
%7 = load %struct.rng_state*, %struct.rng_state** %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = call double @rng_under(%struct.rng_state* %7, double %10)
%12 = load double, double* %5
%13 = fadd double %11, %12
ret double %13
}

LLVM IR (-O2):
%struct.rng_state = type { i32 }
define double @rng_between(%struct.rng_state* %0, double %1, double %2) {
%4 = fsub double %2, %1
%5 = tail call double @rng_under(%struct.rng_state* %0, double %4)
%6 = fadd double %5, %1
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void seg_fault() { exit(1); }


x86 assembly (clang, -O0):
<seg_fault>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<seg_fault>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @seg_fault() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @seg_fault() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *blkalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *blkcalloc(size_t number, size_t size) {
  void *ret = blkalloc(size * number);
  memset(ret, 0, size * number);
  return ret;
}


x86 assembly (clang, -O0):
<blkcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x8(%rbp),%rdi
call   1030 <blkalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1030 <blkalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @blkcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
%9 = call i8* @blkalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = mul i64 %11, %12
%14 = call i32 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @blkcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @blkalloc(i64 %3)
%5 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
void eapol_sm_notify_pmkid_attempt(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_notify_pmkid_attempt(%struct.eapol_sm* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
typedef TYPE_1__ XEvent;

/* Variables and functions */
scalar_t__ DestroyNotify;
int is_destroy_notify(XEvent *ev) { return (ev->type == DestroyNotify); }


x86 assembly (clang, -O0):
<is_destroy_notify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_destroy_notify>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@DestroyNotify = global i64 0
define i32 @is_destroy_notify(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @DestroyNotify
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@DestroyNotify = global i64 0
define i32 @is_destroy_notify(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DestroyNotify
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clearDisplay();
int /*<<< orphan*/ displayOff();
void clearOTP(void) {
  clearDisplay();
  displayOff();
}


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

x86 assembly (clang, -O2):
<clearOTP>:
push   %rax
xor    %eax,%eax
call   1040 <clearDisplay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <displayOff@plt>

LLVM IR (-O0):
define void @clearOTP() {
%1 = call i32 (...) @clearDisplay()
%2 = call i32 (...) @displayOff()
ret void
}

LLVM IR (-O2):
define void @clearOTP() {
%1 = tail call i32 (...) @clearDisplay()
%2 = tail call i32 (...) @displayOff()
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
int is_anybody_logged_in(char *user) {
  char *guest = "Gość";
  int test = strncmp(user, guest, 256);
  if (test != 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_anybody_logged_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x100,%edx
call   1030 <strncmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1152 <is_anybody_logged_in+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1159 <is_anybody_logged_in+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_anybody_logged_in>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Go\C5\9B\C4\87\00"
define i32 @is_anybody_logged_in(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strncmp(i8* %6, i8* %7, i32 256)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"Go\C5\9B\C4\87\00"
define i32 @is_anybody_logged_in(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 256)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}