xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void suggest_help(void) { fprintf(stderr, "sas: type `sas -h' for help\n"); }


x86 assembly (clang, -O0):
<suggest_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<suggest_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"sas: type `sas -h' for help\0A\00"
define void @suggest_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"sas: type `sas -h' for help\0A\00"
define void @suggest_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qprintf(char *, int);
int q__prop_request_change(int hex) {
  qprintf("*** "
          "_prop_request_change"
          "(%x)\n",
          hex);
  return 0;
}


x86 assembly (clang, -O0):
<q__prop_request_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q__prop_request_change>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <qprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"*** _prop_request_change(%x)\0A\00"
define i32 @q__prop_request_change(i32 %0) {
%2 = tail call i32 @qprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int my_strlen(char *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("The length of the string: %u\n", my_strlen("hello world", 11));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee8(%rip),%rdi
mov    $0xb,%esi
call   1030 <my_strlen@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef6(%rip),%rdi
mov    $0xb,%esi
call   1030 <my_strlen@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The length of the string: %u\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @my_strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The length of the string: %u\0A\00"
@.str.1 = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @my_strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vfc_call_stack_init();
int /*<<< orphan*/ vfc_func_table_init();
void vfc_init_func_inst() {
  vfc_call_stack_init();
  vfc_func_table_init();
}


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

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

LLVM IR (-O0):
define void @vfc_init_func_inst() {
%1 = call i32 (...) @vfc_call_stack_init()
%2 = call i32 (...) @vfc_func_table_init()
ret void
}

LLVM IR (-O2):
define void @vfc_init_func_inst() {
%1 = tail call i32 (...) @vfc_call_stack_init()
%2 = tail call i32 (...) @vfc_func_table_init()
ret void
}
/* Variables and functions */
double log(double);
double Logarithm(double n, double base) { return (log(n) / log(base)); }


x86 assembly (clang, -O0):
<Logarithm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Logarithm>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Logarithm(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @log(double %5)
%7 = load double, double* %4
%8 = call double @log(double %7)
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @Logarithm(double %0, double %1) {
%3 = tail call double @log(double %0)
%4 = tail call double @log(double %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Type definitions */
typedef union evf_err {
  int dummy;
} evf_err;
struct evf_filter {
  int dummy;
};

/* Variables and functions */
struct evf_filter *evf_load_profile(char *, int, union evf_err *);
struct evf_filter *evf_load_system_profile(int fd, union evf_err *err) {
  return evf_load_profile("/etc/evfilter/profile/", fd, err);
}


x86 assembly (clang, -O0):
<evf_load_system_profile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <evf_load_profile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evf_load_system_profile>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <evf_load_profile@plt>

LLVM IR (-O0):
%struct.evf_filter = type { i32 }
%union.evf_err = type { i32 }
@.str = [23 x i8] c"/etc/evfilter/profile/\00"
define %struct.evf_filter* @evf_load_system_profile(i32 %0, %union.evf_err* %1) {
%3 = alloca i32
%4 = alloca %union.evf_err*
store i32 %0, i32* %3
store %union.evf_err* %1, %union.evf_err** %4
%5 = load i32, i32* %3
%6 = load %union.evf_err*, %union.evf_err** %4
%7 = call %struct.evf_filter* @evf_load_profile(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, %union.evf_err* %6)
ret %struct.evf_filter* %7
}

LLVM IR (-O2):
%struct.evf_filter = type { i32 }
%union.evf_err = type { i32 }
@.str = [23 x i8] c"/etc/evfilter/profile/\00"
define %struct.evf_filter* @evf_load_system_profile(i32 %0, %union.evf_err* %1) {
%3 = tail call %struct.evf_filter* @evf_load_profile(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, %union.evf_err* %1)
ret %struct.evf_filter* %3
}
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *, char, char *);
int main(void) {
  myprintf("c\ts\n", '1', "hello");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x31,%esi
lea    0xed3(%rip),%rdx
call   1030 <myprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rdx
mov    $0x31,%esi
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"c\09s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @myprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"c\09s\0A\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @myprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 49, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int write_block(int, int, int, int /*<<< orphan*/);
int motor2(int direction, int speed) {
  return write_block(112, direction, speed, 0);
}


x86 assembly (clang, -O0):
<motor2>:
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    $0x70,%edi
xor    %ecx,%ecx
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @motor2(i32 %0, i32 %1) {
%3 = tail call i32 @write_block(i32 112, i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_monetary *_Locale_monetary_create(const char *name,
                                                 struct _Locale_name_hint *hint
                                                 __attribute__((__unused__)),
                                                 int *__err_code) {
  return (struct _Locale_monetary *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_monetary_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_monetary* @_Locale_monetary_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_monetary*
ret %struct._Locale_monetary* %10
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_monetary* @_Locale_monetary_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_monetary*
ret %struct._Locale_monetary* %5
}
/* Type definitions */
struct dbuf_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dbuf_detach(struct dbuf_s *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void dbuf_destroy(struct dbuf_s *dbuf) { free(dbuf_detach(dbuf)); }


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

x86 assembly (clang, -O2):
<dbuf_destroy>:
push   %rax
call   1040 <dbuf_detach@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dbuf_s = type { i32 }
define void @dbuf_destroy(%struct.dbuf_s* %0) {
%2 = alloca %struct.dbuf_s*
store %struct.dbuf_s* %0, %struct.dbuf_s** %2
%3 = load %struct.dbuf_s*, %struct.dbuf_s** %2
%4 = call i32 @dbuf_detach(%struct.dbuf_s* %3)
%5 = call i32 @free(i32 %4)
ret void
}

LLVM IR (-O2):
%struct.dbuf_s = type { i32 }
define void @dbuf_destroy(%struct.dbuf_s* %0) {
%2 = tail call i32 @dbuf_detach(%struct.dbuf_s* %0)
%3 = tail call i32 @free(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_get_current_dir();
int main() {
  test_get_current_dir();
  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_get_current_dir@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_get_current_dir@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_get_current_dir()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_get_current_dir()
ret i32 0
}
void pvm_before_ckpt(void) {}


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

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

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

LLVM IR (-O2):
define void @pvm_before_ckpt() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ slprintf(char *, int, char *, int);
const char *octal_string(int i) {
  static char ret[64];
  if (i == -1)
    return "-1";
  slprintf(ret, sizeof(ret) - 1, "0%o", i);
  return ret;
}


x86 assembly (clang, -O0):
<octal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1135 <octal_string+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <octal_string+0x4b>
mov    -0xc(%rbp),%ecx
lea    0x2f01(%rip),%rdi
mov    $0x3f,%esi
lea    0xeb8(%rip),%rdx
call   1030 <slprintf@plt>
lea    0x2ee9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octal_string>:
push   %rbx
cmp    $0xffffffff,%edi
je     1135 <octal_string+0x25>
mov    %edi,%ecx
lea    0x2f21(%rip),%rbx
lea    0xedd(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3f,%esi
call   1030 <slprintf@plt>
jmp    113c <octal_string+0x2c>
lea    0xec4(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@octal_string.ret = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"-1\00"
@.str.1 = [4 x i8] c"0%o\00"
define i8* @octal_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @slprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @octal_string.ret, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @octal_string.ret, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@octal_string.ret = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"-1\00"
@.str.1 = [4 x i8] c"0%o\00"
define i8* @octal_string(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @slprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @octal_string.ret, i64 0, i64 0), i32 63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ getelementptr inbounds ([64 x i8], [64 x i8]* @octal_string.ret, i64 0, i64 0), %3 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int checkFileExists(char *path) {
  int returnCode = 1;
  FILE *file;
  if ((file = fopen(path, "r")) == NULL) {
    returnCode = 0;
  }
  fclose(file);
  return returnCode;
}


x86 assembly (clang, -O0):
<checkFileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1158 <checkFileExists+0x38>
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFileExists>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @checkFileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @fclose(i32* %2)
ret i32 %4
}
const char *SteamAPI_ISteamUtils_GetIPCountry(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
  return "america";
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamUtils_GetIPCountry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
lea    0xef5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_GetIPCountry = [34 x i8] c"SteamAPI_ISteamUtils_GetIPCountry\00"
@.str.1 = [8 x i8] c"america\00"
define i8* @SteamAPI_ISteamUtils_GetIPCountry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamUtils_GetIPCountry, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUtils_GetIPCountry = [34 x i8] c"SteamAPI_ISteamUtils_GetIPCountry\00"
@.str.1 = [8 x i8] c"america\00"
define i8* @SteamAPI_ISteamUtils_GetIPCountry(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.SteamAPI_ISteamUtils_GetIPCountry, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
}
/* Variables and functions */
double fermi_dirac(double, double, double);
double inverted_fermi_dirac(double E, double EF, double kBTemp) {
  return fermi_dirac(EF, E, kBTemp);
}


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

x86 assembly (clang, -O2):
<inverted_fermi_dirac>:
movaps %xmm0,%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm1
jmp    1030 <fermi_dirac@plt>

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

LLVM IR (-O2):
define double @inverted_fermi_dirac(double %0, double %1, double %2) {
%4 = tail call double @fermi_dirac(double %1, double %0, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ stu__cc(int);
int stu__off();
int stu__cc1(int a) {
  stu__cc(a);
  return stu__off() - 1;
}


x86 assembly (clang, -O0):
<stu__cc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <stu__cc@plt>
mov    $0x0,%al
call   1040 <stu__off@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stu__cc1>:
push   %rax
call   1030 <stu__cc@plt>
xor    %eax,%eax
call   1040 <stu__off@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @stu__cc1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @stu__cc(i32 %3)
%5 = call i32 (...) @stu__off()
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @stu__cc1(i32 %0) {
%2 = tail call i32 @stu__cc(i32 %0)
%3 = tail call i32 (...) @stu__off()
%4 = add nsw i32 %3, -1
ret i32 %4
}
int main() {
here1:
  printf("here1: %p\n", &&here1);
  f1();
  printf("main: %p\n", __builtin_return_address(0));
here2:
  printf("here2: %p\n", &&here2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
lea    -0x10(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <f1@plt>
mov    0x8(%rbp),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
lea    -0x10(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    -0xf(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <f1@plt>
mov    0x8(%rsp),%rsi
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0xe(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"here1: %p\0A\00"
@.str.1 = [10 x i8] c"main: %p\0A\00"
@.str.2 = [11 x i8] c"here2: %p\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* blockaddress(@main, %2))
%4 = call i32 (...) @f1()
%5 = call i8* @llvm.returnaddress(i32 0)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %9, %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* blockaddress(@main, %7))
ret i32 0
9: ; No predecessors!
indirectbr i8* undef, [label %2, label %7]
}

LLVM IR (-O2):
@.str = [11 x i8] c"here1: %p\0A\00"
@.str.1 = [10 x i8] c"main: %p\0A\00"
@.str.2 = [11 x i8] c"here2: %p\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* blockaddress(@main, %1))
%3 = tail call i32 (...) @f1()
%4 = tail call i8* @llvm.returnaddress(i32 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* blockaddress(@main, %6))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int _mm_extract_epi32(int /*<<< orphan*/, int);
int foo32(__m128i x) { return _mm_extract_epi32(x, 2); }


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

x86 assembly (clang, -O2):
<foo32>:
mov    $0x2,%esi
jmp    1030 <_mm_extract_epi32@plt>

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

LLVM IR (-O2):
define i32 @foo32(i32 %0) {
%2 = tail call i32 @_mm_extract_epi32(i32 %0, i32 2)
ret i32 %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bbp_swap16(uint16_t n) { return (n >> 8) | ((n & 0xff) << 8); }


x86 assembly (clang, -O0):
<bbp_swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbp_swap16>:
mov    %edi,%ecx
sar    $0x8,%ecx
shl    $0x8,%edi
movzwl %di,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bbp_swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = and i32 %5, 255
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bbp_swap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = or i32 %4, %2
ret i32 %5
}
int INT_MIN(int a, int b) { return a <= b ? a : b; }


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

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

LLVM IR (-O0):
define i32 @INT_MIN(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @INT_MIN(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ltrim(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
int /*<<< orphan*/ rtrim(char *);
char *trim(unsigned char *str, int len) {
  char *tmp = (char *)malloc(sizeof(char) * len);
  memcpy(tmp, str, sizeof(char) * len);
  rtrim(tmp);
  ltrim(tmp);
  return tmp;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <rtrim@plt>
mov    -0x18(%rbp),%rdi
call   1050 <ltrim@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <rtrim@plt>
mov    %rbx,%rdi
call   1050 <ltrim@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @trim(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @memcpy(i8* %12, i8* %13, i32 %17)
%19 = load i8*, i8** %5
%20 = call i32 @rtrim(i8* %19)
%21 = load i8*, i8** %5
%22 = call i32 @ltrim(i8* %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define i8* @trim(i8* %0, i32 %1) {
%3 = tail call i64 @malloc(i32 %1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = tail call i32 @rtrim(i8* %4)
%7 = tail call i32 @ltrim(i8* %4)
ret i8* %4
}
const char *Slice_Name(void) { return "Slice"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Slice\00"
define i8* @Slice_Name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
const char *mg_version(void) { return "3.3"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"3.3\00"
define i8* @mg_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void foo014() {}


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

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

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

LLVM IR (-O2):
define void @foo014() {
ret void
}
/* Variables and functions */
char EOF;
char getchar();
void clearBuffer(void) {
  char ch;
  while ((ch = getchar()) != '\n' && ch != EOF)
    ;
}


x86 assembly (clang, -O0):
<clearBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1149 <clearBuffer+0x39>
movsbl -0x1(%rbp),%eax
mov    0x2eaa(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1159 <clearBuffer+0x49>
jmp    115e <clearBuffer+0x4e>
jmp    1118 <clearBuffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBuffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     112f <clearBuffer+0x1f>
cmp    (%rbx),%al
jne    1120 <clearBuffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @clearBuffer() {
%1 = alloca i8
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = load i8, i8* @EOF
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br label %12
12: ; preds = %6, %2
%13 = phi i1 [ false, %2 ], [ %11, %6 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %2
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @clearBuffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
int do_720() { return 720; }


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

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

LLVM IR (-O0):
define i32 @do_720() {
ret i32 720
}

LLVM IR (-O2):
define i32 @do_720() {
ret i32 720
}
void RTSemPongWait(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemPongWait() {
ret void
}
/* Type definitions */
struct msgtable_s {
  int dummy;
};

/* Variables and functions */
struct msgtable_s *minigettext__gettable(char *a) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.msgtable_s = type { i32 }
define %struct.msgtable_s* @minigettext__gettable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.msgtable_s* null
}

LLVM IR (-O2):
%struct.msgtable_s = type { i32 }
define noalias %struct.msgtable_s* @minigettext__gettable(i8* nocapture readnone %0) {
ret %struct.msgtable_s* null
}
/* Variables and functions */
int /*<<< orphan*/ vga_crt_out(int, int);
void tty_set_cursor(int p) {
  vga_crt_out(0xE, (p >> 8) & 0xff);
  vga_crt_out(0xF, p & 0xff);
}


x86 assembly (clang, -O0):
<tty_set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
mov    $0xe,%edi
call   1030 <vga_crt_out@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0xf,%edi
call   1030 <vga_crt_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_set_cursor>:
push   %rbx
mov    %edi,%ebx
movzbl %bh,%esi
mov    $0xe,%edi
call   1030 <vga_crt_out@plt>
movzbl %bl,%esi
mov    $0xf,%edi
pop    %rbx
jmp    1030 <vga_crt_out@plt>

LLVM IR (-O0):
define void @tty_set_cursor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = call i32 @vga_crt_out(i32 14, i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = call i32 @vga_crt_out(i32 15, i32 %8)
ret void
}

LLVM IR (-O2):
define void @tty_set_cursor(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = tail call i32 @vga_crt_out(i32 14, i32 %3)
%5 = and i32 %0, 255
%6 = tail call i32 @vga_crt_out(i32 15, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main_init(int *, char **);
int /*<<< orphan*/ main_loop();
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  main_init(&argc, argv);
  while (1) {
    main_loop();
    usleep(16667);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <main_init@plt>
mov    $0x0,%al
call   1040 <main_loop@plt>
mov    $0x411b,%edi
call   1050 <usleep@plt>
jmp    1153 <main+0x23>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <main_init@plt>
nop
xor    %eax,%eax
call   1040 <main_loop@plt>
mov    $0x411b,%edi
call   1050 <usleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i32 @main_init(i32* %4, i8** %6)
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @main_loop()
%10 = call i32 @usleep(i32 16667)
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @main_init(i32* %3, i8** %1)
br label %5
5: ; preds = %2, %5
%6 = call i32 (...) @main_loop()
%7 = call i32 @usleep(i32 16667)
br label %5
}
void rational_inv_int(int n, long double *x) {
  (*x) = (1.0) / ((long double)n);
}


x86 assembly (clang, -O0):
<rational_inv_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
fildl  -0x14(%rbp)
fld1
fdivp  %st,%st(1)
mov    -0x10(%rbp),%rax
fstpt  (%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rational_inv_int>:
mov    %edi,-0x4(%rsp)
fld1
fidivl -0x4(%rsp)
fstpt  (%rsi)
ret

LLVM IR (-O0):
define void @rational_inv_int(i32 %0, x86_fp80* %1) {
%3 = alloca i32
%4 = alloca x86_fp80*
store i32 %0, i32* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to x86_fp80
%7 = fdiv x86_fp80 0xK3FFF8000000000000000, %6
%8 = load x86_fp80*, x86_fp80** %4
store x86_fp80 %7, x86_fp80* %8
ret void
}

LLVM IR (-O2):
define void @rational_inv_int(i32 %0, x86_fp80* nocapture writeonly %1) {
%3 = sitofp i32 %0 to x86_fp80
%4 = fdiv x86_fp80 0xK3FFF8000000000000000, %3
store x86_fp80 %4, x86_fp80* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ con_flo(int, int, int, int);
int /*<<< orphan*/ con_lo(long, int);
int /*<<< orphan*/ set_err(char *);
con_fold() {
  set_err("con_fold");
  con_flo((1 ? 3 : 4.5), 200, 200, 200);
  con_lo(4L + 3, 1);
}


x86 assembly (clang, -O0):
<con_fold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <set_err@plt>
mov    $0x3,%edi
mov    $0xc8,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <con_flo@plt>
mov    $0x7,%edi
mov    $0x1,%esi
call   1040 <con_lo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_fold>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <set_err@plt>
mov    $0x3,%edi
mov    $0xc8,%esi
mov    $0xc8,%edx
mov    $0xc8,%ecx
call   1030 <con_flo@plt>
mov    $0x7,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <con_lo@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"con_fold\00"
define i32 @con_fold() {
%1 = alloca i32
%2 = call i32 @set_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @con_flo(i32 3, i32 200, i32 200, i32 200)
%4 = call i32 @con_lo(i64 7, i32 1)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"con_fold\00"
define i32 @con_fold() {
%1 = tail call i32 @set_err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @con_flo(i32 3, i32 200, i32 200, i32 200)
%3 = tail call i32 @con_lo(i64 7, i32 1)
ret i32 undef
}
const char *loader_UNKNOWN_get_name(void) {
  return "fallback loader for unknown file types";
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"fallback loader for unknown file types\00"
define i8* @loader_UNKNOWN_get_name() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"fallback loader for unknown file types\00"
define i8* @loader_UNKNOWN_get_name() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
int create_spin_block(int speed, int angle) {}


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

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

LLVM IR (-O0):
define i32 @create_spin_block(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @create_spin_block(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void copybuf(char *dest, const char *buf, size_t num) {
  size_t len = strlen(buf);
  size_t n = len > num ? num : len;
  strncpy(dest, buf, n);
  dest[n] = '\0';
}


x86 assembly (clang, -O0):
<copybuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    115c <copybuf+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1164 <copybuf+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copybuf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
cmp    %r12,%rax
cmova  %r12,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r15,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @copybuf(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ugt i64 %4, %2
%6 = select i1 %5, i64 %2, i64 %4
%7 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %6)
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %8
ret void
}
void _M2_Fractions_finish(__attribute__((unused)) int argc,
                          __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_Fractions_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t *postincrement16(uint8_t **ptr) {
  uint16_t *val = (uint16_t *)*ptr;
  *ptr += 2;
  return val;
}


x86 assembly (clang, -O0):
<postincrement16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<postincrement16>:
mov    (%rdi),%rax
lea    0x8(%rax),%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32* @postincrement16(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
store i32* %5, i32** %3
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32* %8, i32** %6
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @postincrement16(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 2
store i32* %3, i32** %0
ret i32* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_4_be(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int const *, int);
void ivory_serialize_pack_uint32_be(uint8_t *dst, uint32_t offs,
                                    const uint32_t *src) {
  uint8_t tmp[4] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_4_be(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_uint32_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1040 <ivory_serialize_pack_prim_4_be@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_uint32_be>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_4_be@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_uint32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = bitcast [4 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 16)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_4_be(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_uint32_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = bitcast [4 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, i32* %2, i32 16)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_4_be(i32* %9, i32* %10)
ret void
}
void g_param_spec_flags() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_flags() {
ret void
}
/* Type definitions */
struct netent {
  int dummy;
};

/* Variables and functions */
struct netent *_getnetbynis(const char *name, char *map, int af) {
  return (NULL);
}


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

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

LLVM IR (-O0):
%struct.netent = type { i32 }
define %struct.netent* @_getnetbynis(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret %struct.netent* null
}

LLVM IR (-O2):
%struct.netent = type { i32 }
define noalias %struct.netent* @_getnetbynis(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret %struct.netent* null
}
/* Variables and functions */
int inb(int);
int uart_can_tx_byte(void) { return inb(1016 + 0x05) & 0x20; }


x86 assembly (clang, -O0):
<uart_can_tx_byte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_can_tx_byte>:
push   %rax
mov    $0x3fd,%edi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_can_tx_byte() {
%1 = call i32 @inb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}

LLVM IR (-O2):
define i32 @uart_can_tx_byte() {
%1 = tail call i32 @inb(i32 1021)
%2 = and i32 %1, 32
ret i32 %2
}