xunge/DecIR huggingface dataset:
/* Variables and functions */
char SPIC_Read(int);
void SPIC_Read_Bytes(char *buffer, unsigned NoBytes) {
  int i;
  for (i = 0; i < NoBytes; i++)
    buffer[i] = SPIC_Read(0xFF);
}


x86 assembly (clang, -O0):
<SPIC_Read_Bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1157 <SPIC_Read_Bytes+0x47>
mov    $0xff,%edi
call   1030 <SPIC_Read@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <SPIC_Read_Bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIC_Read_Bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <SPIC_Read_Bytes+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xff,%edi
call   1030 <SPIC_Read@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SPIC_Read_Bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SPIC_Read_Bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call signext i8 @SPIC_Read(i32 255)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %8, i8* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_banner() {
  printf("mtcmcutool: a tool to manipulate MTC MCU firmware images for "
         "RK3066/RK3188 headunits.\n");
  printf("            Version: 1.1\n");
  printf("            Copyright (c) 2015, Dark Simpson\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<print_banner>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xf22(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2f(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"mtcmcutool: a tool to manipulate MTC MCU firmware images for RK3066/RK3188 headunits.\0A\00"
@.str.1 = [26 x i8] c" Version: 1.1\0A\00"
@.str.2 = [46 x i8] c" Copyright (c) 2015, Dark Simpson\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @print_banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [86 x i8] c"mtcmcutool: a tool to manipulate MTC MCU firmware images for RK3066/RK3188 headunits.\00"
@str.4 = [25 x i8] c" Version: 1.1\00"
@str.5 = [45 x i8] c" Copyright (c) 2015, Dark Simpson\00"
define void @print_banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int truncate(char const *, long);
int Truncate(const char *file, long size) { return truncate(file, size); }


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

x86 assembly (clang, -O2):
<Truncate>:
jmp    1030 <truncate@plt>

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

LLVM IR (-O2):
define i32 @Truncate(i8* %0, i64 %1) {
%3 = tail call i32 @truncate(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ calcola_mcd_mcm(int, int);
int inputint(char *);
int main() {
  int a, b;
  a = inputint("un numero");
  b = inputint("un altro numero");
  calcola_mcd_mcm(a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <inputint@plt>
mov    %eax,-0x4(%rbp)
lea    0xecc(%rip),%rdi
call   1030 <inputint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calcola_mcd_mcm@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <inputint@plt>
mov    %eax,%ebx
lea    0xed4(%rip),%rdi
call   1030 <inputint@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <calcola_mcd_mcm@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"un numero\00"
@.str.1 = [16 x i8] c"un altro numero\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @inputint(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = call i32 @inputint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @calcola_mcd_mcm(i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"un numero\00"
@.str.1 = [16 x i8] c"un altro numero\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @inputint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @calcola_mcd_mcm(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
const char *gai_strerror(int code) {
  static char buffer[128];
  snprintf(buffer, sizeof buffer, "Unknown error (%d)", code);
  return buffer;
}


x86 assembly (clang, -O0):
<gai_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x80,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gai_strerror>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gai_strerror.buffer = internal global [128 x i8] zeroinitializer
@.str = [19 x i8] c"Unknown error (%d)\00"
define i8* @gai_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gai_strerror.buffer, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gai_strerror.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@gai_strerror.buffer = internal global [128 x i8] zeroinitializer
@.str = [19 x i8] c"Unknown error (%d)\00"
define i8* @gai_strerror(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gai_strerror.buffer, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @gai_strerror.buffer, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printContents(void) {
  printf(
      "WELCOME TO THE LIST WORLD Presented by SHI\nWhat's your instruction?\n");
  printf("1---Creat a FIFOList,then print it.\n");
  printf("2---Creat a FILOList,then print it.\n");
  printf("3---Insert your char_x into the position P,then print it.\n");
}


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

x86 assembly (clang, -O2):
<printContents>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [69 x i8] c"WELCOME TO THE LIST WORLD Presented by SHI\0AWhat's your instruction?\0A\00"
@.str.1 = [37 x i8] c"1---Creat a FIFOList,then print it.\0A\00"
@.str.2 = [37 x i8] c"2---Creat a FILOList,then print it.\0A\00"
@.str.3 = [59 x i8] c"3---Insert your char_x into the position P,then print it.\0A\00"
define void @printContents() {
%1 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [68 x i8] c"WELCOME TO THE LIST WORLD Presented by SHI\0AWhat's your instruction?\00"
@str.4 = [36 x i8] c"1---Creat a FIFOList,then print it.\00"
@str.5 = [36 x i8] c"2---Creat a FILOList,then print it.\00"
@str.6 = [58 x i8] c"3---Insert your char_x into the position P,then print it.\00"
define void @printContents() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int print_insn_powerpc(unsigned long insn, unsigned long memaddr) {
  printf("%.8x", insn);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_insn_powerpc>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.8x\00"
define i32 @print_insn_powerpc(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 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @g_io_channel_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cfg_get_strg(char *, char *);
int cfg_get_flag(char *image, char *item) {
  return !!cfg_get_strg(image, item);
}


x86 assembly (clang, -O0):
<cfg_get_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cfg_get_strg@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_flag>:
push   %rax
call   1030 <cfg_get_strg@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cfg_get_flag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @cfg_get_strg(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @cfg_get_flag(i8* %0, i8* %1) {
%3 = tail call i32 @cfg_get_strg(i8* %0, i8* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ is_screensaver_active();
int /*<<< orphan*/ screensaver_off();
void key5_event() {
  if (is_screensaver_active()) {
    screensaver_off();
    return;
  }
  screensaver_off();
}


x86 assembly (clang, -O0):
<key5_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_screensaver_active@plt>
cmp    $0x0,%rax
je     1141 <key5_event+0x21>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
jmp    1148 <key5_event+0x28>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @key5_event() {
%1 = call i64 (...) @is_screensaver_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @screensaver_off()
br label %7
5: ; preds = %0
%6 = call i32 (...) @screensaver_off()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @key5_event() {
%1 = tail call i64 (...) @is_screensaver_active()
%2 = tail call i32 (...) @screensaver_off()
ret void
}
int rt_par_finish(void) {
  int a = 0;
  return a;
}


x86 assembly (clang, -O0):
<rt_par_finish>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rt_par_finish() {
ret i32 0
}
const char *est_get_version(void) { return "0.0.0"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.0.0\00"
define i8* @est_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.0.0\00"
define i8* @est_get_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ ExecCfg(char *, int);
void NETabout() { ExecCfg("about", 1); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"about\00"
define void @NETabout() {
%1 = tail call i32 @ExecCfg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ line();
int /*<<< orphan*/ logtype(char const *);
int /*<<< orphan*/ name(char const *);
int /*<<< orphan*/ space();
int /*<<< orphan*/ string(char *);
void log_cachedanswer(const char *q, const char type[2]) {
  string("     cc ");
  logtype(type);
  space();
  name(q);
  line();
}


x86 assembly (clang, -O0):
<log_cachedanswer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe99(%rip),%rdi
call   1040 <string@plt>
mov    -0x10(%rbp),%rdi
call   1060 <logtype@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x8(%rbp),%rdi
call   1050 <name@plt>
mov    $0x0,%al
call   1070 <line@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_cachedanswer>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe9f(%rip),%rdi
call   1040 <string@plt>
mov    %rbx,%rdi
call   1060 <logtype@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r14,%rdi
call   1050 <name@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <line@plt>

LLVM IR (-O0):
@.str = [9 x i8] c" cc \00"
define void @log_cachedanswer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = call i32 @logtype(i8* %6)
%8 = call i32 (...) @space()
%9 = load i8*, i8** %3
%10 = call i32 @name(i8* %9)
%11 = call i32 (...) @line()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" cc \00"
define void @log_cachedanswer(i8* %0, i8* %1) {
%3 = tail call i32 @string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @logtype(i8* %1)
%5 = tail call i32 (...) @space()
%6 = tail call i32 @name(i8* %0)
%7 = tail call i32 (...) @line()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void write_mem(void *addr, uint32_t value, uint32_t size) {
  int i;
  uint8_t *addr8 = addr;
  uint16_t *addr16 = addr;
  uint32_t *addr32 = addr;
  switch (size) {
  case 1:
    *addr8 = value;
    break;
  case 2:
    *addr16 = value;
    break;
  case 4:
    *addr32 = value;
    break;
  }
}


x86 assembly (clang, -O0):
<write_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x1,%eax
je     115c <write_mem+0x5c>
jmp    113a <write_mem+0x3a>
mov    -0x34(%rbp),%eax
sub    $0x2,%eax
je     116a <write_mem+0x6a>
jmp    114b <write_mem+0x4b>
mov    -0x34(%rbp),%eax
sub    $0x4,%eax
je     1178 <write_mem+0x78>
jmp    1181 <write_mem+0x81>
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1181 <write_mem+0x81>
mov    -0xc(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    1181 <write_mem+0x81>
mov    -0xc(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_mem>:
cmp    $0x4,%edx
ja     1111 <write_mem+0x11>
mov    $0x16,%eax
bt     %edx,%eax
jae    1111 <write_mem+0x11>
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_mem(i8* nocapture writeonly %0, i32 %1, i32 %2) {
switch i32 %2, label %6 [
i32 1, label %4
i32 2, label %4
i32 4, label %4
]
4: ; preds = %3, %3, %3
%5 = bitcast i8* %0 to i32*
store i32 %1, i32* %5
br label %6
6: ; preds = %4, %3
ret void
}
int maxPossibleErrorLevel(int remain) {
  int level = 8;
  int size = 512;
  while (level > 0) {
    if (remain >= size)
      return level;
    --level;
    size >>= 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<maxPossibleErrorLevel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x200,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114d <maxPossibleErrorLevel+0x4d>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1136 <maxPossibleErrorLevel+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <maxPossibleErrorLevel+0x54>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <maxPossibleErrorLevel+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxPossibleErrorLevel>:
mov    $0x8,%eax
cmp    $0x1ff,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x7,%eax
cmp    $0xff,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x6,%eax
cmp    $0x7f,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x5,%eax
cmp    $0x3f,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x4,%eax
cmp    $0x1f,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x3,%eax
cmp    $0xf,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
mov    $0x2,%eax
cmp    $0x7,%edi
jg     1154 <maxPossibleErrorLevel+0x54>
xor    %eax,%eax
cmp    $0x4,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @maxPossibleErrorLevel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 8, i32* %4
store i32 512, i32* %5
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = icmp sge i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %21
15: ; preds = %9
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
%18 = load i32, i32* %5
%19 = ashr i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
store i32 0, i32* %2
br label %21
21: ; preds = %20, %13
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @maxPossibleErrorLevel(i32 %0) {
%2 = icmp slt i32 %0, 512
br i1 %2, label %3, label %18
3: ; preds = %1
%4 = icmp slt i32 %0, 256
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = icmp slt i32 %0, 128
br i1 %6, label %7, label %18
7: ; preds = %5
%8 = icmp slt i32 %0, 64
br i1 %8, label %9, label %18
9: ; preds = %7
%10 = icmp slt i32 %0, 32
br i1 %10, label %11, label %18
11: ; preds = %9
%12 = icmp slt i32 %0, 16
br i1 %12, label %13, label %18
13: ; preds = %11
%14 = icmp slt i32 %0, 8
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = icmp sgt i32 %0, 3
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %15, %13, %11, %9, %7, %5, %3, %1
%19 = phi i32 [ 8, %1 ], [ 7, %3 ], [ 6, %5 ], [ 5, %7 ], [ 4, %9 ], [ 3, %11 ], [ 2, %13 ], [ %17, %15 ]
ret i32 %19
}
const char *zError(int err) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @zError(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void write_syslog(char *str) { syslog(LOG_INFO, str); }


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

x86 assembly (clang, -O2):
<write_syslog>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
define void @write_syslog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
define void @write_syslog(i8* %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* %0)
ret void
}
float min(float x, float y) {
  if (x < y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wgout() {
  printf("\n Sorry, you may get the gaussian output by running a Gaussian "
         "program (g98, g03, etc.)");
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"\0A Sorry, you may get the gaussian output by running a Gaussian program (g98, g03, etc.)\00"
define void @wgout() {
%1 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [88 x i8] c"\0A Sorry, you may get the gaussian output by running a Gaussian program (g98, g03, etc.)\00"
define void @wgout() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void move_cursor(uint8_t row, uint8_t col) {
  uint16_t tmp;
  tmp = row * 80 + col;
  outb(0x3D4, 14);
  outb(0x3D5, tmp >> 8);
  outb(0x3D4, 15);
  outb(0x3D5, tmp);
}


x86 assembly (clang, -O0):
<move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    -0xc(%rbp),%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_cursor>:
push   %rbx
mov    %esi,%ebx
lea    (%rdi,%rdi,4),%eax
shl    $0x4,%eax
add    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    %ebx,%esi
sar    $0x8,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = call i32 @outb(i32 980, i32 14)
%11 = load i32, i32* %5
%12 = ashr i32 %11, 8
%13 = call i32 @outb(i32 981, i32 %12)
%14 = call i32 @outb(i32 980, i32 15)
%15 = load i32, i32* %5
%16 = call i32 @outb(i32 981, i32 %15)
ret void
}

LLVM IR (-O2):
define void @move_cursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 80
%4 = add nsw i32 %3, %1
%5 = tail call i32 @outb(i32 980, i32 14)
%6 = ashr i32 %4, 8
%7 = tail call i32 @outb(i32 981, i32 %6)
%8 = tail call i32 @outb(i32 980, i32 15)
%9 = tail call i32 @outb(i32 981, i32 %4)
ret void
}
int two() { return 12; }


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @two() {
ret i32 12
}

LLVM IR (-O2):
define i32 @two() {
ret i32 12
}
float simple_floor(const float x) { return ((int)x); }


x86 assembly (clang, -O0):
<simple_floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_floor>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @simple_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @simple_floor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
unsigned long HTS_srnd(unsigned long seed) { return (seed); }


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

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

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

LLVM IR (-O2):
define i64 @HTS_srnd(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int alphasort(const struct dirent **a, const struct dirent **b) {
  return (strcmp((*a)->d_name, (*b)->d_name));
}


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

x86 assembly (clang, -O2):
<alphasort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
int fib(int n) {
  if (n < 2)
    return n;
  else
    return (fib(n - 1) + fib(n - 2));
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
void foo435() {}


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

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

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

LLVM IR (-O2):
define void @foo435() {
ret void
}
/* Variables and functions */
size_t string_hash(const char *str) {
  size_t hash = 5381;
  for (size_t i = 0; str[i] != '\0'; i++) {
    hash = ((hash << 5) + hash) ^ str[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115e <string_hash+0x5e>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <string_hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i64 [ 5381, %1 ], [ %12, %6 ]
ret i64 %5
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %2, %1 ]
%8 = phi i64 [ %13, %6 ], [ 0, %1 ]
%9 = phi i64 [ %12, %6 ], [ 5381, %1 ]
%10 = mul i64 %9, 33
%11 = sext i8 %7 to i64
%12 = xor i64 %10, %11
%13 = add i64 %8, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %4, label %6
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRDF_get(void) { return U_WMRCORENONE_get("U_WMRDF"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRDF\00"
define i32 @U_WMRDF_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
struct task_struct *get_current(void) {
  struct task_struct *current;
  return current;
}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define %struct.task_struct* @get_current() {
%1 = alloca %struct.task_struct*
%2 = load %struct.task_struct*, %struct.task_struct** %1
ret %struct.task_struct* %2
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define noalias %struct.task_struct* @get_current() {
ret %struct.task_struct* undef
}
int ishex(char c) {
  if ('0' <= c && c <= '9')
    return 1;
  if ('a' <= c && c <= 'f')
    return 1;
  if ('A' <= c && c <= 'F')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1134 <ishex+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1134 <ishex+0x34>
movl   $0x1,-0x4(%rbp)
jmp    118f <ishex+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     115e <ishex+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     115e <ishex+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    118f <ishex+0x8f>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1188 <ishex+0x88>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1188 <ishex+0x88>
movl   $0x1,-0x4(%rbp)
jmp    118f <ishex+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 48, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 97, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 102
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 65, %23
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 70
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %31
30: ; preds = %25, %21
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ GLimp_Shutdown();
int /*<<< orphan*/ OpenGL_Shutdown();
int /*<<< orphan*/ TM_Shutdown();
void R_Shutdown(void) {
  TM_Shutdown();
  GLimp_Shutdown();
  OpenGL_Shutdown();
}


x86 assembly (clang, -O0):
<R_Shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <TM_Shutdown@plt>
mov    $0x0,%al
call   1040 <GLimp_Shutdown@plt>
mov    $0x0,%al
call   1030 <OpenGL_Shutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_Shutdown>:
push   %rax
xor    %eax,%eax
call   1050 <TM_Shutdown@plt>
xor    %eax,%eax
call   1040 <GLimp_Shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <OpenGL_Shutdown@plt>

LLVM IR (-O0):
define void @R_Shutdown() {
%1 = call i32 (...) @TM_Shutdown()
%2 = call i32 (...) @GLimp_Shutdown()
%3 = call i32 (...) @OpenGL_Shutdown()
ret void
}

LLVM IR (-O2):
define void @R_Shutdown() {
%1 = tail call i32 (...) @TM_Shutdown()
%2 = tail call i32 (...) @GLimp_Shutdown()
%3 = tail call i32 (...) @OpenGL_Shutdown()
ret void
}
short getshort(short x) {
  char *p1, *p2;
  short y;
  p1 = (char *)(&x);
  p2 = (char *)(&y);
  p2[1] = p1[0];
  p2[0] = p1[1];
  return (y);
}


x86 assembly (clang, -O0):
<getshort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1a(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movswl -0x1a(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @getshort(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
store i16 %0, i16* %2
%6 = bitcast i16* %2 to i8*
store i8* %6, i8** %3
%7 = bitcast i16* %5 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
%18 = load i16, i16* %5
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @getshort(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
void qux(void) {}


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

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

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

LLVM IR (-O2):
define void @qux() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP400_InitializeRhoOffsets();
int /*<<< orphan*/ KeccakP400_InitializeRoundConstants();
void KeccakP400_StaticInitialize() {
  KeccakP400_InitializeRoundConstants();
  KeccakP400_InitializeRhoOffsets();
}


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

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

LLVM IR (-O0):
define void @KeccakP400_StaticInitialize() {
%1 = call i32 (...) @KeccakP400_InitializeRoundConstants()
%2 = call i32 (...) @KeccakP400_InitializeRhoOffsets()
ret void
}

LLVM IR (-O2):
define void @KeccakP400_StaticInitialize() {
%1 = tail call i32 (...) @KeccakP400_InitializeRoundConstants()
%2 = tail call i32 (...) @KeccakP400_InitializeRhoOffsets()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: replay [-h][-vrc] filename\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: replay [-h][-vrc] filename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: replay [-h][-vrc] filename\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ color_uncolored_(struct graph *, int /*<<< orphan*/);
void color_uncolored(struct graph *g) { assert(color_uncolored_(g, 0)); }


x86 assembly (clang, -O0):
<color_uncolored>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <color_uncolored_@plt>
mov    %eax,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_uncolored>:
push   %rax
xor    %esi,%esi
call   1040 <color_uncolored_@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.graph = type { i32 }
define void @color_uncolored(%struct.graph* %0) {
%2 = alloca %struct.graph*
store %struct.graph* %0, %struct.graph** %2
%3 = load %struct.graph*, %struct.graph** %2
%4 = call i32 @color_uncolored_(%struct.graph* %3, i32 0)
%5 = call i32 @assert(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.graph = type { i32 }
define void @color_uncolored(%struct.graph* %0) {
%2 = tail call i32 @color_uncolored_(%struct.graph* %0, i32 0)
%3 = tail call i32 @assert(i32 %2)
ret void
}