xunge/DecIR huggingface dataset:
/* Variables and functions */
int getRowCount(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int tableExists(char *tableName) {
  char sql[100];
  sprintf(sql,
          "SELECT name FROM sqlite_master WHERE type='table' AND name='%s'",
          tableName);
  return getRowCount(sql);
}


x86 assembly (clang, -O0):
<tableExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <getRowCount@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableExists>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <getRowCount@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"SELECT name FROM sqlite_master WHERE type='table' AND name='%s'\00"
define i32 @tableExists(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = call i32 @getRowCount(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [64 x i8] c"SELECT name FROM sqlite_master WHERE type='table' AND name='%s'\00"
define i32 @tableExists(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @getRowCount(i8* %3)
ret i32 %5
}
/* Variables and functions */
int SIGSEGV;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void handler(int sig) {
  fprintf(stderr, "ERROR: %i caught\n", sig);
  if (sig == SIGSEGV) {
    exit(2);
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
jne    115f <handler+0x3f>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    0x2ea7(%rip),%rax
cmp    %ebx,(%rax)
je     1147 <handler+0x27>
pop    %rbx
ret
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"ERROR: %i caught\0A\00"
@SIGSEGV = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = load i32, i32* @SIGSEGV
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @exit(i32 2)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"ERROR: %i caught\0A\00"
@SIGSEGV = global i32 0
define void @handler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @SIGSEGV
%5 = icmp eq i32 %4, %0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void ft_putendl_fd(char const *s, int fd) {
  write(fd, s, ft_strlen(s));
  ft_putchar_fd('\n', fd);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1050 <ft_putchar_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0xa,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ft_putchar_fd@plt>

LLVM IR (-O0):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @ft_putchar_fd(i8 signext 10, i32 %10)
ret void
}

LLVM IR (-O2):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
%5 = tail call i32 @ft_putchar_fd(i8 signext 10, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_app1();
int /*<<< orphan*/ do_popd();
void do_app11(void) {
  do_app1();
  do_popd();
}


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

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

LLVM IR (-O0):
define void @do_app11() {
%1 = call i32 (...) @do_app1()
%2 = call i32 (...) @do_popd()
ret void
}

LLVM IR (-O2):
define void @do_app11() {
%1 = tail call i32 (...) @do_app1()
%2 = tail call i32 (...) @do_popd()
ret void
}
/* Variables and functions */
int fwrite(void const *, size_t, int, void *);
int write_fp(const void *data, size_t len, void *fp) {
  return fwrite(data, len, 1, fp);
}


x86 assembly (clang, -O0):
<write_fp>:
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),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_fp>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i32 @write_fp(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i64 %1, i32 1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ outDatainjectionMode;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, int const *, int);
uint16_t
inv_fifo_protocol_helper_encode_datainjection(uint32_t datainjectionmode,
                                              uint8_t *out) {
  const uint16_t outDatainjectionMode = (uint16_t)datainjectionmode;
  FifoProtocol_memcpy((out), (&outDatainjectionMode),
                      (sizeof(outDatainjectionMode)));
  return 2;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_encode_datainjection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_encode_datainjection>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @inv_fifo_protocol_helper_encode_datainjection(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %0, i32* %3
%5 = call i32 @FifoProtocol_memcpy(i32* %1, i32* %3, i32 4)
ret i32 2
}
void on_mouse_move_msg(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @on_mouse_move_msg(i32 %0, i32 %1) {
ret void
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: fsmagic.c 10 2006-07-10 18:22:27Z hyin $");
}


x86 assembly (clang, -O0):
<rcsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <rcsid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [50 x i8] c"@(#)$Id: fsmagic.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int check_mdm_sound_param(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_mdm_sound_param() {
ret i32 0
}
int base2int(char b) {
  switch (b) {
  case 'A':
    return (0);
  case 'C':
    return (1);
  case 'G':
    return (2);
  case 'T':
    return (3);
  default:
    return (4);
  }
}


x86 assembly (clang, -O0):
<base2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x13,%eax
ja     1164 <base2int+0x64>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    116b <base2int+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    116b <base2int+0x6b>
movl   $0x2,-0x4(%rbp)
jmp    116b <base2int+0x6b>
movl   $0x3,-0x4(%rbp)
jmp    116b <base2int+0x6b>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base2int>:
add    $0xffffffbf,%edi
cmp    $0x13,%edi
ja     1120 <base2int+0x20>
xor    %eax,%eax
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1,%eax
ret
mov    $0x4,%eax
ret
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @base2int(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 84, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %11
7: ; preds = %1
store i32 1, i32* %2
br label %11
8: ; preds = %1
store i32 2, i32* %2
br label %11
9: ; preds = %1
store i32 3, i32* %2
br label %11
10: ; preds = %1
store i32 4, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @base2int(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %6 [
i32 65, label %7
i32 67, label %3
i32 71, label %4
i32 84, label %5
]
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4, %3
%8 = phi i32 [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct ir_remote {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ is_raw(struct ir_remote const *);
void fprint_remote_signal_foot(FILE *f, const struct ir_remote *rem) {
  if (!is_raw(rem))
    fprintf(f, "      end codes\n\n");
  else
    fprintf(f, "      end raw_codes\n\n");
}


x86 assembly (clang, -O0):
<fprint_remote_signal_foot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <is_raw@plt>
cmp    $0x0,%eax
jne    1157 <fprint_remote_signal_foot+0x37>
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1167 <fprint_remote_signal_foot+0x47>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_remote_signal_foot>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <is_raw@plt>
test   %eax,%eax
je     113e <fprint_remote_signal_foot+0x1e>
lea    0xedb(%rip),%rdi
mov    $0x15,%esi
jmp    114a <fprint_remote_signal_foot+0x2a>
lea    0xebb(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
@.str = [18 x i8] c" end codes\0A\0A\00"
@.str.1 = [22 x i8] c" end raw_codes\0A\0A\00"
define void @fprint_remote_signal_foot(i32* %0, %struct.ir_remote* %1) {
%3 = alloca i32*
%4 = alloca %struct.ir_remote*
store i32* %0, i32** %3
store %struct.ir_remote* %1, %struct.ir_remote** %4
%5 = load %struct.ir_remote*, %struct.ir_remote** %4
%6 = call i32 @is_raw(%struct.ir_remote* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
@.str = [18 x i8] c" end codes\0A\0A\00"
@.str.1 = [22 x i8] c" end raw_codes\0A\0A\00"
define void @fprint_remote_signal_foot(i32* nocapture %0, %struct.ir_remote* %1) {
%3 = tail call i32 @is_raw(%struct.ir_remote* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
br label %9
7: ; preds = %2
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 21, i64 1, i32* %0)
br label %9
9: ; preds = %7, %5
ret void
}
double calcVarianceFromSums(double sum, double sumSquares,
                            unsigned long long n) {
  double var = sumSquares - sum * sum / n;
  if (n > 1)
    var /= n - 1;
  return var;
}


x86 assembly (clang, -O0):
<calcVarianceFromSums>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm1
movaps 0xed9(%rip),%xmm3
movq   -0x18(%rbp),%xmm2
punpckldq %xmm3,%xmm2
movapd 0xed8(%rip),%xmm3
subpd  %xmm3,%xmm2
movaps %xmm2,%xmm3
unpckhpd %xmm2,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpq   $0x1,-0x18(%rbp)
jbe    119c <calcVarianceFromSums+0x9c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
movq   %rax,%xmm1
movaps 0xe8d(%rip),%xmm0
punpckldq %xmm0,%xmm1
movapd 0xe91(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcVarianceFromSums>:
movq   %rdi,%xmm2
punpckldq 0xef3(%rip),%xmm2
mulsd  %xmm0,%xmm0
subpd  0xef7(%rip),%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm0
subsd  %xmm0,%xmm1
cmp    $0x2,%rdi
jb     115c <calcVarianceFromSums+0x5c>
add    $0xffffffffffffffff,%rdi
movq   %rdi,%xmm0
punpckldq 0xebc(%rip),%xmm0
subpd  0xec4(%rip),%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
addsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcVarianceFromSums(double %0, double %1, i64 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i64
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store i64 %2, i64* %6
%8 = load double, double* %5
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = load i64, i64* %6
%13 = uitofp i64 %12 to double
%14 = fdiv double %11, %13
%15 = fsub double %8, %14
store double %15, double* %7
%16 = load i64, i64* %6
%17 = icmp ugt i64 %16, 1
br i1 %17, label %18, label %24
18: ; preds = %3
%19 = load i64, i64* %6
%20 = sub i64 %19, 1
%21 = uitofp i64 %20 to double
%22 = load double, double* %7
%23 = fdiv double %22, %21
store double %23, double* %7
br label %24
24: ; preds = %18, %3
%25 = load double, double* %7
ret double %25
}

LLVM IR (-O2):
define double @calcVarianceFromSums(double %0, double %1, i64 %2) {
%4 = fmul double %0, %0
%5 = uitofp i64 %2 to double
%6 = fdiv double %4, %5
%7 = fsub double %1, %6
%8 = icmp ugt i64 %2, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = add i64 %2, -1
%11 = uitofp i64 %10 to double
%12 = fdiv double %7, %11
br label %13
13: ; preds = %9, %3
%14 = phi double [ %12, %9 ], [ %7, %3 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ stderr;
int free_ivector(int *v) {
  if (!v) {
    fprintf(stderr, "free_ivector: pointer v empty\n");
    return 1;
  }
  free(v);
  return 0;
}


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <free_ivector+0x38>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <free_ivector+0x48>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
push   %rax
test   %rdi,%rdi
je     112f <free_ivector+0xf>
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"free_ivector: pointer v empty\0A\00"
define i32 @free_ivector(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @free(i32* %10)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"free_ivector: pointer v empty\0A\00"
define i32 @free_ivector(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @free(i32* %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int gintand(int x, int y) {
  x &= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gintand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <gintand+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gintand>:
push   %rbx
mov    %edi,%ebx
and    %esi,%ebx
jne    111e <gintand+0xe>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gintand(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 = and i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @foo(i8* null)
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @gintand(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long const, long const);
void assert_long_not_equals(const long val1, const long val2) {
  if (val1 != val2)
    printf("\033[00;32mOK: Asserting that %ld is different than %ld\033[00m\n",
           val1, val2);
  else
    printf("\033[31mKO: Asserting that %ld is different than %ld\033[00m\n",
           val1, val2);
}


x86 assembly (clang, -O0):
<assert_long_not_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1147 <assert_long_not_equals+0x37>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <assert_long_not_equals+0x4b>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_long_not_equals>:
mov    %rsi,%rdx
mov    %rdi,%rsi
cmp    %rdx,%rdi
jne    112a <assert_long_not_equals+0x1a>
lea    0xf19(%rip),%rdi
mov    %rsi,%rdx
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"\1B[00;32mOK: Asserting that %ld is different than %ld\1B[00m\0A\00"
@.str.1 = [56 x i8] c"\1B[31mKO: Asserting that %ld is different than %ld\1B[00m\0A\00"
define void @assert_long_not_equals(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10)
br label %16
12: ; preds = %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i64 %13, i64 %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"\1B[00;32mOK: Asserting that %ld is different than %ld\1B[00m\0A\00"
@.str.1 = [56 x i8] c"\1B[31mKO: Asserting that %ld is different than %ld\1B[00m\0A\00"
define void @assert_long_not_equals(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i64 %0, i64 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f2(unsigned long x) {
  unsigned long r = x - 2U;
  if (r <= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     113d <f2+0x2d>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1121 <f2+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
add    $0xfffffffffffffffe,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @foo(i32 0)
br label %5
5: ; preds = %3, %1
%6 = add i64 %0, -2
ret i64 %6
}
/* Variables and functions */
unsigned long get_error_values(int, char const **, int *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
unsigned long ERR_get_error_line(const char **file, int *line) {
  return (get_error_values(1, file, line, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_get_error_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   1030 <get_error_values@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_get_error_line>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_get_error_line(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
store i8** %0, i8*** %3
store i32* %1, i32** %4
%5 = load i8**, i8*** %3
%6 = load i32*, i32** %4
%7 = call i64 @get_error_values(i32 1, i8** %5, i32* %6, i32* null, i32* null)
ret i64 %7
}

LLVM IR (-O2):
define i64 @ERR_get_error_line(i8** %0, i32* %1) {
%3 = tail call i64 @get_error_values(i32 1, i8** %0, i32* %1, i32* null, i32* null)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ sleep(int);
void fail(const char *str) {
  perror(str);
  sleep(2);
  _exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @sleep(i32 2)
%6 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @fail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int nthreads) {
  fprintf(stderr,
          "Usage: %s [-n <n>] <N>\n"
          " -n        number of threads in pool, default %d\n",
          av0, nthreads);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-n <n>] <N>\0A -n number of threads in pool, default %d\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [73 x i8] c"Usage: %s [-n <n>] <N>\0A -n number of threads in pool, default %d\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double glmComputeVectorLength3d(double *);
int /*<<< orphan*/ glmMakeVector3d(double *, double const *, double const *);
double glmComputeDistance3d(const double p1[3], const double p2[3]) {
  double d[3];
  glmMakeVector3d(d, p1, p2);
  return glmComputeVectorLength3d(d);
}


x86 assembly (clang, -O0):
<glmComputeDistance3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <glmMakeVector3d@plt>
lea    -0x30(%rbp),%rdi
call   1030 <glmComputeVectorLength3d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeDistance3d>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <glmMakeVector3d@plt>
mov    %rbx,%rdi
call   1030 <glmComputeVectorLength3d@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @glmComputeDistance3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 @glmMakeVector3d(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%11 = call double @glmComputeVectorLength3d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @glmComputeDistance3d(double* %0, double* %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector3d(double* %5, double* %0, double* %1)
%7 = call double @glmComputeVectorLength3d(double* %5)
ret double %7
}
/* Variables and functions */
scalar_t__ malloc(int);
unsigned long *seeds_create() {
  unsigned long *seeds;
  seeds = (unsigned long *)malloc(64);
  return seeds;
}


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

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

LLVM IR (-O0):
define i64* @seeds_create() {
%1 = alloca i64*
%2 = call i64 @malloc(i32 64)
%3 = inttoptr i64 %2 to i64*
store i64* %3, i64** %1
%4 = load i64*, i64** %1
ret i64* %4
}

LLVM IR (-O2):
define i64* @seeds_create() {
%1 = tail call i64 @malloc(i32 64)
%2 = inttoptr i64 %1 to i64*
ret i64* %2
}
void foo_1_1_1_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_1_2_1() {
ret void
}
/* Variables and functions */
int mintaka_index_allocate3(char const *, int, char const *,
                            int /*<<< orphan*/ *, int);
int mintaka_index_allocate2(const char *string, int number, const char *string2,
                            int event) {
  return mintaka_index_allocate3(string, number, string2, NULL, event);
}


x86 assembly (clang, -O0):
<mintaka_index_allocate2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mintaka_index_allocate3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mintaka_index_allocate2>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <mintaka_index_allocate3@plt>

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

LLVM IR (-O2):
define i32 @mintaka_index_allocate2(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @mintaka_index_allocate3(i8* %0, i32 %1, i8* %2, i32* null, i32 %3)
ret i32 %5
}
/* Type definitions */
struct _stat {
  int dummy;
};

/* Variables and functions */
int dll_stat(char const *, struct _stat *);
int __wrap_stat(const char *path, struct _stat *buffer) {
  return dll_stat(path, buffer);
}


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

x86 assembly (clang, -O2):
<__wrap_stat>:
jmp    1030 <dll_stat@plt>

LLVM IR (-O0):
%struct._stat = type { i32 }
define i32 @__wrap_stat(i8* %0, %struct._stat* %1) {
%3 = alloca i8*
%4 = alloca %struct._stat*
store i8* %0, i8** %3
store %struct._stat* %1, %struct._stat** %4
%5 = load i8*, i8** %3
%6 = load %struct._stat*, %struct._stat** %4
%7 = call i32 @dll_stat(i8* %5, %struct._stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct._stat = type { i32 }
define i32 @__wrap_stat(i8* %0, %struct._stat* %1) {
%3 = tail call i32 @dll_stat(i8* %0, %struct._stat* %1)
ret i32 %3
}
/* Variables and functions */
double RAND_MAX;
double rand();
double random_uniforme() { return (rand() / (RAND_MAX * 1.0)); }


x86 assembly (clang, -O0):
<random_uniforme>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movsd  0xedd(%rip),%xmm1
mov    0x2ebe(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uniforme>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_uniforme() {
%1 = call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fmul double %2, 1.000000e+00
%4 = fdiv double %1, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_uniforme() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fdiv double %1, %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/, char *);
void main() {
  int x = 0;
  int n;
  while (x < n) {
    x++;
  }
  if (n > 0)
    if (!(x <= n))
      goto ERROR;
ERROR:
  assert(0, "ERROR");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1139 <main+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
cmpl   $0x0,-0x8(%rbp)
jle    1159 <main+0x49>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1154 <main+0x44>
jmp    115e <main+0x4e>
jmp    1159 <main+0x49>
jmp    115e <main+0x4e>
xor    %edi,%edi
lea    0xe99(%rip),%rsi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @main() {
%1 = tail call i32 @assert(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int api3(int, int, int, int);
int execve(const char *fname, char *const argv[], char *const envp[]) {
  return api3(11, (int)fname, (int)argv, (int)envp);
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    $0xb,%edi
call   1030 <api3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xb,%edi
jmp    1030 <api3@plt>

LLVM IR (-O0):
define i32 @execve(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 = ptrtoint i8* %7 to i32
%9 = load i8**, i8*** %5
%10 = ptrtoint i8** %9 to i32
%11 = load i8**, i8*** %6
%12 = ptrtoint i8** %11 to i32
%13 = call i32 @api3(i32 11, i32 %8, i32 %10, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = ptrtoint i8** %1 to i64
%7 = trunc i64 %6 to i32
%8 = ptrtoint i8** %2 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @api3(i32 11, i32 %5, i32 %7, i32 %9)
ret i32 %10
}
/* Variables and functions */
double cos(double);
double t3(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<t3>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @t3(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
int is_r8(int id) {
  switch (id) {
  case 129:
  case 132:
  case 136:
  case 145:
  case 128:
  case 131:
  case 135:
  case 143:
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<is_r8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     1170 <is_r8+0x70>
jmp    111e <is_r8+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffff7d,%eax
sub    $0x2,%eax
jb     1170 <is_r8+0x70>
jmp    1134 <is_r8+0x34>
mov    -0xc(%rbp),%eax
add    $0xffffff79,%eax
sub    $0x2,%eax
jb     1170 <is_r8+0x70>
jmp    114a <is_r8+0x4a>
mov    -0xc(%rbp),%eax
sub    $0x8f,%eax
je     1170 <is_r8+0x70>
jmp    115d <is_r8+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x91,%eax
jne    117c <is_r8+0x7c>
jmp    1170 <is_r8+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_r8+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_r8>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x11,%edi
ja     1117 <is_r8+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_r8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 129, label %5
i32 132, label %5
i32 136, label %5
i32 145, label %5
i32 128, label %5
i32 131, label %5
i32 135, label %5
i32 143, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.is_r8 = [18 x i32] [i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1]
define i32 @is_r8(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 18
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [18 x i32], [18 x i32]* @switch.table.is_r8, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int foo() {
L1:
  foo();
#pragma omp atomic
  {
    foo();
    goto L1;
  }
  goto L2;
#pragma omp atomic
  {
    foo();
  L2:
    foo();
  }
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <foo+0x9>
call   1030 <foo@plt>
call   1030 <foo@plt>
jmp    1119 <foo+0x9>

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <foo@plt>

LLVM IR (-O0):
define i32 @foo() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @foo()
%3 = call i32 @foo()
br label %1
4: ; No predecessors!
%5 = call i32 @foo()
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @foo()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sha1_key_internal(void *, unsigned char *, int);
void sha1_key_buggy(void *handle, unsigned char *key) {
  sha1_key_internal(handle, key, 16);
}


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

x86 assembly (clang, -O2):
<sha1_key_buggy>:
mov    $0x10,%edx
jmp    1030 <sha1_key_internal@plt>

LLVM IR (-O0):
define void @sha1_key_buggy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sha1_key_internal(i8* %5, i8* %6, i32 16)
ret void
}

LLVM IR (-O2):
define void @sha1_key_buggy(i8* %0, i8* %1) {
%3 = tail call i32 @sha1_key_internal(i8* %0, i8* %1, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char a[4];
  fgets(a, 4, stdin);
  printf("a = %s\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <fgets@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [8 x i8] c"a = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 4, i32 %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [8 x i8] c"a = %s\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 4, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
__attribute__((no)) unsigned long long rosbg_di_sll(unsigned long long a,
                                                    unsigned long long b) {
  return a | (b << 1);
}


x86 assembly (clang, -O0):
<rosbg_di_sll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rosbg_di_sll>:
lea    (%rsi,%rsi,1),%rax
or     %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @rosbg_di_sll(i64 %0, i64 %1) {
%3 = shl i64 %1, 1
%4 = or i64 %3, %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ keyboard_hasData();
void keyboard_outputWait() {
  while (!keyboard_hasData())
    ;
}


x86 assembly (clang, -O0):
<keyboard_outputWait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <keyboard_outputWait+0x9>
mov    $0x0,%al
call   1030 <keyboard_hasData@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1135 <keyboard_outputWait+0x25>
jmp    113a <keyboard_outputWait+0x2a>
jmp    1119 <keyboard_outputWait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_outputWait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyboard_hasData@plt>
test   %eax,%eax
je     1120 <keyboard_outputWait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @keyboard_outputWait() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @keyboard_hasData()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @keyboard_outputWait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @keyboard_hasData()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
double luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_deg(void) {
  lua_pushnumber(luaL_check_number(1) / ((3.14159265358979323846) / 180.0));
}


x86 assembly (clang, -O0):
<math_deg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_deg>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
divsd  0xecd(%rip),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_deg() {
%1 = call double @luaL_check_number(i32 1)
%2 = fdiv double %1, 0x3F91DF46A2529D39
%3 = call i32 @lua_pushnumber(double %2)
ret void
}

LLVM IR (-O2):
define void @math_deg() {
%1 = tail call double @luaL_check_number(i32 1)
%2 = fdiv double %1, 0x3F91DF46A2529D39
%3 = tail call i32 @lua_pushnumber(double %2)
ret void
}