xunge/DecIR huggingface dataset:
void swap(char *perm, int i, int j) {
  if (i == j) {
    return;
  }
  char tmp = perm[i];
  perm[i] = perm[j];
  perm[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    111f <swap+0x1f>
jmp    1151 <swap+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %edx,%esi
je     1118 <swap+0x18>
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %7
store i8 %8, i8* %10
br label %12
12: ; preds = %3, %5
ret void
}
/* Variables and functions */
double pow(int, int);
double pow10(int i) {
  extern const double *const pow10_table99;
  return -100 < i && i < 100 ? pow10_table99[i] : pow(10, i);
}


x86 assembly (clang, -O0):
<pow10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffff9c,%eax
cmp    -0x4(%rbp),%eax
jge    1150 <pow10+0x40>
cmpl   $0x64,-0x4(%rbp)
jge    1150 <pow10+0x40>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rax
movslq -0x4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <pow10+0x52>
mov    -0x4(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow10>:
mov    %edi,%esi
lea    0x63(%rsi),%eax
cmp    $0xc6,%eax
ja     112f <pow10+0x1f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
movslq %esi,%rcx
movsd  (%rax,%rcx,8),%xmm0
ret
mov    $0xa,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
@pow10_table99 = external constant double*
define double @pow10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 -100, %3
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load double*, double** @pow10_table99
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
%13 = load double, double* %12
br label %17
14: ; preds = %5, %1
%15 = load i32, i32* %2
%16 = call double @pow(i32 10, i32 %15)
br label %17
17: ; preds = %14, %8
%18 = phi double [ %13, %8 ], [ %16, %14 ]
ret double %18
}

LLVM IR (-O2):
@pow10_table99 = external constant double*
define double @pow10(i32 %0) {
%2 = add i32 %0, 99
%3 = icmp ult i32 %2, 199
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load double*, double** @pow10_table99
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds double, double* %5, i64 %6
%8 = load double, double* %7
br label %11
9: ; preds = %1
%10 = tail call double @pow(i32 10, i32 %0)
br label %11
11: ; preds = %9, %4
%12 = phi double [ %8, %4 ], [ %10, %9 ]
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int i;
  int k;
  int result;
  i = 2;
  k = 9;
  result = i + k;
  printf("Result is %i.\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x9,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Result is %i.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_ab(int /*<<< orphan*/);
int /*<<< orphan*/ pabc(int /*<<< orphan*/);
int /*<<< orphan*/ set_a(int);
int /*<<< orphan*/ set_b(int);
void main() {
  pabc(0);
  set_a(3);
  pabc(0);
  set_b(4);
  pabc(0);
  add_ab(0);
  pabc(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <pabc@plt>
mov    $0x3,%edi
call   1050 <set_a@plt>
xor    %edi,%edi
call   1040 <pabc@plt>
mov    $0x4,%edi
call   1060 <set_b@plt>
xor    %edi,%edi
call   1040 <pabc@plt>
xor    %edi,%edi
call   1030 <add_ab@plt>
xor    %edi,%edi
call   1040 <pabc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <pabc@plt>
mov    $0x3,%edi
call   1050 <set_a@plt>
xor    %edi,%edi
call   1040 <pabc@plt>
mov    $0x4,%edi
call   1060 <set_b@plt>
xor    %edi,%edi
call   1040 <pabc@plt>
xor    %edi,%edi
call   1030 <add_ab@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pabc@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @pabc(i32 0)
%2 = call i32 @set_a(i32 3)
%3 = call i32 @pabc(i32 0)
%4 = call i32 @set_b(i32 4)
%5 = call i32 @pabc(i32 0)
%6 = call i32 @add_ab(i32 0)
%7 = call i32 @pabc(i32 0)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @pabc(i32 0)
%2 = tail call i32 @set_a(i32 3)
%3 = tail call i32 @pabc(i32 0)
%4 = tail call i32 @set_b(i32 4)
%5 = tail call i32 @pabc(i32 0)
%6 = tail call i32 @add_ab(i32 0)
%7 = tail call i32 @pabc(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void serial_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<serial_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @serial_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
char *julian_to_yyyy_mm_dd(double);
char *julian_yyyy_mm_dd_string(double current) {
  return julian_to_yyyy_mm_dd(current);
}


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

x86 assembly (clang, -O2):
<julian_yyyy_mm_dd_string>:
jmp    1030 <julian_to_yyyy_mm_dd@plt>

LLVM IR (-O0):
define i8* @julian_yyyy_mm_dd_string(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @julian_to_yyyy_mm_dd(double %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @julian_yyyy_mm_dd_string(double %0) {
%2 = tail call i8* @julian_to_yyyy_mm_dd(double %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ glad_glTextureBarrier();
void glTextureBarrier() { glad_glTextureBarrier(); }


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

x86 assembly (clang, -O2):
<glTextureBarrier>:
xor    %eax,%eax
jmp    1030 <glad_glTextureBarrier@plt>

LLVM IR (-O0):
define void @glTextureBarrier() {
%1 = call i32 (...) @glad_glTextureBarrier()
ret void
}

LLVM IR (-O2):
define void @glTextureBarrier() {
%1 = tail call i32 (...) @glad_glTextureBarrier()
ret void
}
int default_rbtree_cmp(void *left_key, void *right_key) {
  return (int)left_key - (int)right_key;
}


x86 assembly (clang, -O0):
<default_rbtree_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_rbtree_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @default_rbtree_cmp(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 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @default_rbtree_cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debug_ol(char *);
int /*<<< orphan*/ ol(char *);
swapstk() {
  debug_ol("; swapstk");
  ol("pulx");
  ol("xgdx");
  ol("pshx");
}


x86 assembly (clang, -O0):
<swapstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xecf(%rip),%rdi
call   1030 <ol@plt>
lea    0xec8(%rip),%rdi
call   1030 <ol@plt>
lea    0xec1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapstk>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <debug_ol@plt>
lea    0xed6(%rip),%rdi
call   1030 <ol@plt>
lea    0xecf(%rip),%rdi
call   1030 <ol@plt>
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"; swapstk\00"
@.str.1 = [5 x i8] c"pulx\00"
@.str.2 = [5 x i8] c"xgdx\00"
@.str.3 = [5 x i8] c"pshx\00"
define i32 @swapstk() {
%1 = alloca i32
%2 = call i32 @debug_ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"; swapstk\00"
@.str.1 = [5 x i8] c"pulx\00"
@.str.2 = [5 x i8] c"xgdx\00"
@.str.3 = [5 x i8] c"pshx\00"
define i32 @swapstk() {
%1 = tail call i32 @debug_ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ unput(char const);
void unputstr(const char *s) {
  int i;
  for (i = strlen(s) - 1; i >= 0; i--)
    unput(s[i]);
}


x86 assembly (clang, -O0):
<unputstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1164 <unputstr+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <unput@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <unputstr+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unputstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <unputstr+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <unput@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <unputstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @unputstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @unput(i8 signext %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}
unsigned getval_365() { return 3677933185U; }


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

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

LLVM IR (-O0):
define i32 @getval_365() {
ret i32 -617034111
}

LLVM IR (-O2):
define i32 @getval_365() {
ret i32 -617034111
}
int init_tui(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_tui() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void alloc_error(char *s) {
  printf("\n Warning: Not enough memory to allocate %s\n", s);
  printf("\n Cannot proceed with MSBR\n");
  exit(0);
}


x86 assembly (clang, -O0):
<alloc_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<alloc_error>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0A Warning: Not enough memory to allocate %s\0A\00"
@.str.1 = [28 x i8] c"\0A Cannot proceed with MSBR\0A\00"
define void @alloc_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0A Warning: Not enough memory to allocate %s\0A\00"
@str = [27 x i8] c"\0A Cannot proceed with MSBR\00"
define void @alloc_error(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void Calc_OutputResult() {}


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

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

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

LLVM IR (-O2):
define void @Calc_OutputResult() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int x, y, z;
  x = 7;
  y = 4;
  z = x - y;
  printf("v1");
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"v1\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo();
int main(void) {
  if ((unsigned char)-1 != 0xff || sizeof(short) != 2 || sizeof(int) != 4)
    exit(0);
  if (foo() != (int)0xffff0066)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0xffff0066,%eax
je     1158 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0xffff0066,%eax
jne    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, -65434
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, -65434
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ FlipEndian(void *, int);
long FLIP_LONG(long pVar) {
  return *(long *)FlipEndian((void *)&pVar, sizeof(long));
}


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

x86 assembly (clang, -O2):
<FLIP_LONG>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <FlipEndian@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @FLIP_LONG(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 8)
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @FLIP_LONG(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 8)
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
__attribute__((__weak__, __always___)) ssize_t
softboundcets_write(int fd, void *buf, size_t count) {
  return write(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<softboundcets_write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @write(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundcets_write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int readlink(char *, char *, int);
char *get_exename(char *exename, int size) {
  int res;
  if ((res = readlink("/proc/self/exe", exename, size - 1)) == -1)
    exename[0] = '\0';
  else
    exename[res] = '\0';
  return (exename);
}


x86 assembly (clang, -O0):
<get_exename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
lea    0xed0(%rip),%rdi
call   1030 <readlink@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    114d <get_exename+0x3d>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1159 <get_exename+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exename>:
push   %rbx
mov    %rdi,%rbx
lea    -0x1(%rsi),%edx
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <readlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
cmovne %eax,%ecx
movslq %ecx,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @get_exename(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
store i32 %9, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %13
br label %19
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %14, %11
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @get_exename(i8* returned %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 0, i32 %4
%7 = sext i32 %6 to i64
%8 = getelementptr i8, i8* %0, i64 %7
store i8 0, i8* %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ outl(long, int);
void clstore(long cfgadr, long value) {
  outl((cfgadr | 0x80000000) & ~3, 0xcf8);
  outl(value, (0xcfc + (cfgadr & 3)));
}


x86 assembly (clang, -O0):
<clstore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x80000000,%rdi
or     -0x8(%rbp),%rdi
and    $0xfffffffffffffffc,%rdi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
and    $0x3,%rax
add    $0xcfc,%rax
mov    %eax,%esi
call   1030 <outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clstore>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movabs $0xffffffff7ffffffc,%rax
ff ff ff
and    %rdi,%rax
mov    $0x80000000,%edi
or     %rax,%rdi
mov    $0xcf8,%esi
call   1030 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <outl@plt>

LLVM IR (-O0):
define void @clstore(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 = or i64 %5, 2147483648
%7 = and i64 %6, -4
%8 = call i32 @outl(i64 %7, i32 3320)
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = and i64 %10, 3
%12 = add nsw i64 3324, %11
%13 = trunc i64 %12 to i32
%14 = call i32 @outl(i64 %9, i32 %13)
ret void
}

LLVM IR (-O2):
define void @clstore(i64 %0, i64 %1) {
%3 = and i64 %0, -2147483652
%4 = or i64 %3, 2147483648
%5 = tail call i32 @outl(i64 %4, i32 3320)
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 3
%8 = or i32 %7, 3324
%9 = tail call i32 @outl(i64 %1, i32 %8)
ret void
}
/* Variables and functions */
int printf(char *);
int ued_save_cursor_pos(void) { return printf("\033[s"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[s\00"
define i32 @ued_save_cursor_pos() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
double __ocml_rint_f64(double);
double rint(double x) { return __ocml_rint_f64(x); }


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

x86 assembly (clang, -O2):
<rint>:
jmp    1030 <__ocml_rint_f64@plt>

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

LLVM IR (-O2):
define double @rint(double %0) {
%2 = tail call double @__ocml_rint_f64(double %0)
ret double %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int pmh7_register_read(int /*<<< orphan*/);
int /*<<< orphan*/ pmh7_register_write(int /*<<< orphan*/, int);
void pmh7_register_set_bit(uint16_t reg, uint8_t bit) {
  uint8_t val;
  val = pmh7_register_read(reg);
  pmh7_register_write(reg, val | (1 << bit));
}


x86 assembly (clang, -O0):
<pmh7_register_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <pmh7_register_read@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%esi
call   1030 <pmh7_register_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmh7_register_set_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <pmh7_register_read@plt>
bts    %ebx,%eax
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pmh7_register_write@plt>

LLVM IR (-O0):
define void @pmh7_register_set_bit(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 = call i32 @pmh7_register_read(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = or i32 %9, %11
%13 = call i32 @pmh7_register_write(i32 %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @pmh7_register_set_bit(i32 %0, i32 %1) {
%3 = tail call i32 @pmh7_register_read(i32 %0)
%4 = shl nuw i32 1, %1
%5 = or i32 %3, %4
%6 = tail call i32 @pmh7_register_write(i32 %0, i32 %5)
ret void
}
/* Variables and functions */
void *malloc(int);
void *f(int a) {
  if (a) {
    void *p = malloc(4096);
    return p;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1140 <f+0x30>
mov    $0x1000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <f+0x38>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
je     111e <f+0xe>
mov    $0x1000,%edi
jmp    1030 <malloc@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @f(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i8* @malloc(i32 4096)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @f(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
void clean_matrix(float **v, int m) {
  int i;
  for (i = 0; i < m; i++) {
    free(v[i]);
  }
  free(v);
}


x86 assembly (clang, -O0):
<clean_matrix>:
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
jge    1151 <clean_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <clean_matrix+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <clean_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <clean_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @clean_matrix(float** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float*, float** %0, i64 %7
%9 = bitcast float** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast float** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void irq_remap() {
  outb(0x20, 0x11);
  outb(0xA0, 0x11);
  outb(0x21, 0x20);
  outb(0xA1, 0x28);
  outb(0x21, 0x04);
  outb(0xA1, 0x02);
  outb(0x21, 0x01);
  outb(0xA1, 0x01);
  outb(0x21, 0x0);
  outb(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<irq_remap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_remap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @irq_remap() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @outb(i32 160, i32 17)
%3 = call i32 @outb(i32 33, i32 32)
%4 = call i32 @outb(i32 161, i32 40)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 161, i32 2)
%7 = call i32 @outb(i32 33, i32 1)
%8 = call i32 @outb(i32 161, i32 1)
%9 = call i32 @outb(i32 33, i32 0)
%10 = call i32 @outb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @irq_remap() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @outb(i32 160, i32 17)
%3 = tail call i32 @outb(i32 33, i32 32)
%4 = tail call i32 @outb(i32 161, i32 40)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 161, i32 2)
%7 = tail call i32 @outb(i32 33, i32 1)
%8 = tail call i32 @outb(i32 161, i32 1)
%9 = tail call i32 @outb(i32 33, i32 0)
%10 = tail call i32 @outb(i32 161, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendByte(int, int);
void tube_NewLine(unsigned int *reg) {
  sendByte(1, 0x0A);
  sendByte(1, 0x0D);
}


x86 assembly (clang, -O0):
<tube_NewLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
call   1030 <sendByte@plt>
mov    $0x1,%edi
mov    $0xd,%esi
call   1030 <sendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tube_NewLine>:
push   %rax
mov    $0x1,%edi
mov    $0xa,%esi
call   1030 <sendByte@plt>
mov    $0x1,%edi
mov    $0xd,%esi
pop    %rax
jmp    1030 <sendByte@plt>

LLVM IR (-O0):
define void @tube_NewLine(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @sendByte(i32 1, i32 10)
%4 = call i32 @sendByte(i32 1, i32 13)
ret void
}

LLVM IR (-O2):
define void @tube_NewLine(i32* nocapture readnone %0) {
%2 = tail call i32 @sendByte(i32 1, i32 10)
%3 = tail call i32 @sendByte(i32 1, i32 13)
ret void
}
void Flush_output_file() { return; }


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

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

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

LLVM IR (-O2):
define void @Flush_output_file() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hscreenrect();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basHScreenRect() { pushNumber(hscreenrect()); }


x86 assembly (clang, -O0):
<basHScreenRect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hscreenrect@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basHScreenRect>:
push   %rax
xor    %eax,%eax
call   1030 <hscreenrect@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basHScreenRect() {
%1 = call i32 (...) @hscreenrect()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basHScreenRect() {
%1 = tail call i32 (...) @hscreenrect()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
size_t fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void read_bswap_write_32(FILE *in, FILE *out) {
  uint32_t buf = 0;
  size_t read;
  read = fread(&buf, 1, sizeof(buf), in);
  if (read == 0)
    return;
  buf = bswap_32(buf);
  fwrite(&buf, 1, sizeof(buf), out);
}


x86 assembly (clang, -O0):
<read_bswap_write_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1172 <read_bswap_write_32+0x42>
jmp    1194 <read_bswap_write_32+0x64>
mov    -0x14(%rbp),%edi
call   1040 <bswap_32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1050 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bswap_write_32>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
test   %rax,%rax
je     1180 <read_bswap_write_32+0x50>
mov    0xc(%rsp),%edi
call   1040 <bswap_32@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @read_bswap_write_32(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%7 = load i32*, i32** %3
%8 = call i64 @fread(i32* %5, i32 1, i32 4, i32* %7)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i32 @bswap_32(i32 %13)
store i32 %14, i32* %5
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i32* %5, i32 1, i32 4, i32* %15)
br label %17
17: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @read_bswap_write_32(i32* nocapture %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i64 @fread(i32* %3, i32 1, i32 4, i32* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @bswap_32(i32 %8)
store i32 %9, i32* %3
%10 = call i32 @fwrite(i32* %3, i32 1, i32 4, i32* %1)
br label %11
11: ; preds = %2, %7
ret void
}
AR0AX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (((double *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
movslq -0x20(%rbp),%rcx
mov    $0xa98ac7,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114c <AR0AX1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <AR0AX1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AX1>:
movslq %esi,%rax
movsd  0xa98ac7(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

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

LLVM IR (-O2):
define i32 @AR0AX1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds double, double* inttoptr (i64 11111111 to double*), i64 %9
%11 = load double, double* %10
%12 = fcmp ole double %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t HighByte(uint16_t value) { return (value >> 8) & 0xff; }


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

x86 assembly (clang, -O2):
<HighByte>:
mov    %edi,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @HighByte(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @HighByte(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
int /*<<< orphan*/ text(int, int, char *);
int Mtext(int nargs, int *args) {
  if (nargs < 3) {
    eset(24);
    return -1;
  }
  int x = args[0];
  int y = args[1];
  char *lbl = args[2];
  text(x, y, lbl);
}


x86 assembly (clang, -O0):
<Mtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    114f <Mtext+0x2f>
mov    $0x18,%edi
call   1040 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <Mtext+0x5d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq 0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <text@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mtext>:
push   %rax
cmp    $0x2,%edi
jg     1132 <Mtext+0x12>
mov    $0x18,%edi
call   1040 <eset@plt>
jmp    1142 <Mtext+0x22>
mov    (%rsi),%edi
mov    0x4(%rsi),%eax
movslq 0x8(%rsi),%rdx
mov    %eax,%esi
call   1030 <text@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @Mtext(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 24)
br label %15
6: ; preds = %2
%7 = load i32, i32* %1
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 2
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @text(i32 %7, i32 %9, i8* %13)
br label %15
15: ; preds = %6, %4
ret i32 -1
}
long double sinl(long double x) {}


x86 assembly (clang, -O0):
<sinl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define x86_fp80 @sinl(x86_fp80 %0) {
ret x86_fp80 undef
}
void XtVaGetValues() {}


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

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

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

LLVM IR (-O2):
define void @XtVaGetValues() {
ret void
}
void plat_midi_get_dev_name(int num, char *s) {
  s[0] = ' ';
  s[1] = 0;
}


x86 assembly (clang, -O0):
<plat_midi_get_dev_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plat_midi_get_dev_name>:
movw   $0x20,(%rsi)
ret

LLVM IR (-O0):
define void @plat_midi_get_dev_name(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 32, i8* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @plat_midi_get_dev_name(i32 %0, i8* nocapture writeonly %1) {
store i8 32, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %3
ret void
}
void foo651() {}


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

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

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

LLVM IR (-O2):
define void @foo651() {
ret void
}