xunge/DecIR huggingface dataset:
/* Variables and functions */
#define KEY_DOWN 132
#define KEY_ENTER 131
#define KEY_UP 130
#define KEY_VOLUMEDOWN 129
#define KEY_VOLUMEUP 128
int device_handle_key(int key_code, int visible) {
  if (visible) {
    switch (key_code) {
    case KEY_DOWN:
    case KEY_VOLUMEDOWN:
      return -3;
    case KEY_UP:
    case KEY_VOLUMEUP:
      return -2;
    case KEY_ENTER:
      return -4;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<device_handle_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1166 <device_handle_key+0x66>
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     1161 <device_handle_key+0x61>
mov    -0x18(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xfffffffd,-0x4(%rbp)
jmp    116d <device_handle_key+0x6d>
movl   $0xfffffffe,-0x4(%rbp)
jmp    116d <device_handle_key+0x6d>
movl   $0xfffffffc,-0x4(%rbp)
jmp    116d <device_handle_key+0x6d>
jmp    1166 <device_handle_key+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_handle_key>:
mov    $0xffffffff,%eax
test   %esi,%esi
je     111e <device_handle_key+0x1e>
add    $0xffffff80,%edi
cmp    $0x4,%edi
ja     111e <device_handle_key+0x1e>
movslq %edi,%rax
lea    0xee5(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @device_handle_key(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %4
switch i32 %9, label %13 [
i32 132, label %10
i32 129, label %10
i32 130, label %11
i32 128, label %11
i32 131, label %12
]
10: ; preds = %8, %8
store i32 -3, i32* %3
br label %15
11: ; preds = %8, %8
store i32 -2, i32* %3
br label %15
12: ; preds = %8
store i32 -4, i32* %3
br label %15
13: ; preds = %8
br label %14
14: ; preds = %13, %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %12, %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@switch.table.device_handle_key = [5 x i32] [i32 -2, i32 -3, i32 -2, i32 -4, i32 -3]
define i32 @device_handle_key(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = add i32 %0, -128
%6 = icmp ult i32 %5, 5
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.device_handle_key, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %2, %4, %7
%12 = phi i32 [ %10, %7 ], [ -1, %4 ], [ -1, %2 ]
ret i32 %12
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct basic_block_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ concat_ptr_list(struct ptr_list *, struct ptr_list **);
void concat_basic_block_list(struct basic_block_list *from,
                             struct basic_block_list **to) {
  concat_ptr_list((struct ptr_list *)from, (struct ptr_list **)to);
}


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

x86 assembly (clang, -O2):
<concat_basic_block_list>:
jmp    1030 <concat_ptr_list@plt>

LLVM IR (-O0):
%struct.basic_block_list = type { i32 }
%struct.ptr_list = type { i32 }
define void @concat_basic_block_list(%struct.basic_block_list* %0, %struct.basic_block_list** %1) {
%3 = alloca %struct.basic_block_list*
%4 = alloca %struct.basic_block_list**
store %struct.basic_block_list* %0, %struct.basic_block_list** %3
store %struct.basic_block_list** %1, %struct.basic_block_list*** %4
%5 = load %struct.basic_block_list*, %struct.basic_block_list** %3
%6 = bitcast %struct.basic_block_list* %5 to %struct.ptr_list*
%7 = load %struct.basic_block_list**, %struct.basic_block_list*** %4
%8 = bitcast %struct.basic_block_list** %7 to %struct.ptr_list**
%9 = call i32 @concat_ptr_list(%struct.ptr_list* %6, %struct.ptr_list** %8)
ret void
}

LLVM IR (-O2):
%struct.basic_block_list = type { i32 }
%struct.ptr_list = type { i32 }
define void @concat_basic_block_list(%struct.basic_block_list* %0, %struct.basic_block_list** %1) {
%3 = bitcast %struct.basic_block_list* %0 to %struct.ptr_list*
%4 = bitcast %struct.basic_block_list** %1 to %struct.ptr_list**
%5 = tail call i32 @concat_ptr_list(%struct.ptr_list* %3, %struct.ptr_list** %4)
ret void
}
/* Variables and functions */
int machdep_sys_sendto(int, void const *, int, int, int /*<<< orphan*/ *,
                       int /*<<< orphan*/);
machdep_sys_send(int s, const void *buf, int len, int flags) {
  return (machdep_sys_sendto(s, buf, len, flags, NULL, 0));
}


x86 assembly (clang, -O0):
<machdep_sys_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <machdep_sys_sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_send>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <machdep_sys_sendto@plt>

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

LLVM IR (-O2):
define i32 @machdep_sys_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @machdep_sys_sendto(i32 %0, i8* %1, i32 %2, i32 %3, i32* null, i32 0)
ret i32 %5
}
void function_b() {
  int i;
  double prod = 1;
  for (i = 0; i < 10000; i++) {
    prod *= i;
  }
}


x86 assembly (clang, -O0):
<function_b>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    1142 <function_b+0x42>
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1118 <function_b+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @function_b() {
%1 = alloca i32
%2 = alloca double
store double 1.000000e+00, double* %2
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to double
%9 = load double, double* %2
%10 = fmul double %9, %8
store double %10, double* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @function_b() {
ret void
}
int main(void) {
  if (__builtin_memcmp("", "//", 3) != 0)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
unreachable
}

LLVM IR (-O2):
define i32 @main() {
tail call void @abort()
unreachable
}
/* Variables and functions */
scalar_t__ COND_LT();
int /*<<< orphan*/ EA_AW_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_slt_8_aw(void) { m68ki_write_8(EA_AW_8(), COND_LT() ? 0xff : 0); }


x86 assembly (clang, -O0):
<m68k_op_slt_8_aw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AW_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_slt_8_aw>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AW_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_slt_8_aw() {
%1 = call i32 (...) @EA_AW_8()
%2 = call i64 (...) @COND_LT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_slt_8_aw() {
%1 = tail call i32 (...) @EA_AW_8()
%2 = tail call i64 (...) @COND_LT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int f45(int *);
int f46(int *p) { return f45(p); }


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

x86 assembly (clang, -O2):
<f46>:
jmp    1030 <f45@plt>

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

LLVM IR (-O2):
define i32 @f46(i32* %0) {
%2 = tail call i32 @f45(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_eoi(int);
int /*<<< orphan*/ parallel_set_eoi(int);
void parallel_cpu_set_eoi(unsigned char val) {
  if (val) {
    parallel_set_eoi(0x02);
  } else {
    parallel_clr_eoi(~0x02);
  }
}


x86 assembly (clang, -O0):
<parallel_cpu_set_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_cpu_set_eoi+0x27>
mov    $0x2,%edi
call   1040 <parallel_set_eoi@plt>
jmp    1151 <parallel_cpu_set_eoi+0x31>
mov    $0xfffffffd,%edi
call   1030 <parallel_clr_eoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_cpu_set_eoi>:
test   %edi,%edi
je     112e <parallel_cpu_set_eoi+0xe>
mov    $0x2,%edi
jmp    1040 <parallel_set_eoi@plt>
mov    $0xfffffffd,%edi
jmp    1030 <parallel_clr_eoi@plt>

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

LLVM IR (-O2):
define void @parallel_cpu_set_eoi(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_eoi(i32 2)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_eoi(i32 -3)
br label %7
7: ; preds = %5, %3
ret void
}
void gprintdf(const char *fmt, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @gprintdf(i8* nocapture %0, ...) {
ret void
}
void _swap(int A[], int i, int j) {
  if (A[i] > A[j]) {
    int temp = A[i];
    A[i] = A[j];
    A[j] = temp;
  }
}


x86 assembly (clang, -O0):
<_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    115c <_swap+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
cmp    %esi,%ecx
jle    1116 <_swap+0x16>
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @_swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = icmp sgt i32 %12, %17
br i1 %18, label %19, label %39
19: ; preds = %3
%20 = load i32*, i32** %4
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
store i32 %24, i32* %7
%25 = load i32*, i32** %4
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = load i32, i32* %28
%30 = load i32*, i32** %4
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %29, i32* %33
%34 = load i32, i32* %7
%35 = load i32*, i32** %4
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
store i32 %34, i32* %38
br label %39
39: ; preds = %19, %3
ret void
}

LLVM IR (-O2):
define void @_swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 %9, i32* %5
store i32 %6, i32* %8
br label %12
12: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ file1_func3();
int /*<<< orphan*/ file2_func1();
void file1_func2(void) {
  file1_func3();
  file2_func1();
}


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

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

LLVM IR (-O0):
define void @file1_func2() {
%1 = call i32 (...) @file1_func3()
%2 = call i32 (...) @file2_func1()
ret void
}

LLVM IR (-O2):
define void @file1_func2() {
%1 = tail call i32 (...) @file1_func3()
%2 = tail call i32 (...) @file2_func1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int chmod(const char *path, mode_t mode) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<chmod>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @chmod(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void str_reverse(char *c) {
  if (*c != '\0') {
    str_reverse(c + 1);
    putchar(*c);
  }
}


x86 assembly (clang, -O0):
<str_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1155 <str_reverse+0x35>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <str_reverse@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_reverse>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113b <str_reverse+0x1b>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1040 <str_reverse@plt>
movsbl (%rbx),%edi
pop    %rbx
jmp    1030 <putchar@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_reverse(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @str_reverse(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @putchar(i8 signext %7)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int setbits(int, int, int, int);
int setbitsi(int, int, int, int);
int main() {
  int x = 1493749823;
  int p = 6;
  int n = 3;
  int y = 1234320893;
  printf("%u\n%u\n", setbits(x, p, n, y), setbitsi(x, p, n, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5908d03f,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x49923dfd,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1050 <setbits@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <setbitsi@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5908d03f,%edi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x49923dfd,%ecx
call   1050 <setbits@plt>
mov    %eax,%ebx
mov    $0x5908d03f,%edi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x49923dfd,%ecx
call   1030 <setbitsi@plt>
lea    0xe94(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%u\0A%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1493749823, i32* %2
store i32 6, i32* %3
store i32 3, i32* %4
store i32 1234320893, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @setbits(i32 %6, i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @setbitsi(i32 %11, i32 %12, i32 %13, i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%u\0A%u\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 1493749823, i32 6, i32 3, i32 1234320893)
%2 = tail call i32 @setbitsi(i32 1493749823, i32 6, i32 3, i32 1234320893)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
double *malloc(int);
double *new_point(double x1, double x2, double x3) {
  double *value = malloc(3 * sizeof(double));
  value[0] = x1;
  value[1] = x2;
  value[2] = x3;
  return value;
}


x86 assembly (clang, -O0):
<new_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_point>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    $0x18,%edi
call   1030 <malloc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rax)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double* @new_point(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = call double* @malloc(i32 24)
store double* %8, double** %7
%9 = load double, double* %4
%10 = load double*, double** %7
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double, double* %5
%13 = load double*, double** %7
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double, double* %6
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 2
store double %15, double* %17
%18 = load double*, double** %7
ret double* %18
}

LLVM IR (-O2):
define noalias double* @new_point(double %0, double %1, double %2) {
%4 = tail call double* @malloc(i32 24)
store double %0, double* %4
%5 = getelementptr inbounds double, double* %4, i64 1
store double %1, double* %5
%6 = getelementptr inbounds double, double* %4, i64 2
store double %2, double* %6
ret double* %4
}
/* Variables and functions */
scalar_t__ COND_EQ();
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_seq_8_pd(void) {
  m68ki_write_8(EA_AY_PD_8(), COND_EQ() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_seq_8_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_EQ@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_seq_8_pd>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_EQ@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_seq_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i64 (...) @COND_EQ()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_seq_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i64 (...) @COND_EQ()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
char *malloc(int);
char *read(char *filename) {
  char *buffer = malloc(1000000 * sizeof(char *));
  int i = 0;
  FILE *file;
  file = fopen(filename, "r");
  if (file != NULL)
    ;
  { i = fread(buffer, sizeof(char), 1000000 * sizeof(char *), file); }
  fclose(file);
  return buffer;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7a1200,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1185 <read+0x45>
jmp    1185 <read+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x7a1200,%edx
call   1030 <fread@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x7a1200,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xea4(%rip),%rsi
mov    %r14,%rdi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x7a1200,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @read(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %2
%6 = call i8* @malloc(i32 8000000)
store i8* %6, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %2
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %1
%13 = load i8*, i8** %3
%14 = load i32*, i32** %5
%15 = call i32 @fread(i8* %13, i32 1, i32 8000000, i32* %14)
store i32 %15, i32* %4
%16 = load i32*, i32** %5
%17 = call i32 @fclose(i32* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i8* @read(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(8000000) i8* @malloc(i32 8000000)
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fread(i8* %2, i32 1, i32 8000000, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i8* %2
}
void modelock_init(void) {}


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

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

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

LLVM IR (-O2):
define void @modelock_init() {
ret void
}
int irc_isupper(int c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<irc_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <irc_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @irc_isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @irc_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int main(void) {
  int a = 100;
  do {
    a = a - 1;
  } while (a > 10);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
store i32 %5, i32* %2
br label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 10
br i1 %8, label %3, label %9
9: ; preds = %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Type definitions */
typedef int /*<<< orphan*/ heartbeat;

/* Variables and functions */
int write_exact(int, char const *, int);
int send_hmr_heartbeat(int fd) {
  static const char heartbeat[] = {0x01, 0xd0, 0x00, 0x00,
                                   0x00, 0x00, 0x00, 0x00};
  return write_exact(fd, heartbeat, sizeof(heartbeat));
}


x86 assembly (clang, -O0):
<send_hmr_heartbeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x8,%edx
call   1030 <write_exact@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_hmr_heartbeat>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <write_exact@plt>

LLVM IR (-O0):
@send_hmr_heartbeat.heartbeat = internal constant [8 x i8] c"\01\D0\00\00\00\00\00\00"
define i32 @send_hmr_heartbeat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_exact(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @send_hmr_heartbeat.heartbeat, i64 0, i64 0), i32 8)
ret i32 %4
}

LLVM IR (-O2):
@send_hmr_heartbeat.heartbeat = internal constant [8 x i8] c"\01\D0\00\00\00\00\00\00"
define i32 @send_hmr_heartbeat(i32 %0) {
%2 = tail call i32 @write_exact(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @send_hmr_heartbeat.heartbeat, i64 0, i64 0), i32 8)
ret i32 %2
}
int ioCanDeleteFileOfSize(char *pathString, int pathStringLength) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ioCanDeleteFileOfSize(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *basename(const char *path) {
  char sep = '/';
  const char *p = strrchr(path, sep);
  if (p) {
    return p + 1;
  } else {
    return path;
  }
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0x2f,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114d <basename+0x3d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <basename+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
store i8* %0, i8** %3
store i8 47, i8* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i8* @strrchr(i8* %6, i8 signext %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %16
14: ; preds = %1
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %16
16: ; preds = %14, %11
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double seconds(void) {
  struct timeval t;
  gettimeofday(&t, 0);
  return 1E-6 * (1000000ULL * t.tv_sec + t.tv_usec);
}


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
imul   $0xf4240,%rax,%rax
add    %rcx,%rax
movq   %rax,%xmm1
movaps 0xecf(%rip),%xmm0
punpckldq %xmm0,%xmm1
movapd 0xed3(%rip),%xmm0
subpd  %xmm0,%xmm1
movaps %xmm1,%xmm0
unpckhpd %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9c(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
movq   %rax,%xmm1
punpckldq 0xec5(%rip),%xmm1
subpd  0xecd(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xec9(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 1000000, %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
%9 = uitofp i64 %8 to double
%10 = fmul double 0x3EB0C6F7A0B5ED8D, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
%10 = uitofp i64 %9 to double
%11 = fmul double %10, 0x3EB0C6F7A0B5ED8D
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void test56_PrintImpl_printReal__E(float f) { printf("%f", (float)f); }


x86 assembly (clang, -O0):
<test56_PrintImpl_printReal__E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @test56_PrintImpl_printReal__E(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ usleep(int);
void sleep_sec(double sec) {
  int i;
  for (i = 0; i < floor(sec); ++i) {
    usleep(999999);
  }
  usleep(1000000 * (sec - floor(sec)));
}


x86 assembly (clang, -O0):
<sleep_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    116f <sleep_sec+0x4f>
mov    $0xf423f,%edi
call   1040 <usleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <sleep_sec+0x14>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe6c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <usleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_sec>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1170 <sleep_sec+0x50>
mov    $0x1,%ebx
movsd  %xmm0,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xf423f,%edi
call   1040 <usleep@plt>
movsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
add    $0x1,%ebx
ucomisd %xmm1,%xmm0
ja     1150 <sleep_sec+0x30>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe7f(%rip),%xmm1
cvttsd2si %xmm1,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @sleep_sec(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = call double @llvm.floor.f64(double %7)
%9 = fcmp olt double %6, %8
br i1 %9, label %10, label %15
10: ; preds = %4
%11 = call i32 @usleep(i32 999999)
br label %12
12: ; preds = %10
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load double, double* %2
%17 = load double, double* %2
%18 = call double @llvm.floor.f64(double %17)
%19 = fsub double %16, %18
%20 = fmul double 1.000000e+06, %19
%21 = fptosi double %20 to i32
%22 = call i32 @usleep(i32 %21)
ret void
}

LLVM IR (-O2):
define void @sleep_sec(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp ogt double %2, 0.000000e+00
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @usleep(i32 999999)
%7 = add nuw nsw i32 %5, 1
%8 = sitofp i32 %7 to double
%9 = fcmp ogt double %2, %8
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = fsub double %0, %2
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i32
%14 = tail call i32 @usleep(i32 %13)
ret void
}
/* Variables and functions */
int strnlen(char const *, int);
int main(void) {
  const char s[1] = {'a'};
  return (1 != strnlen(s, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1030 <strnlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x61,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <strnlen@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [1 x i8] c"a"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8]
store i32 0, i32* %1
%3 = bitcast [1 x i8]* %2 to i8*
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%5 = call i32 @strnlen(i8* %4, i32 1)
%6 = icmp ne i32 1, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 97, i8* %2
%3 = call i32 @strnlen(i8* %2, i32 1)
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int rte_log_get_level(scalar_t__);
scalar_t__ unlikely(int);
bool check_log_allowed(uint32_t level, uint32_t logtype) {
  int sys_level = rte_log_get_level(logtype);
  if (unlikely(sys_level < 0))
    false;
  return level <= (typeof(level))sys_level;
}


x86 assembly (clang, -O0):
<check_log_allowed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rte_log_get_level@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <unlikely@plt>
cmp    $0x0,%rax
je     115c <check_log_allowed+0x3c>
jmp    115c <check_log_allowed+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_log_allowed>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <rte_log_get_level@plt>
mov    %eax,%ebp
mov    %eax,%edi
shr    $0x1f,%edi
call   1040 <unlikely@plt>
movslq %ebp,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setge  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_log_allowed(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i32 @rte_log_get_level(i64 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i64 @unlikely(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %2
%15 = load i64, i64* %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = icmp sle i64 %15, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @check_log_allowed(i64 %0, i64 %1) {
%3 = tail call i32 @rte_log_get_level(i64 %1)
%4 = lshr i32 %3, 31
%5 = tail call i64 @unlikely(i32 %4)
%6 = sext i32 %3 to i64
%7 = icmp sge i64 %6, %0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ startFunction(int, char *, char *);
int stopDurip(int portno, char *filename, char *cmd) {
  startFunction(portno, filename, cmd);
  return 0;
}


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

x86 assembly (clang, -O2):
<stopDurip>:
push   %rax
call   1030 <startFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stopDurip(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @startFunction(i32 %0, i8* %1, i8* %2)
ret i32 0
}
/* Type definitions */
struct viewer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ diag(struct viewer *, int, char *, int, char *);
void warn_unused_chunk_data(struct viewer *viewer, int data_left) {
  diag(viewer, 0x2, "chunk has %d byte%s of data left at the end", data_left,
       (data_left == 1) ? "" : "s");
}


x86 assembly (clang, -O0):
<warn_unused_chunk_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%edx
lea    0xefc(%rip),%r8
lea    0xef4(%rip),%rax
cmp    $0x1,%edx
cmove  %rax,%r8
mov    $0x2,%esi
lea    0xeb6(%rip),%rdx
call   1030 <diag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_unused_chunk_data>:
mov    %esi,%ecx
cmp    $0x1,%esi
lea    0xf0f(%rip),%rax
lea    0xf09(%rip),%r8
cmove  %rax,%r8
lea    0xed2(%rip),%rdx
mov    $0x2,%esi
jmp    1030 <diag@plt>

LLVM IR (-O0):
%struct.viewer = type { i32 }
@.str = [44 x i8] c"chunk has %d byte%s of data left at the end\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"s\00"
define void @warn_unused_chunk_data(%struct.viewer* %0, i32 %1) {
%3 = alloca %struct.viewer*
%4 = alloca i32
store %struct.viewer* %0, %struct.viewer** %3
store i32 %1, i32* %4
%5 = load %struct.viewer*, %struct.viewer** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 @diag(%struct.viewer* %5, i32 2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.viewer = type { i32 }
@.str = [44 x i8] c"chunk has %d byte%s of data left at the end\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"s\00"
define void @warn_unused_chunk_data(%struct.viewer* %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @diag(%struct.viewer* %0, i32 2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %4)
ret void
}
void peg_next_tok(array, string) char *array;
char *string;
{
  char *aux_string;
  aux_string = string;
  aux_string = apont_next_tok(aux_string);
  peg_tok(array, aux_string);
}


x86 assembly (clang, -O0):
<peg_next_tok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <apont_next_tok@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <peg_tok@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peg_next_tok>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <apont_next_tok@plt>
movslq %eax,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <peg_tok@plt>

LLVM IR (-O0):
define void @peg_next_tok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i8*, ...)*)(i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %3
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @peg_tok to i32 (i8*, i8*, ...)*)(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @peg_next_tok(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @apont_next_tok to i32 (i8*, ...)*)(i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @peg_tok to i32 (i8*, i8*, ...)*)(i8* %0, i8* %5)
ret void
}
__attribute__((no, noclone)) double floor(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @floor(double returned %0) {
ret double %0
}
/* Variables and functions */
scalar_t__ isascii(int);
void falsePositive1() {
  char kb2[5];
  int X = 1000;
  if (isascii(X)) {
    kb2[0] = X;
  }
}


x86 assembly (clang, -O0):
<falsePositive1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
je     1137 <falsePositive1+0x27>
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<falsePositive1>:
mov    $0x3e8,%edi
jmp    1030 <isascii@plt>

LLVM IR (-O0):
define void @falsePositive1() {
%1 = alloca [5 x i8]
%2 = alloca i32
store i32 1000, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8 %8, i8* %9
br label %10
10: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @falsePositive1() {
%1 = tail call i64 @isascii(i32 1000)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint8_t(uint8_t const k1, uint8_t const k2) {
  return k1 == k2;
}


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

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

LLVM IR (-O0):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint8_t(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 eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}