xunge/DecIR huggingface dataset:
int addNum(int a, int b) { return (a + b); }


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

x86 assembly (clang, -O2):
<addNum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addNum(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addNum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA6_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA6_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA6_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int is_correct_input(char *egn) {
  int counter = 0;
  while (egn[counter] != '\0') {
    if (egn[counter] < 48 || egn[counter] > 57) {
      return 1;
    }
    counter++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_correct_input>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <is_correct_input+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     114e <is_correct_input+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    115a <is_correct_input+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    116f <is_correct_input+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_correct_input+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_correct_input>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1123 <is_correct_input+0x23>
add    $0x1,%rdi
nopl   0x0(%rax)
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <is_correct_input+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <is_correct_input+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_correct_input(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -58
%12 = icmp ult i8 %11, -10
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bswap32(int /*<<< orphan*/);
uint32_t cpu_to_be32(uint32_t v) { return bswap32(v); }


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

x86 assembly (clang, -O2):
<cpu_to_be32>:
jmp    1030 <bswap32@plt>

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

LLVM IR (-O2):
define i32 @cpu_to_be32(i32 %0) {
%2 = tail call i32 @bswap32(i32 %0)
ret i32 %2
}
char *NativeDirSelection(const char *title, const char *basedir) {
  return (char *)0;
}


x86 assembly (clang, -O0):
<NativeDirSelection>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @NativeDirSelection(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
struct yamc_pub_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct yamc_pub_args_info *);
int /*<<< orphan*/ clear_given(struct yamc_pub_args_info *);
int /*<<< orphan*/ init_args_info(struct yamc_pub_args_info *);
void yamc_pub_cmd_parser_init(struct yamc_pub_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<yamc_pub_cmd_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yamc_pub_cmd_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.yamc_pub_args_info = type { i32 }
define void @yamc_pub_cmd_parser_init(%struct.yamc_pub_args_info* %0) {
%2 = alloca %struct.yamc_pub_args_info*
store %struct.yamc_pub_args_info* %0, %struct.yamc_pub_args_info** %2
%3 = load %struct.yamc_pub_args_info*, %struct.yamc_pub_args_info** %2
%4 = call i32 @clear_given(%struct.yamc_pub_args_info* %3)
%5 = load %struct.yamc_pub_args_info*, %struct.yamc_pub_args_info** %2
%6 = call i32 @clear_args(%struct.yamc_pub_args_info* %5)
%7 = load %struct.yamc_pub_args_info*, %struct.yamc_pub_args_info** %2
%8 = call i32 @init_args_info(%struct.yamc_pub_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.yamc_pub_args_info = type { i32 }
define void @yamc_pub_cmd_parser_init(%struct.yamc_pub_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.yamc_pub_args_info* %0)
%3 = tail call i32 @clear_args(%struct.yamc_pub_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.yamc_pub_args_info* %0)
ret void
}
void fn45C6() { return; }


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

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

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

LLVM IR (-O2):
define void @fn45C6() {
ret void
}
/* Variables and functions */
int yaffs_lsetxattr_reldir(int /*<<< orphan*/, char const *, char const *,
                           void const *, int, int);
int yaffs_lsetxattr(const char *path, const char *name, const void *data,
                    int size, int flags) {
  return yaffs_lsetxattr_reldir((0), path, name, data, size, flags);
}


x86 assembly (clang, -O0):
<yaffs_lsetxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
xor    %edi,%edi
call   1030 <yaffs_lsetxattr_reldir@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_lsetxattr>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_lsetxattr_reldir@plt>

LLVM IR (-O0):
define i32 @yaffs_lsetxattr(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @yaffs_lsetxattr_reldir(i32 0, i8* %11, i8* %12, i8* %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @yaffs_lsetxattr(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @yaffs_lsetxattr_reldir(i32 0, i8* %0, i8* %1, i8* %2, i32 %3, i32 %4)
ret i32 %6
}
void XKeysymToString() {}


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

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

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

LLVM IR (-O2):
define void @XKeysymToString() {
ret void
}
/* Variables and functions */
int CRYPTO_MEM_CHECK_OFF;
int CRYPTO_mem_ctrl(int mode) { return (CRYPTO_MEM_CHECK_OFF); }


x86 assembly (clang, -O0):
<CRYPTO_mem_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_mem_ctrl>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@CRYPTO_MEM_CHECK_OFF = global i32 0
define i32 @CRYPTO_mem_ctrl(i32 %0) {
%2 = load i32, i32* @CRYPTO_MEM_CHECK_OFF
ret i32 %2
}
/* Variables and functions */
int ejtag_switch(int, int);
int mips_ejtag_read_b(unsigned int addr) {
  addr &= 0x1fffffff;
  return ejtag_switch(0x2021, (int)&addr);
}


x86 assembly (clang, -O0):
<mips_ejtag_read_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1fffffff,%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %eax,%esi
mov    $0x2021,%edi
call   1030 <ejtag_switch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_ejtag_read_b>:
push   %rax
and    $0x1fffffff,%edi
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2021,%edi
call   1030 <ejtag_switch@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mips_ejtag_read_b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 536870911
store i32 %4, i32* %2
%5 = ptrtoint i32* %2 to i32
%6 = call i32 @ejtag_switch(i32 8225, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @mips_ejtag_read_b(i32 %0) {
%2 = alloca i32
%3 = and i32 %0, 536870911
store i32 %3, i32* %2
%4 = ptrtoint i32* %2 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @ejtag_switch(i32 8225, i32 %5)
ret i32 %6
}
void tm_fcs_write(void *p) {}


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

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

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

LLVM IR (-O2):
define void @tm_fcs_write(i8* nocapture %0) {
ret void
}
void builtin_alloca(int n) { volatile void *mem = __builtin_alloca(n); }


x86 assembly (clang, -O0):
<builtin_alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x10(%rbp)
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @builtin_alloca(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = alloca i8, i64 %5
store i8* %6, i8** %3
ret void
}

LLVM IR (-O2):
define void @builtin_alloca(i32 %0) {
ret void
}
/* Variables and functions */
int syscall(int, int *, int);
int pipe2(int fd[2], int flg) { return syscall(359, fd, flg); }


x86 assembly (clang, -O0):
<pipe2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x167,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe2>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x167,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @pipe2(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 = call i32 @syscall(i32 359, i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pipe2(i32* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 359, i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error_message(char *text, int errno) { printf("%s\n", text); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @error_message(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int test_level_two(int, int, int, int, void (*)(void *), void *);
int test_level_one(int one, int two, int three, int four,
                   void (*callback_func)(void *), void *data) {
  return test_level_two(one + 1, two + 2, three + 3, four + 4, callback_func,
                        data) +
         1;
}


x86 assembly (clang, -O0):
<test_level_one>:
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    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
add    $0x3,%edx
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <test_level_two@plt>
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_level_one>:
push   %rax
add    $0x1,%edi
add    $0x2,%esi
add    $0x3,%edx
add    $0x4,%ecx
call   1030 <test_level_two@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_level_one(i32 %0, i32 %1, i32 %2, i32 %3, void (i8*)* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca void (i8*)*
%12 = alloca i8*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store void (i8*)* %4, void (i8*)** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %8
%16 = add nsw i32 %15, 2
%17 = load i32, i32* %9
%18 = add nsw i32 %17, 3
%19 = load i32, i32* %10
%20 = add nsw i32 %19, 4
%21 = load void (i8*)*, void (i8*)** %11
%22 = load i8*, i8** %12
%23 = call i32 @test_level_two(i32 %14, i32 %16, i32 %18, i32 %20, void (i8*)* %21, i8* %22)
%24 = add nsw i32 %23, 1
ret i32 %24
}

LLVM IR (-O2):
define i32 @test_level_one(i32 %0, i32 %1, i32 %2, i32 %3, void (i8*)* %4, i8* %5) {
%7 = add nsw i32 %0, 1
%8 = add nsw i32 %1, 2
%9 = add nsw i32 %2, 3
%10 = add nsw i32 %3, 4
%11 = tail call i32 @test_level_two(i32 %7, i32 %8, i32 %9, i32 %10, void (i8*)* %4, i8* %5)
%12 = add nsw i32 %11, 1
ret i32 %12
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int stat(const char *path, struct stat *buf) {
  _exit(-1);
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ baz(int);
void foo(int arg) {
  bar(arg);
  baz(arg);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <bar@plt>
mov    -0x4(%rbp),%edi
call   1030 <baz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
call   1040 <bar@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bar(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @baz(i32 %5)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 @bar(i32 %0)
%3 = tail call i32 @baz(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((destructor)) howdy_dtor(void) {
  printf("I am the libhowdy destructor!\n");
}


x86 assembly (clang, -O0):
<howdy_dtor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"I am the libhowdy destructor!\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @howdy_dtor, i8* null }]
define void @howdy_dtor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @howdy_dtor, i8* null }]
@str = [30 x i8] c"I am the libhowdy destructor!\00"
define void @howdy_dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2STxFIFOLimitSet(unsigned long ulBase, unsigned long ulLevel) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  DEBUG_ASSERT(ulLevel <= 16);
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) = ulLevel;
}


x86 assembly (clang, -O0):
<I2STxFIFOLimitSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x10,-0x10(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxFIFOLimitSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x11,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0xc(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2STxFIFOLimitSet(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 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ule i64 %9, 16
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = add i64 %14, 12
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
ret void
}

LLVM IR (-O2):
define void @I2STxFIFOLimitSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 17
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = add i64 %0, 12
%10 = inttoptr i64 %9 to i64*
store volatile i64 %1, i64* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void naturalN(int N) {
  if (N > 0)
    naturalN(N - 1);
  printf("%d ", N);
  return;
}


x86 assembly (clang, -O0):
<naturalN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1140 <naturalN+0x20>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <naturalN@plt>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<naturalN>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jle    112f <naturalN+0xf>
lea    -0x1(%rbx),%edi
call   1030 <naturalN@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @naturalN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @naturalN(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
tail call void @naturalN(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int main() {
  char *p = NULL;
  *p = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
store i8 2, i8* %3
ret i32 0
}

LLVM IR (-O2):
int of_device_is_stdout_path(struct device_d *dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.device_d = type opaque
define i32 @of_device_is_stdout_path(%struct.device_d* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ nodemask_t;

/* Variables and functions */
void nodemask_dump(const char *header, const nodemask_t *mask) { return; }


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

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

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

LLVM IR (-O2):
define void @nodemask_dump(i8* nocapture %0, i32* nocapture %1) {
ret void
}
void audio_set_music_on_off(int on) {}


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

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

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

LLVM IR (-O2):
define void @audio_set_music_on_off(i32 %0) {
ret void
}
__attribute__((no, noclone, used)) void _ITM_deregisterTMCloneTable() {
  asm("");
}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_deregisterTMCloneTable to i8*)], section "llvm.metadata"
define void @_ITM_deregisterTMCloneTable() {
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void ()* @_ITM_deregisterTMCloneTable to i8*)], section "llvm.metadata"
define void @_ITM_deregisterTMCloneTable() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
Insert(argc, argv) int argc;
char **argv;
{ return (0); }


x86 assembly (clang, -O0):
<Insert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Insert(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int _bmp_GetLineLength(int width, int bpp) {
  int bits;
  int pad_bits;
  bits = width * bpp;
  pad_bits = 32 - (bits & 0x1f);
  if (pad_bits < 32)
    bits += pad_bits;
  return bits / 8;
}


x86 assembly (clang, -O0):
<_bmp_GetLineLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    1137 <_bmp_GetLineLength+0x37>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bmp_GetLineLength>:
imul   %esi,%edi
mov    %edi,%eax
and    $0x1f,%eax
mov    $0x20,%ecx
sub    %eax,%ecx
test   %eax,%eax
cmove  %eax,%ecx
lea    (%rcx,%rdi,1),%eax
add    $0x7,%eax
add    %edi,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @_bmp_GetLineLength(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = and i32 %3, 31
%5 = icmp eq i32 %4, 0
%6 = sub nuw nsw i32 32, %4
%7 = select i1 %5, i32 0, i32 %6
%8 = add nsw i32 %7, %3
%9 = sdiv i32 %8, 8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gmove_bca_1a2t_b3();
int /*<<< orphan*/ gmove_bca_1a2t_b4();
int /*<<< orphan*/ gmove_bca_1a2t_b5();
int main() {
  gmove_bca_1a2t_b3();
  gmove_bca_1a2t_b4();
  gmove_bca_1a2t_b5();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gmove_bca_1a2t_b3@plt>
mov    $0x0,%al
call   1050 <gmove_bca_1a2t_b4@plt>
mov    $0x0,%al
call   1040 <gmove_bca_1a2t_b5@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gmove_bca_1a2t_b3@plt>
xor    %eax,%eax
call   1050 <gmove_bca_1a2t_b4@plt>
xor    %eax,%eax
call   1040 <gmove_bca_1a2t_b5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gmove_bca_1a2t_b3()
%3 = call i32 (...) @gmove_bca_1a2t_b4()
%4 = call i32 (...) @gmove_bca_1a2t_b5()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_bca_1a2t_b3()
%2 = tail call i32 (...) @gmove_bca_1a2t_b4()
%3 = tail call i32 (...) @gmove_bca_1a2t_b5()
ret i32 0
}
int wxy_to_index(int width, int x, int y) { return x + y * width; }


x86 assembly (clang, -O0):
<wxy_to_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wxy_to_index>:
imul   %edx,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @wxy_to_index(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* %5
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @wxy_to_index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void check_malloc_success(void *ptr, int i) {
  if (ptr == NULL) {
    fprintf(stderr, "ERROR: Could not allocate more memory %i.\n", i);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_malloc_success>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115c <check_malloc_success+0x3c>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc_success>:
test   %rdi,%rdi
je     1126 <check_malloc_success+0x6>
ret
push   %rax
mov    %esi,%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"ERROR: Could not allocate more memory %i.\0A\00"
define void @check_malloc_success(i8* readnone %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
void XtIsRealized() {}


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

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

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

LLVM IR (-O2):
define void @XtIsRealized() {
ret void
}
/* Variables and functions */
int PAPI_set_domain(int);
void PAPIF_SET_DOMAIN(int *domain, int *check) {
  *check = PAPI_set_domain(*domain);
}


x86 assembly (clang, -O0):
<PAPIF_SET_DOMAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_set_domain@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_SET_DOMAIN>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_domain@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_SET_DOMAIN(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* %5
%7 = call i32 @PAPI_set_domain(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @PAPIF_SET_DOMAIN(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_domain(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long getCurrentTime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getCurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentTime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
int qsort_cmp_uint(const void *x, const void *y) {
  if (*((unsigned int *)x) < *((unsigned int *)y))
    return (-1);
  else
    return (*((unsigned int *)x) > *((unsigned int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jae    112a <qsort_cmp_uint+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_uint+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_uint>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ugt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ leavex(int, char *);
void bad_ver(void) { leavex(1, "Version number mismatch. No go."); }


x86 assembly (clang, -O0):
<bad_ver>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <leavex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_ver>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <leavex@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Version number mismatch. No go.\00"
define void @bad_ver() {
%1 = call i32 @leavex(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Version number mismatch. No go.\00"
define void @bad_ver() {
%1 = tail call i32 @leavex(i32 1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print(int /*<<< orphan*/, char *, char const *,
                         int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void check_rc(int rc, const char *fn) {
  if (rc != -1)
    return;
  print(LOG_ERR, "error: %s failed. %s\n", fn, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<check_rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     114f <check_rc+0x1f>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xe7f(%rip),%rsi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check_rc>:
cmp    $0xffffffff,%edi
je     1136 <check_rc+0x6>
ret
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e8d(%rip),%rax
mov    (%rax),%ebp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea6(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [22 x i8] c"error: %s failed. %s\0A\00"
@errno = global i32 0
define void @check_rc(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 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @LOG_ERR
%10 = load i8*, i8** %4
%11 = load i32, i32* @errno
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @print(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [22 x i8] c"error: %s failed. %s\0A\00"
@errno = global i32 0
define void @check_rc(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %5, label %4
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @LOG_ERR
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @print(i32 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %8)
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct matlab_buffer {
  int dummy;
};

/* Variables and functions */
void *ensure_buffer(struct matlab_buffer *, size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void write_buffer(struct matlab_buffer *buffer, void *data, size_t size) {
  void *target = ensure_buffer(buffer, size);
  memcpy(target, data, size);
}


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

x86 assembly (clang, -O2):
<write_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <ensure_buffer@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.matlab_buffer = type { i32 }
define void @write_buffer(%struct.matlab_buffer* %0, i8* %1, i64 %2) {
%4 = alloca %struct.matlab_buffer*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.matlab_buffer* %0, %struct.matlab_buffer** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.matlab_buffer*, %struct.matlab_buffer** %4
%9 = load i64, i64* %6
%10 = call i8* @ensure_buffer(%struct.matlab_buffer* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
%struct.matlab_buffer = type { i32 }
define void @write_buffer(%struct.matlab_buffer* %0, i8* %1, i64 %2) {
%4 = tail call i8* @ensure_buffer(%struct.matlab_buffer* %0, i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void nsleep(int64_t wait_ns) {
  struct timespec tp;
  int rc;
  tp.tv_sec = wait_ns / 1000000000;
  tp.tv_nsec = wait_ns % 1000000000;
  nanosleep(&tp, NULL);
  assert(rc == 0);
}


x86 assembly (clang, -O0):
<nsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsleep>:
push   %rax
movslq %edi,%rax
imul   $0x44b82fa1,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x3c,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3b9aca00,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @nsleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @nsleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
%9 = call i32 @assert(i32 0)
ret void
}
void isr_int_GPF(long error_code) {}


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

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

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

LLVM IR (-O2):
define void @isr_int_GPF(i64 %0) {
ret void
}
int test_imm_0Duint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x0D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Duint64_highword_reg>:
movabs $0xd00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Duint64_highword_reg(i64 %0) {
%2 = and i64 %0, 55834574848
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
const char *scamper_do_ping_usage(void) {
  return "ping [-R] [-B payload] [-c count] [-C icmp-sum] [-d dport]\n"
         "     [-F sport] [-i wait-probe] [-m ttl] [-M pmtu]\n"
         "     [-o reply-count] [-O option] [-p pattern] [-P method]\n"
         "     [-U userid] [-s probe-size] [-S srcaddr]\n"
         "     [-T timestamp-option] [-W timeout] [-z tos]";
}


x86 assembly (clang, -O0):
<scamper_do_ping_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scamper_do_ping_usage>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [264 x i8] c"ping [-R] [-B payload] [-c count] [-C icmp-sum] [-d dport]\0A [-F sport] [-i wait-probe] [-m ttl] [-M pmtu]\0A [-o reply-count] [-O option] [-p pattern] [-P method]\0A [-U userid] [-s probe-size] [-S srcaddr]\0A [-T timestamp-option] [-W timeout] [-z tos]\00"
define i8* @scamper_do_ping_usage() {
ret i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [264 x i8] c"ping [-R] [-B payload] [-c count] [-C icmp-sum] [-d dport]\0A [-F sport] [-i wait-probe] [-m ttl] [-M pmtu]\0A [-o reply-count] [-O option] [-p pattern] [-P method]\0A [-U userid] [-s probe-size] [-S srcaddr]\0A [-T timestamp-option] [-W timeout] [-z tos]\00"
define i8* @scamper_do_ping_usage() {
ret i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0)
}