xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errmsg(int, int /*<<< orphan*/, int, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *ret = strdup(str);
  if (!ret && str)
    errmsg(1, EXIT_FAILURE, 1, "cannot duplicate string");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <xstrdup+0x4b>
cmpq   $0x0,-0x8(%rbp)
je     116b <xstrdup+0x4b>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
lea    0xe9c(%rip),%rcx
mov    %edx,%edi
call   1030 <errmsg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strdup@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1158 <xstrdup+0x38>
test   %r14,%r14
jne    1158 <xstrdup+0x38>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rcx
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <errmsg@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"cannot duplicate string\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @errmsg(i32 1, i32 %12, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %8, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"cannot duplicate string\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @errmsg(i32 1, i32 %7, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int /*<<< orphan*/ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
__s32 i2c_smbus_write_byte(int file, __u8 value) {
  return i2c_smbus_access(file, I2C_SMBUS_WRITE, value, I2C_SMBUS_BYTE, 0);
}


x86 assembly (clang, -O0):
<i2c_smbus_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_write_byte>:
mov    %esi,%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
xor    %r8d,%r8d
jmp    1030 <i2c_smbus_access@plt>

LLVM IR (-O0):
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_write_byte(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* @I2C_SMBUS_WRITE
%7 = load i32, i32* %4
%8 = load i32, i32* @I2C_SMBUS_BYTE
%9 = call i32 @i2c_smbus_access(i32 %5, i32 %6, i32 %7, i32 %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_write_byte(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SMBUS_WRITE
%4 = load i32, i32* @I2C_SMBUS_BYTE
%5 = tail call i32 @i2c_smbus_access(i32 %0, i32 %3, i32 %1, i32 %4, i32 0)
ret i32 %5
}
void row_prt_allcols(char *rp, int minlen) {
  int rlen;
  rlen = (((*(int *)((rp) + 8)) == 0) ? (minlen)
                                      : (*(int *)((char *)(rp) + (minlen))));
}


x86 assembly (clang, -O0):
<row_prt_allcols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jne    1124 <row_prt_allcols+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <row_prt_allcols+0x32>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @row_prt_allcols(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %20
13: ; preds = %2
%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 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
br label %20
20: ; preds = %13, %11
%21 = phi i32 [ %12, %11 ], [ %19, %13 ]
store i32 %21, i32* %5
ret void
}

LLVM IR (-O2):
define void @row_prt_allcols(i8* nocapture %0, i32 %1) {
ret void
}
int is_uksm_zero_pfn(unsigned long pfn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_uksm_zero_pfn(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_print_line() {
  printf("------------------------------------------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"------------------------------------------------------------\0A\00"
define void @help_print_line() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"------------------------------------------------------------\00"
define void @help_print_line() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void lrawkbd_QuitSignals(void) {
  signal(SIGUSR1, SIG_DFL);
  signal(SIGUSR2, SIG_DFL);
}


x86 assembly (clang, -O0):
<lrawkbd_QuitSignals>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrawkbd_QuitSignals>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
@SIG_DFL = global i32 0
@SIGUSR2 = global i32 0
define void @lrawkbd_QuitSignals() {
%1 = load i32, i32* @SIGUSR1
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGUSR2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
@SIG_DFL = global i32 0
@SIGUSR2 = global i32 0
define void @lrawkbd_QuitSignals() {
%1 = load i32, i32* @SIGUSR1
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGUSR2
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void putString(const char *s) { printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @putString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t forwardf32_t(uint32_t number) {
  if (number >> 31)
    return number ^ 0xffffffff;
  return number ^ 0x80000000;
}


x86 assembly (clang, -O0):
<forwardf32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
je     1124 <forwardf32_t+0x24>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <forwardf32_t+0x2f>
mov    -0x8(%rbp),%eax
xor    $0x80000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<forwardf32_t>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x80000000,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @forwardf32_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 31
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = xor i32 %11, -2147483648
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @forwardf32_t(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 -2147483648, i32 -1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_euc_jisx0213();
int /*<<< orphan*/ test_tscii();
int main(void) {
  test_euc_jisx0213();
  test_tscii();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_euc_jisx0213()
%2 = tail call i32 (...) @test_tscii()
ret i32 0
}
void *lib_externaldeclchook_copy(void *chook) { return chook; }


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

x86 assembly (clang, -O2):
<lib_externaldeclchook_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @lib_externaldeclchook_copy(i8* readnone returned %0) {
ret i8* %0
}
int Cyc_PP_max(int x, int y) {
  if (x >= y)
    return x;
  else {
    return y;
  }
}


x86 assembly (clang, -O0):
<Cyc_PP_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <Cyc_PP_max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Cyc_PP_max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_PP_max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_PP_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Cyc_PP_max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void sndfile_drop(struct codec *c) {}


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

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

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

LLVM IR (-O2):
%struct.codec = type opaque
define void @sndfile_drop(%struct.codec* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_getc();
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
int /*<<< orphan*/ uart_puts(char *);
void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) {
  (void)r0;
  (void)r1;
  (void)atags;
  uart_init();
  uart_puts("Hello, kernel World!\r\n");
  while (true)
    uart_putc(uart_getc());
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <uart_init@plt>
lea    0xea1(%rip),%rdi
call   1060 <uart_puts@plt>
mov    $0x0,%al
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1164 <kernel_main+0x24>

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <uart_init@plt>
lea    0xeb1(%rip),%rdi
call   1060 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1160 <kernel_main+0x20>

LLVM IR (-O0):
@.str = [23 x i8] c"Hello, kernel World!\0D\0A\00"
define void @kernel_main(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 = call i32 (...) @uart_init()
%11 = call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %3, %12
%13 = call i32 (...) @uart_getc()
%14 = call i32 @uart_putc(i32 %13)
br label %12
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello, kernel World!\0D\0A\00"
define void @kernel_main(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @uart_init()
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %6
%7 = tail call i32 (...) @uart_getc()
%8 = tail call i32 @uart_putc(i32 %7)
br label %6
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] + 146565199UL) + 2631654602UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jae    1165 <RandomFunc+0x65>
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1154 <RandomFunc+0x54>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1138 <RandomFunc+0x38>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
add    $0x8bc684f,%rcx
movabs $0x9cdbdcca,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xa4fe505e,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, -10089659
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %7
br label %13
13: ; preds = %23, %2
%14 = load i64, i64* %7
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %26
16: ; preds = %13
store i64 0, i64* %6
br label %17
17: ; preds = %20, %16
%18 = load i64, i64* %6
%19 = icmp ult i64 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i64, i64* %6
%22 = add i64 %21, 2
store i64 %22, i64* %6
br label %17
23: ; preds = %17
%24 = load i64, i64* %7
%25 = add i64 %24, 2
store i64 %25, i64* %7
br label %13
26: ; preds = %13
%27 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%28 = load i64, i64* %27
%29 = add i64 %28, 146565199
%30 = add i64 %29, 2631654602
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 2768130142
store i64 %4, i64* %1
ret void
}
int _cint(f)
double f;
{
  int r;
  if (f < -32768 || f > 32767)
    error(4);
  if (f < 0)
    r = f - 0.5;
  else
    r = f + 0.5;
  return (r);
}


x86 assembly (clang, -O0):
<_cint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
ja     1147 <_cint+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <_cint+0x43>
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <error@plt>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    117e <_cint+0x6e>
movsd  -0x8(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    1192 <_cint+0x82>
movsd  0xe8a(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cint>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1129 <_cint+0x19>
ucomisd 0xee1(%rip),%xmm0
jbe    113f <_cint+0x2f>
mov    $0x4,%edi
xor    %eax,%eax
movsd  %xmm0,(%rsp)
call   1030 <error@plt>
movsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xebd(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_cint(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, -3.276800e+04
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 3.276700e+04
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 4)
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load double, double* %2
%16 = fsub double %15, 5.000000e-01
%17 = fptosi double %16 to i32
store i32 %17, i32* %3
br label %22
18: ; preds = %11
%19 = load double, double* %2
%20 = fadd double %19, 5.000000e-01
%21 = fptosi double %20 to i32
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @_cint(double %0) {
%2 = fcmp olt double %0, -3.276800e+04
%3 = fcmp ogt double %0, 3.276700e+04
%4 = or i1 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 4)
br label %7
7: ; preds = %1, %5
%8 = fcmp olt double %0, 0.000000e+00
%9 = select i1 %8, double -5.000000e-01, double 5.000000e-01
%10 = fadd double %9, %0
%11 = fptosi double %10 to i32
ret i32 %11
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_clock_scale(void) {
  return i2c_read_reg(0) | (i2c_read_reg(1) << 8);
}


x86 assembly (clang, -O0):
<i2c_read_clock_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <i2c_read_reg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <i2c_read_reg@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read_clock_scale>:
push   %rbx
xor    %edi,%edi
call   1030 <i2c_read_reg@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <i2c_read_reg@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @i2c_read_clock_scale() {
%1 = call i32 @i2c_read_reg(i32 0)
%2 = call i32 @i2c_read_reg(i32 1)
%3 = shl i32 %2, 8
%4 = or i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @i2c_read_clock_scale() {
%1 = tail call i32 @i2c_read_reg(i32 0)
%2 = tail call i32 @i2c_read_reg(i32 1)
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int, int);
int main() {
  int i, j, k;
  i = 1;
  j = 2;
  k = foo(i, j);
  assert(k == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @foo(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
void f(double *ty) { *ty = -1.0; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movabs $0xbff0000000000000,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @f(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
store double -1.000000e+00, double* %3
ret void
}

LLVM IR (-O2):
define void @f(double* nocapture writeonly %0) {
store double -1.000000e+00, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ili9341_WriteReg(int);
void ili9341_DisplayOff(void) { ili9341_WriteReg(0x28); }


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

x86 assembly (clang, -O2):
<ili9341_DisplayOff>:
mov    $0x28,%edi
jmp    1030 <ili9341_WriteReg@plt>

LLVM IR (-O0):
define void @ili9341_DisplayOff() {
%1 = call i32 @ili9341_WriteReg(i32 40)
ret void
}

LLVM IR (-O2):
define void @ili9341_DisplayOff() {
%1 = tail call i32 @ili9341_WriteReg(i32 40)
ret void
}
/* Variables and functions */
int recv(int, char *, int, int);
int my_recv(int socket, char *buffer, int max_size, int flags) {
  return recv(socket, buffer, max_size, flags);
}


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

x86 assembly (clang, -O2):
<my_recv>:
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @my_recv(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
float fabsf(float x) { return __builtin_fabsf(x); }


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fabs.f32(float %3)
ret float %4
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ omp_nest_lock_t;

/* Variables and functions */
void omp_unset_nest_lock(omp_nest_lock_t *_Lock) {}


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

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

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

LLVM IR (-O2):
define void @omp_unset_nest_lock(i32* nocapture %0) {
ret void
}
void av_dovi_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_dovi_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pdfconv(double *, int, double *, int, double *);
void pdfconv_R_wrapper(double *x, int *xlen, double *y, int *ylen,
                       double *result) {
  pdfconv(x, *xlen, y, *ylen, result);
}


x86 assembly (clang, -O0):
<pdfconv_R_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%r8
call   1030 <pdfconv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdfconv_R_wrapper>:
mov    (%rsi),%esi
mov    (%rcx),%ecx
jmp    1030 <pdfconv@plt>

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

LLVM IR (-O2):
define void @pdfconv_R_wrapper(double* %0, i32* nocapture %1, double* %2, i32* nocapture %3, double* %4) {
%6 = load i32, i32* %1
%7 = load i32, i32* %3
%8 = tail call i32 @pdfconv(double* %0, i32 %6, double* %2, i32 %7, double* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int _syscall(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
int kill(pid_t pid, int signum) { return _syscall(37, pid, signum, 0); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x25,%edi
xor    %ecx,%ecx
call   1030 <_syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x25,%edi
xor    %ecx,%ecx
jmp    1030 <_syscall@plt>

LLVM IR (-O0):
define i32 @kill(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 37, i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @_syscall(i32 37, i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_16x8(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                           int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 8,
                       i_weight1);
}


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

x86 assembly (clang, -O2):
<pixel_avg_weight_16x8>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pixel_avg_weight_16x8(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
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
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @pixel_avg_weight_wxh(i32* %11, i32 %12, i32* %13, i32 %14, i32 16, i32 8, i32 %15)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_weight_16x8(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 16, i32 8, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsscanf(const char *s, const char *format, va_list ap) {}


x86 assembly (clang, -O0):
<vsscanf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vsscanf(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 undef
}
void refrigerator(void) {}


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

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

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

LLVM IR (-O2):
define void @refrigerator() {
ret void
}
/* Variables and functions */
int serial_write(char *, int);
int serial_write_hbmsg(void) { return serial_write("abc", sizeof("abc")); }


x86 assembly (clang, -O0):
<serial_write_hbmsg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <serial_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_hbmsg>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <serial_write@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
define i32 @serial_write_hbmsg() {
%1 = call i32 @serial_write(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @serial_write_hbmsg() {
%1 = tail call i32 @serial_write(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 %1
}
char *GetRelease(void) {
  static char AutoRelease[] = "$Release:dev_1.0$";
  AutoRelease[sizeof(AutoRelease) - 2] = 0;
  return &AutoRelease[9];
}


x86 assembly (clang, -O0):
<GetRelease>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,0x2f35(%rip)
lea    0x2f1e(%rip),%rax
add    $0x9,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRelease>:
movb   $0x0,0x2f39(%rip)
lea    0x2f2b(%rip),%rax
ret

LLVM IR (-O0):
@GetRelease.AutoRelease = internal global [18 x i8] c"$Release:dev_1.0$\00"
define i8* @GetRelease() {
store i8 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @GetRelease.AutoRelease, i64 0, i64 16)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @GetRelease.AutoRelease, i64 0, i64 9)
}

LLVM IR (-O2):
@GetRelease.AutoRelease = internal global [18 x i8] c"$Release:dev_1.0$\00"
define i8* @GetRelease() {
store i8 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @GetRelease.AutoRelease, i64 0, i64 16)
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @GetRelease.AutoRelease, i64 0, i64 9)
}
int f(int a, int b, int c) {
  int sum = 0;
  sum = a + b + c;
  if (sum < a * b) {
    return a + b;
  }
  if (sum == a * b) {
    return b + c;
  }
  return a + c;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1140 <f+0x40>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <f+0x69>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jne    1160 <f+0x60>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <f+0x69>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rsi,%rdi,1),%eax
lea    (%rax,%rdx,1),%r8d
mov    %esi,%ecx
imul   %edi,%ecx
cmp    %ecx,%r8d
jl     111b <f+0x1b>
jne    1117 <f+0x17>
add    %esi,%edx
jmp    1119 <f+0x19>
add    %edi,%edx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = mul nsw i32 %1, %0
%7 = icmp slt i32 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %3
%9 = icmp eq i32 %5, %6
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = add nsw i32 %2, %1
br label %14
12: ; preds = %8
%13 = add nsw i32 %2, %0
br label %14
14: ; preds = %3, %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ], [ %4, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ print_5(char);
void println_6(void) { print_5('\n'); }


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

x86 assembly (clang, -O2):
<println_6>:
mov    $0xa,%edi
jmp    1030 <print_5@plt>

LLVM IR (-O0):
define void @println_6() {
%1 = call i32 @print_5(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @println_6() {
%1 = tail call i32 @print_5(i8 signext 10)
ret void
}
/* Variables and functions */
float exp2f(float);
float __ocl_half_exp2_float(float src) { return exp2f(src); }


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

x86 assembly (clang, -O2):
<__ocl_half_exp2_float>:
jmp    1030 <exp2f@plt>

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

LLVM IR (-O2):
define float @__ocl_half_exp2_float(float %0) {
%2 = tail call float @exp2f(float %0)
ret float %2
}
/* Variables and functions */
int of_call_prom(char *, int, int, void const *, char const *, void *,
                 int const);
int of_getprop(const void *phandle, const char *name, void *buf,
               const int buflen) {
  return of_call_prom("getprop", 4, 1, phandle, name, buf, buflen);
}


x86 assembly (clang, -O0):
<of_getprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
lea    0xec3(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %eax,(%rsp)
call   1030 <of_call_prom@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_getprop>:
push   %rax
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rax
mov    %ecx,(%rsp)
lea    0xedc(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <of_call_prom@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"getprop\00"
define i32 @of_getprop(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @of_call_prom(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8* %9, i8* %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"getprop\00"
define i32 @of_getprop(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @of_call_prom(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 1, i8* %0, i8* %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("y\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"y\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@str = [2 x i8] c"y\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ os_error(char *);
void *get_mem(size_t n) {
  void *p;
  p = (void *)malloc(n);
  if (p == NULL)
    os_error("Memory allocation failed");
  return p;
}


x86 assembly (clang, -O0):
<get_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <get_mem+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <os_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <get_mem+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <os_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Memory allocation failed\00"
define i8* @get_mem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @os_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"Memory allocation failed\00"
define i8* @get_mem(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @os_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
int /*<<< orphan*/ Label_Printf(char *, char *, int);
void Dico_String(int str_no, char *asciiz) {
  Label_Printf("%s%d:", ".LC", str_no);
  Inst_Printf(".string", "%s", asciiz);
}


x86 assembly (clang, -O0):
<Dico_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1040 <Label_Printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_String>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xed3(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <Label_Printf@plt>
lea    0xeca(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s%d:\00"
@.str.1 = [4 x i8] c".LC\00"
@.str.2 = [8 x i8] c".string\00"
@.str.3 = [3 x i8] c"%s\00"
define void @Dico_String(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 = call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %4
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%d:\00"
@.str.1 = [4 x i8] c".LC\00"
@.str.2 = [8 x i8] c".string\00"
@.str.3 = [3 x i8] c"%s\00"
define void @Dico_String(i32 %0, i8* %1) {
%3 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %1)
ret void
}
int rshift_rnd_sf(int x, int a) { return ((x + (1 << (a - 1))) >> a); }


x86 assembly (clang, -O0):
<rshift_rnd_sf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rshift_rnd_sf>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %edi,%eax
mov    %esi,%ecx
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rshift_rnd_sf(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = shl nuw i32 1, %3
%5 = add nsw i32 %4, %0
%6 = ashr i32 %5, %1
ret i32 %6
}
void cleanup(void *arg) { *(int *)arg = 1; }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @cleanup(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 1, i32* %2
ret void
}
/* Type definitions */
struct Block_layout {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _Block_release(struct Block_layout *);
void _Block_destroy(const void *arg) {
  struct Block_layout *aBlock;
  if (!arg)
    return;
  aBlock = (struct Block_layout *)arg;
  _Block_release(aBlock);
}


x86 assembly (clang, -O0):
<_Block_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <_Block_destroy+0x1c>
jmp    113d <_Block_destroy+0x2d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_Block_release@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Block_destroy>:
test   %rdi,%rdi
je     111a <_Block_destroy+0xa>
jmp    1030 <_Block_release@plt>
ret

LLVM IR (-O0):
%struct.Block_layout = type { i32 }
define void @_Block_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.Block_layout*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to %struct.Block_layout*
store %struct.Block_layout* %9, %struct.Block_layout** %3
%10 = load %struct.Block_layout*, %struct.Block_layout** %3
%11 = call i32 @_Block_release(%struct.Block_layout* %10)
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.Block_layout = type { i32 }
define void @_Block_destroy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to %struct.Block_layout*
%5 = tail call i32 @_Block_release(%struct.Block_layout* %4)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void f2() {
  unsigned long index;
  printf("%d", index);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @f2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 undef)
ret void
}