xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned char *);
unsigned int arithmetic_byte_multiply(unsigned char multiplier,
                                      unsigned char multiplicand,
                                      unsigned char *p_result) {
  assert(p_result);
  unsigned int err_code = 0;
  if (!p_result) {
    err_code = 2;
    goto end;
  }
  *p_result = (multiplier * multiplicand);
end:
  return err_code;
}


x86 assembly (clang, -O0):
<arithmetic_byte_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <arithmetic_byte_multiply+0x3f>
movl   $0x2,-0x14(%rbp)
jmp    1162 <arithmetic_byte_multiply+0x52>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
imul   %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithmetic_byte_multiply>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <assert@plt>
test   %rbx,%rbx
je     1135 <arithmetic_byte_multiply+0x25>
mov    %r14d,%eax
mul    %bpl
mov    %al,(%rbx)
xor    %eax,%eax
jmp    113a <arithmetic_byte_multiply+0x2a>
mov    $0x2,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @arithmetic_byte_multiply(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @assert(i8* %8)
store i32 0, i32* %7
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %3
store i32 2, i32* %7
br label %21
13: ; preds = %3
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = mul nsw i32 %15, %17
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %6
store i8 %19, i8* %20
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @arithmetic_byte_multiply(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = tail call i32 @assert(i8* %2)
%5 = icmp eq i8* %2, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = mul i8 %1, %0
store i8 %7, i8* %2
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ 2, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exec_shell();
int /*<<< orphan*/ is_root();
int /*<<< orphan*/ printf(char *);
void check_root() {
  printf("[.] checking if we got root\n");
  if (!is_root()) {
    printf("[-] something went wrong =(\n");
    return;
  }
  printf("[+] got r00t ^_^\n");
  exec_shell();
}


x86 assembly (clang, -O0):
<check_root>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <is_root@plt>
cmp    $0x0,%eax
jne    1161 <check_root+0x31>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    1174 <check_root+0x44>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <exec_shell@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_root>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <is_root@plt>
test   %eax,%eax
je     115c <check_root+0x2c>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <exec_shell@plt>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[.] checking if we got root\0A\00"
@.str.1 = [29 x i8] c"[-] something went wrong =(\0A\00"
@.str.2 = [18 x i8] c"[+] got r00t ^_^\0A\00"
define void @check_root() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @is_root()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @exec_shell()
br label %9
9: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"[.] checking if we got root\00"
@str.3 = [28 x i8] c"[-] something went wrong =(\00"
@str.4 = [17 x i8] c"[+] got r00t ^_^\00"
define void @check_root() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @is_root()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
br label %9
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%8 = tail call i32 (...) @exec_shell()
br label %9
9: ; preds = %6, %4
ret void
}
int test_imm_A7uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xa7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A7uint64_lowword_reg>:
test   $0xa7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A7uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 167
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_A7uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 167
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CDB_RemoveEntry(char const *);
void CDB_RemoveIntEntry(const char *arg_key) { CDB_RemoveEntry(arg_key); }


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

x86 assembly (clang, -O2):
<CDB_RemoveIntEntry>:
jmp    1030 <CDB_RemoveEntry@plt>

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

LLVM IR (-O2):
define void @CDB_RemoveIntEntry(i8* %0) {
%2 = tail call i32 @CDB_RemoveEntry(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(long);
void *javacall_memory_heap_allocate(long size, long *outSize) {
  void *mem = (void *)malloc(size);
  *outSize = mem ? size : 0;
  return mem;
}


x86 assembly (clang, -O0):
<javacall_memory_heap_allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <javacall_memory_heap_allocate+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <javacall_memory_heap_allocate+0x40>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1150 <javacall_memory_heap_allocate+0x40>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<javacall_memory_heap_allocate>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
cmove  %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @javacall_memory_heap_allocate(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i8*
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64, i64* %3
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i64, i64* %3
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i64 [ %12, %11 ], [ 0, %13 ]
%16 = load i64*, i64** %4
store i64 %15, i64* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @javacall_memory_heap_allocate(i64 %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @malloc(i64 %0)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
%6 = select i1 %5, i64 0, i64 %0
store i64 %6, i64* %1
ret i8* %4
}
/* Type definitions */
struct fibheap_el {
  int dummy;
};

/* Variables and functions */
struct fibheap_el *fhe_get();
int /*<<< orphan*/ fhe_initelem(struct fibheap_el *);
struct fibheap_el *fhe_newelem() {
  struct fibheap_el *e;
  if ((e = fhe_get()) == NULL)
    return NULL;
  fhe_initelem(e);
  return e;
}


x86 assembly (clang, -O0):
<fhe_newelem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fhe_get@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <fhe_newelem+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    115b <fhe_newelem+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <fhe_initelem@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fhe_newelem>:
push   %rbx
xor    %eax,%eax
call   1030 <fhe_get@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1138 <fhe_newelem+0x18>
mov    %rbx,%rdi
call   1040 <fhe_initelem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.fibheap_el = type { i32 }
define %struct.fibheap_el* @fhe_newelem() {
%1 = alloca %struct.fibheap_el*
%2 = alloca %struct.fibheap_el*
%3 = call %struct.fibheap_el* (...) @fhe_get()
store %struct.fibheap_el* %3, %struct.fibheap_el** %2
%4 = icmp eq %struct.fibheap_el* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
store %struct.fibheap_el* null, %struct.fibheap_el** %1
br label %10
6: ; preds = %0
%7 = load %struct.fibheap_el*, %struct.fibheap_el** %2
%8 = call i32 @fhe_initelem(%struct.fibheap_el* %7)
%9 = load %struct.fibheap_el*, %struct.fibheap_el** %2
store %struct.fibheap_el* %9, %struct.fibheap_el** %1
br label %10
10: ; preds = %6, %5
%11 = load %struct.fibheap_el*, %struct.fibheap_el** %1
ret %struct.fibheap_el* %11
}

LLVM IR (-O2):
%struct.fibheap_el = type { i32 }
define %struct.fibheap_el* @fhe_newelem() {
%1 = tail call %struct.fibheap_el* (...) @fhe_get()
%2 = icmp eq %struct.fibheap_el* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fhe_initelem(%struct.fibheap_el* %1)
br label %5
5: ; preds = %0, %3
ret %struct.fibheap_el* %1
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_REMOVEDIR;
int unlinkat(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int rmdir(const char *path) { return unlinkat(AT_FDCWD, path, AT_REMOVEDIR); }


x86 assembly (clang, -O0):
<rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
call   1030 <unlinkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmdir>:
mov    %rdi,%rsi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
jmp    1030 <unlinkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@AT_REMOVEDIR = global i32 0
define i32 @rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @AT_FDCWD
%4 = load i8*, i8** %2
%5 = load i32, i32* @AT_REMOVEDIR
%6 = call i32 @unlinkat(i32 %3, i8* %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@AT_REMOVEDIR = global i32 0
define i32 @rmdir(i8* %0) {
%2 = load i32, i32* @AT_FDCWD
%3 = load i32, i32* @AT_REMOVEDIR
%4 = tail call i32 @unlinkat(i32 %2, i8* %0, i32 %3)
ret i32 %4
}
/* Type definitions */
union bpf_attr {
  int map_type;
  unsigned int key_size;
  unsigned int value_size;
  unsigned int max_entries;
};
typedef enum bpf_map_type { ____Placeholder_bpf_map_type } bpf_map_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_CREATE;
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_create_map(enum bpf_map_type map_type, unsigned key_size,
                   unsigned value_size, unsigned max_entries,
                   unsigned flags __attribute__((unused))) {
  union bpf_attr attr;
  attr.map_type = map_type;
  attr.key_size = key_size;
  attr.value_size = value_size;
  attr.max_entries = max_entries;
  return syscall(321, BPF_MAP_CREATE, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_create_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_create_map>:
push   %rax
mov    %ecx,(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_CREATE = global i32 0
define i32 @bpf_create_map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca %union.bpf_attr
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = bitcast %union.bpf_attr* %11 to i32*
store i32 %12, i32* %13
%14 = load i32, i32* %7
%15 = bitcast %union.bpf_attr* %11 to i32*
store i32 %14, i32* %15
%16 = load i32, i32* %8
%17 = bitcast %union.bpf_attr* %11 to i32*
store i32 %16, i32* %17
%18 = load i32, i32* %9
%19 = bitcast %union.bpf_attr* %11 to i32*
store i32 %18, i32* %19
%20 = load i32, i32* @BPF_MAP_CREATE
%21 = call i32 @syscall(i32 321, i32 %20, %union.bpf_attr* %11, i32 4)
ret i32 %21
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_CREATE = global i32 0
define i32 @bpf_create_map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %union.bpf_attr
%7 = bitcast %union.bpf_attr* %6 to i8*
%8 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %6, i64 0, i32 0
store i32 %3, i32* %8
%9 = load i32, i32* @BPF_MAP_CREATE
%10 = call i32 @syscall(i32 321, i32 %9, %union.bpf_attr* %6, i32 4)
ret i32 %10
}
/* Variables and functions */
int cu2ho(double *, double *, int);
int ho2ax(double *, double *, int);
int cu2ax(double *cu, double *ax, int p) {
  double ho[3];
  int trash;
  trash = cu2ho(cu, ho, p);
  trash = ho2ax(ho, ax, p);
  return 1;
}


x86 assembly (clang, -O0):
<cu2ax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <cu2ho@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ho2ax@plt>
mov    %eax,-0x34(%rbp)
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cu2ax>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <cu2ho@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ho2ax@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @cu2ax(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [3 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @cu2ho(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [3 x double], [3 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ho2ax(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @cu2ax(double* %0, double* %1, i32 %2) {
%4 = alloca [3 x double]
%5 = bitcast [3 x double]* %4 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%7 = call i32 @cu2ho(double* %0, double* %6, i32 %2)
%8 = call i32 @ho2ax(double* %6, double* %1, i32 %2)
ret i32 1
}
void foo_2_1_1_1_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_1_2_2_2() {
ret void
}
/* Variables and functions */
bool nrf51_errata_32(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_32() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ srec_set_hdr(int /*<<< orphan*/ *, char const *);
int srec_save_start(FILE *fp, const char *name) {
  srec_set_hdr(fp, name);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @srec_save_start(i32* %0, i8* %1) {
%3 = tail call i32 @srec_set_hdr(i32* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freemem(void *m) { free(m); }


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

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

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

LLVM IR (-O2):
define void @freemem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int beholddb_exec(int /*<<< orphan*/ *, char *);
int beholddb_begin_transaction(sqlite3 *db) {
  return beholddb_exec(db, "begin transaction;");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"begin transaction;\00"
define i32 @beholddb_begin_transaction(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @beholddb_exec(i32* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [19 x i8] c"begin transaction;\00"
define i32 @beholddb_begin_transaction(i32* %0) {
%2 = tail call i32 @beholddb_exec(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ type_info;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
int copy_type_info(int *dest_type_info, int *type_info, int type_info_size) {
  memcpy(dest_type_info, type_info, type_info_size * sizeof(type_info[0]));
  return type_info_size;
}


x86 assembly (clang, -O0):
<copy_type_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_type_info>:
push   %rbx
mov    %edx,%ebx
lea    0x0(,%rbx,4),%edx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @copy_type_info(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i32* %7, i32* %8, i32 %12)
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @copy_type_info(i32* %0, i32* %1, i32 returned %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i32* %0, i32* %1, i32 %4)
ret i32 %2
}
void port_lock(void) { __asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @port_lock() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void LPCIRQClear(unsigned long ulBase, unsigned long ulIRQ) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x40080000);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000008)));
  ulTemp &= ~(ulIRQ & 0xFFFF0000);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulTemp;
}


x86 assembly (clang, -O0):
<LPCIRQClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
movabs $0xffff0000,%rax
and    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCIRQClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
not    %ebx
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movabs $0xffffffff0000ffff,%rax
ff ff ff
or     %rbx,%rax
and    %rax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCIRQClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1074266112
%8 = zext i1 %7 to i32
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i64, i64* %3
%11 = add i64 %10, 8
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store i64 %13, i64* %5
%14 = load i64, i64* %4
%15 = and i64 %14, 4294901760
%16 = xor i64 %15, -1
%17 = load i64, i64* %5
%18 = and i64 %17, %16
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = load i64, i64* %3
%21 = add i64 %20, 8
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
ret void
}

LLVM IR (-O2):
define void @LPCIRQClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %1, 4294901760
%10 = xor i64 %9, -1
%11 = and i64 %8, %10
store volatile i64 %11, i64* %7
ret void
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t ror16(uint16_t data, unsigned int rotation) {
  return ((data >> rotation) | (data << (16 - rotation)));
}


x86 assembly (clang, -O0):
<ror16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror16>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
mov    $0x10,%dl
sub    %cl,%dl
mov    %edx,%ecx
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ror16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 16, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror16(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 16, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *splay(struct node *, int);
struct node *search(struct node *root, int key) {
  return splay(root, key);
}


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

x86 assembly (clang, -O2):
<search>:
jmp    1030 <splay@plt>

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

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @search(%struct.node* %0, i32 %1) {
%3 = tail call %struct.node* @splay(%struct.node* %0, i32 %1)
ret %struct.node* %3
}
/* Variables and functions */
char parser_UpCase(char);
unsigned int strlen(char *);
void parser_str_to_upper(char *str) {
  register unsigned int i = 0;
  while (i < strlen(str)) {
    str[i] = parser_UpCase(str[i]);
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<parser_str_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1179 <parser_str_to_upper+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <parser_UpCase@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <parser_str_to_upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_str_to_upper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     1161 <parser_str_to_upper+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <parser_UpCase@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1140 <parser_str_to_upper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @parser_str_to_upper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp ult i32 %5, %7
br i1 %8, label %9, label %22
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call signext i8 @parser_UpCase(i8 signext %14)
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
%20 = load i32, i32* %3
%21 = add i32 %20, 1
store i32 %21, i32* %3
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @parser_str_to_upper(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @parser_UpCase(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = zext i32 %10 to i64
%12 = icmp ult i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
unsigned long long hash_file(char *str) {
  unsigned long long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_file+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_file+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash_file+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_file+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_file(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
char itoc(int i) { return '0'; }


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x30,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
mov    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @itoc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8 48
}

LLVM IR (-O2):
define signext i8 @itoc(i32 %0) {
ret i8 48
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
gen_less_than() {
  gen_pop();
  gen_call("cclt");
}


x86 assembly (clang, -O0):
<gen_less_than>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen_call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_less_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"cclt\00"
define i32 @gen_less_than() {
%1 = alloca i32
%2 = call i32 (...) @gen_pop()
%3 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [5 x i8] c"cclt\00"
define i32 @gen_less_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ my_abort();
int /*<<< orphan*/ stderr;
void *palloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr,
            "Allocation memory error. "
            "Trying to allocate %zu bytes.",
            size);
    my_abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<palloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <palloc+0x44>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <my_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <palloc+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <my_abort@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Allocation memory error. Trying to allocate %zu bytes.\00"
define i8* @palloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 (...) @my_abort()
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Allocation memory error. Trying to allocate %zu bytes.\00"
define noalias i8* @palloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @my_abort()
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpat0c(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x48));
}


x86 assembly (clang, -O0):
<read_pxpat0c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x48,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpat0c>:
shl    $0x8,%edi
mov    $0xb0010048,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpat0c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 72
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpat0c(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 72
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
float Sleef_hypotf_u35(float x, float y) { return __builtin_hypotf(x, y); }


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

x86 assembly (clang, -O2):
<Sleef_hypotf_u35>:
jmp    1030 <hypotf@plt>

LLVM IR (-O0):
define float @Sleef_hypotf_u35(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @hypotf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Sleef_hypotf_u35(float %0, float %1) {
%3 = tail call float @hypotf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ increment_finished_count();
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void *thread_func2(void *arg) {
  pthread_detach(pthread_self());
  write(STDOUT_FILENO, ".", 1);
  increment_finished_count();
  return 0;
}


x86 assembly (clang, -O0):
<thread_func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <increment_finished_count@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func2>:
push   %rax
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
mov    $0x1,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <increment_finished_count@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c".\00"
define i8* @thread_func2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @pthread_detach(i32 %3)
%5 = load i32, i32* @STDOUT_FILENO
%6 = call i32 @write(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = call i32 (...) @increment_finished_count()
ret i8* null
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c".\00"
define noalias i8* @thread_func2(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i32 (...) @increment_finished_count()
ret i8* null
}
/* Variables and functions */
scalar_t__ syscall(int);
long testCall2(void) { return (long)syscall(350); }


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

x86 assembly (clang, -O2):
<testCall2>:
mov    $0x15e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i64 @testCall2() {
%1 = call i64 @syscall(i32 350)
ret i64 %1
}

LLVM IR (-O2):
define i64 @testCall2() {
%1 = tail call i64 @syscall(i32 350)
ret i64 %1
}
int MUSIC_Shutdown(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_Shutdown() {
ret i32 0
}
/* Variables and functions */
scalar_t__ pipe(int *);
int pipe_cloexec(int pipefd[2]) { return 0 == pipe(pipefd) ? 0 : -1; }


x86 assembly (clang, -O0):
<pipe_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_cloexec>:
push   %rax
call   1030 <pipe@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pipe_cloexec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pipe(i32* %3)
%5 = icmp eq i64 0, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 0, i32 -1
ret i32 %7
}

LLVM IR (-O2):
define i32 @pipe_cloexec(i32* %0) {
%2 = tail call i64 @pipe(i32* %0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ create_byte_sub();
int /*<<< orphan*/ create_inv_byte_sub();
int /*<<< orphan*/ create_inverses();
int /*<<< orphan*/ create_large_tables();
int /*<<< orphan*/ create_rcon();
void init_tables() {
  create_inverses();
  create_byte_sub();
  create_inv_byte_sub();
  create_rcon();
  create_large_tables();
}


x86 assembly (clang, -O0):
<init_tables>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <create_inverses@plt>
mov    $0x0,%al
call   1060 <create_byte_sub@plt>
mov    $0x0,%al
call   1050 <create_inv_byte_sub@plt>
mov    $0x0,%al
call   1070 <create_rcon@plt>
mov    $0x0,%al
call   1030 <create_large_tables@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_tables>:
push   %rax
xor    %eax,%eax
call   1040 <create_inverses@plt>
xor    %eax,%eax
call   1060 <create_byte_sub@plt>
xor    %eax,%eax
call   1050 <create_inv_byte_sub@plt>
xor    %eax,%eax
call   1070 <create_rcon@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <create_large_tables@plt>

LLVM IR (-O0):
define void @init_tables() {
%1 = call i32 (...) @create_inverses()
%2 = call i32 (...) @create_byte_sub()
%3 = call i32 (...) @create_inv_byte_sub()
%4 = call i32 (...) @create_rcon()
%5 = call i32 (...) @create_large_tables()
ret void
}

LLVM IR (-O2):
define void @init_tables() {
%1 = tail call i32 (...) @create_inverses()
%2 = tail call i32 (...) @create_byte_sub()
%3 = tail call i32 (...) @create_inv_byte_sub()
%4 = tail call i32 (...) @create_rcon()
%5 = tail call i32 (...) @create_large_tables()
ret void
}
void nand_onchip_enable_ecc(struct mtd_info *mtd, int enable) { return; }


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

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

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

LLVM IR (-O2):
%struct.mtd_info = type opaque
define void @nand_onchip_enable_ecc(%struct.mtd_info* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
void do_nothing(void) {}


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

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

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

LLVM IR (-O2):
define void @do_nothing() {
ret void
}
void strsub(char *str, int begin, char *buf) {
  for (char *c = str + begin; *c != '\0'; c++, buf++) {
    *buf = *c;
  }
  *buf = '\0';
}


x86 assembly (clang, -O0):
<strsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <strsub+0x57>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <strsub+0x1e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsub>:
movslq %esi,%rcx
mov    (%rdi,%rcx,1),%al
test   %al,%al
je     1131 <strsub+0x31>
add    %rdi,%rcx
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdx)
add    $0x1,%rdx
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <strsub+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @strsub(i8* nocapture %0, i32 %1, i8* nocapture writeonly %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %10, %3
%9 = phi i8* [ %2, %3 ], [ %15, %10 ]
store i8 0, i8* %9
ret void
10: ; preds = %3, %10
%11 = phi i8 [ %16, %10 ], [ %6, %3 ]
%12 = phi i8* [ %14, %10 ], [ %5, %3 ]
%13 = phi i8* [ %15, %10 ], [ %2, %3 ]
store i8 %11, i8* %13
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %8, label %10
}
int xmlUCSIsMathematicalOperators(int code) {
  return (((code >= 0x2200) && (code <= 0x22FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMathematicalOperators>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2200,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMathematicalOperators+0x26>
cmpl   $0x22ff,-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):
<xmlUCSIsMathematicalOperators>:
and    $0xffffff00,%edi
xor    %eax,%eax
cmp    $0x2200,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMathematicalOperators(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 8704
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 8959
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 @xmlUCSIsMathematicalOperators(i32 %0) {
%2 = and i32 %0, -256
%3 = icmp eq i32 %2, 8704
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct recurrent_neural_network {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
free_recurrent_neural_network(struct recurrent_neural_network *);
void free_rnn(struct recurrent_neural_network *rnn) {
  free_recurrent_neural_network(rnn);
}


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

x86 assembly (clang, -O2):
<free_rnn>:
jmp    1030 <free_recurrent_neural_network@plt>

LLVM IR (-O0):
%struct.recurrent_neural_network = type { i32 }
define void @free_rnn(%struct.recurrent_neural_network* %0) {
%2 = alloca %struct.recurrent_neural_network*
store %struct.recurrent_neural_network* %0, %struct.recurrent_neural_network** %2
%3 = load %struct.recurrent_neural_network*, %struct.recurrent_neural_network** %2
%4 = call i32 @free_recurrent_neural_network(%struct.recurrent_neural_network* %3)
ret void
}

LLVM IR (-O2):
%struct.recurrent_neural_network = type { i32 }
define void @free_rnn(%struct.recurrent_neural_network* %0) {
%2 = tail call i32 @free_recurrent_neural_network(%struct.recurrent_neural_network* %0)
ret void
}