xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ stderr;
__attribute__((always_)) void
MOZ_ReportAssertionFailure(const char *s, const char *file, int ln) {
  fprintf(stderr, "Assertion failure: %s, at %s:%d\n", s, file, ln);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<MOZ_ReportAssertionFailure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOZ_ReportAssertionFailure>:
push   %rbx
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Assertion failure: %s, at %s:%d\0A\00"
define void @MOZ_ReportAssertionFailure(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
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Assertion failure: %s, at %s:%d\0A\00"
define void @MOZ_ReportAssertionFailure(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ append();
int /*<<< orphan*/ expect_ch(char);
int character(void) {
  expect_ch('\'');
  append();
  expect_ch('\'');
  return 6;
}


x86 assembly (clang, -O0):
<character>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
call   1040 <expect_ch@plt>
mov    $0x0,%al
call   1030 <append@plt>
mov    $0x27,%edi
call   1040 <expect_ch@plt>
mov    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<character>:
push   %rax
mov    $0x27,%edi
call   1040 <expect_ch@plt>
xor    %eax,%eax
call   1030 <append@plt>
mov    $0x27,%edi
call   1040 <expect_ch@plt>
mov    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @character() {
%1 = call i32 @expect_ch(i8 signext 39)
%2 = call i32 (...) @append()
%3 = call i32 @expect_ch(i8 signext 39)
ret i32 6
}

LLVM IR (-O2):
define i32 @character() {
%1 = tail call i32 @expect_ch(i8 signext 39)
%2 = tail call i32 (...) @append()
%3 = tail call i32 @expect_ch(i8 signext 39)
ret i32 6
}
int trimlen(char *str, int maxlen) {
  int len = maxlen - 1;
  while ((len > 0) && (str[len - 1] == ' '))
    len--;
  return (len);
}


x86 assembly (clang, -O0):
<trimlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jle    113d <trimlen+0x3d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114d <trimlen+0x4d>
jmp    115b <trimlen+0x5b>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <trimlen+0x14>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimlen>:
mov    %esi,%ecx
test   %esi,%esi
mov    $0x1,%eax
cmovle %esi,%eax
add    $0xffffffff,%eax
nop
cmp    $0x2,%ecx
jl     1124 <trimlen+0x24>
lea    -0x2(%rcx),%edx
add    $0xffffffffffffffff,%rcx
cmpb   $0x20,(%rdi,%rdx,1)
je     1110 <trimlen+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @trimlen(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 i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br label %20
20: ; preds = %11, %8
%21 = phi i1 [ false, %8 ], [ %19, %11 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i32, i32* %5
%24 = add nsw i32 %23, -1
store i32 %24, i32* %5
br label %8
25: ; preds = %20
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @trimlen(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = call i32 @llvm.smin.i32(i32 %1, i32 1)
%5 = add i32 %4, -1
br label %6
6: ; preds = %11, %2
%7 = phi i64 [ %8, %11 ], [ %3, %2 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %7 to i32
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = add i64 %7, 4294967294
%13 = and i64 %12, 4294967295
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 32
br i1 %16, label %6, label %17
17: ; preds = %11
%18 = trunc i64 %8 to i32
br label %19
19: ; preds = %6, %17
%20 = phi i32 [ %18, %17 ], [ %5, %6 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void StopMonitor() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @StopMonitor() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ worker_leave_main_lock();
int /*<<< orphan*/ worker_try_enter_main_lock();
int in_lock_check_stop_callback() {
  worker_leave_main_lock();
  if (!worker_try_enter_main_lock())
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<in_lock_check_stop_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <worker_leave_main_lock@plt>
mov    $0x0,%al
call   1040 <worker_try_enter_main_lock@plt>
cmp    $0x0,%eax
jne    114b <in_lock_check_stop_callback+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <in_lock_check_stop_callback+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_lock_check_stop_callback>:
push   %rax
xor    %eax,%eax
call   1030 <worker_leave_main_lock@plt>
xor    %eax,%eax
call   1040 <worker_try_enter_main_lock@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @in_lock_check_stop_callback() {
%1 = alloca i32
%2 = call i32 (...) @worker_leave_main_lock()
%3 = call i32 (...) @worker_try_enter_main_lock()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @in_lock_check_stop_callback() {
%1 = tail call i32 (...) @worker_leave_main_lock()
%2 = tail call i32 (...) @worker_try_enter_main_lock()
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void _M2_NetworkOrder_finish(__attribute__((unused)) int argc,
                             __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_NetworkOrder_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_NetworkOrder_finish(i32 %0, i8** nocapture %1) {
ret void
}
int validate_arguments(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @validate_arguments() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f1(int *);
int /*<<< orphan*/ f2(int /*<<< orphan*/ (*)(int *), int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 5;
  printf("\nin main a = %d;\n\n", a);
  f1(&a);
  f2(f1, &a);
  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   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1050 <f1@plt>
mov    0x2e8c(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
lea    0xecc(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <f1@plt>
mov    0x2e96(%rip),%rdi
mov    %rbx,%rsi
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0Ain main a = %d;\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @f1(i32* %6)
%10 = call i32 @f2(i32 (i32*)* @f1, i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0Ain main a = %d;\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = call i32 @f1(i32* %3)
%7 = call i32 @f2(i32 (i32*)* @f1, i32* %3)
ret i32 0
}
void raw_ochar(char c, int *func_write(int, char *, int)) {
  (*func_write)(0, &c, 1);
}


x86 assembly (clang, -O0):
<raw_ochar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_ochar>:
push   %rax
mov    %rsi,%rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   *%rax
pop    %rax
ret

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

LLVM IR (-O2):
define void @raw_ochar(i8 signext %0, i32* (i32, i8*, i32)* nocapture %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32* %1(i32 0, i8* %3, i32 1)
ret void
}
int search(struct node *root, int val) { return -1; }


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.node = type opaque
define i32 @search(%struct.node* %0, i32 %1) {
%3 = alloca %struct.node*
%4 = alloca i32
store %struct.node* %0, %struct.node** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
%struct.node = type opaque
define i32 @search(%struct.node* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int t = 0;
  scanf("%d", &t);
  if (t >= 1 && t <= 1000) {
    t = t * 4;
    printf("%d\n", t);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jl     1175 <main+0x55>
cmpl   $0x3e8,-0x8(%rbp)
jg     1175 <main+0x55>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    -0x1(%rsi),%eax
cmp    $0x3e7,%eax
ja     115b <main+0x3b>
shl    $0x2,%esi
mov    %esi,0x4(%rsp)
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 1
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 1000
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 4
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9, %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, -1
%6 = icmp ult i32 %5, 1000
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = shl nuw nsw i32 %4, 2
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}
int a_ctz_l(unsigned long x) {
  long r;
  __asm__("bsf %1,%0" : "=r"(r) : "r"(x));
  return r;
}


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

x86 assembly (clang, -O2):
<a_ctz_l>:
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @a_ctz_l(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @a_ctz_l(i64 %0) {
%2 = tail call i64 asm "bsf $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int test_imm_FDint32_reg(int val) { return ((val) & (0xFD << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_FDint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xfd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FDint32_reg>:
test   $0xfd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FDint32_reg(i32 %0) {
%2 = and i32 %0, 253
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __ev_ri4_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ri4_changed() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ myprintf(char *, char *);
main() {
  myprintf("%s\n", "123");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
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    0xee5(%rip),%rsi
call   1030 <myprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"123\00"
define i32 @main() {
%1 = tail call i32 @myprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void handle_mouse_delta_x(double delta) { return; }


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

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

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

LLVM IR (-O2):
define void @handle_mouse_delta_x(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unblock_signals();
void timer_unlock(void) { unblock_signals(); }


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

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

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

LLVM IR (-O2):
define void @timer_unlock() {
%1 = tail call i32 (...) @unblock_signals()
ret void
}
/* Variables and functions */
char *get_world();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("hello ");
  printf("%s", get_world());
  printf("\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <get_world@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"hello \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* (...) @get_world()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sum(int, int, ...);
int main() {
  sum(1, 2);
  sum(3, 1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <sum@plt>
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
mov    $0x0,%al
call   1030 <sum@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <sum@plt>
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <sum@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) @sum(i32 1, i32 2)
%2 = tail call i32 (i32, i32, ...) @sum(i32 3, i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int musbgm_play(int, int, int);
int mus_bgm_play(int no, int time, int vol) {
  return musbgm_play(no, time, vol);
}


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

x86 assembly (clang, -O2):
<mus_bgm_play>:
jmp    1030 <musbgm_play@plt>

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

LLVM IR (-O2):
define i32 @mus_bgm_play(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @musbgm_play(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
long FlashErase(unsigned long ulAddress) {
  ;
  (*((volatile unsigned long *)(0x400FD014))) = 0x00000001;
  (*((volatile unsigned long *)(0x400FD000))) = ulAddress;
  (*((volatile unsigned long *)(0x400FD008))) = 0xA4420000 | 0x00000002;
  while ((*((volatile unsigned long *)(0x400FD008))) & 0x00000002) {
  }
  if ((*((volatile unsigned long *)(0x400FD00C))) & 0x00000001) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<FlashErase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x400fd014,%eax
movq   $0x1,(%rax)
mov    -0x10(%rbp),%rcx
mov    $0x400fd000,%eax
mov    %rcx,(%rax)
mov    $0x400fd008,%eax
mov    $0xa4420002,%ecx
mov    %rcx,(%rax)
mov    $0x400fd008,%eax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1148 <FlashErase+0x48>
jmp    112d <FlashErase+0x2d>
mov    $0x400fd00c,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     116b <FlashErase+0x6b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1173 <FlashErase+0x73>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashErase>:
movq   $0x1,0x400fd014
mov    %rdi,0x400fd000
40
mov    $0xa4420002,%eax
mov    %rax,0x400fd008
40
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x2,0x400fd008
jne    1130 <FlashErase+0x30>
mov    0x400fd00c,%rax
40
and    $0x1,%eax
neg    %rax
ret

LLVM IR (-O0):
define i64 @FlashErase(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
store volatile i64 1, i64* inttoptr (i64 1074778132 to i64*)
%4 = load i64, i64* %3
store volatile i64 %4, i64* inttoptr (i64 1074778112 to i64*)
store volatile i64 2755788802, i64* inttoptr (i64 1074778120 to i64*)
br label %5
5: ; preds = %9, %1
%6 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%7 = and i64 %6, 2
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i64, i64* inttoptr (i64 1074778124 to i64*)
%12 = and i64 %11, 1
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i64 -1, i64* %2
br label %16
15: ; preds = %10
store i64 0, i64* %2
br label %16
16: ; preds = %15, %14
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @FlashErase(i64 %0) {
store volatile i64 1, i64* inttoptr (i64 1074778132 to i64*)
store volatile i64 %0, i64* inttoptr (i64 1074778112 to i64*)
store volatile i64 2755788802, i64* inttoptr (i64 1074778120 to i64*)
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 1074778120 to i64*)
%4 = and i64 %3, 2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = load volatile i64, i64* inttoptr (i64 1074778124 to i64*)
%8 = and i64 %7, 1
%9 = sub nsw i64 0, %8
ret i64 %9
}
char *rsa2_fmtkey(void *key) {
  struct RSAKey *rsa = (struct RSAKey *)key;
  char *p;
  int len;
  len = rsastr_len(rsa);
  p = ((char *)safemalloc((len) * sizeof(char)));
  rsastr_fmt(p, rsa);
  return p;
}


x86 assembly (clang, -O0):
<rsa2_fmtkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <rsastr_len@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rdi
shl    $0x0,%rdi
mov    $0x0,%al
call   1040 <safemalloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <rsastr_fmt@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa2_fmtkey>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <rsastr_len@plt>
movslq %eax,%rdi
xor    %eax,%eax
call   1040 <safemalloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <rsastr_fmt@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.RSAKey = type opaque
define i8* @rsa2_fmtkey(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.RSAKey*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to %struct.RSAKey*
store %struct.RSAKey* %7, %struct.RSAKey** %3
%8 = load %struct.RSAKey*, %struct.RSAKey** %3
%9 = call i32 (%struct.RSAKey*, ...) bitcast (i32 (...)* @rsastr_len to i32 (%struct.RSAKey*, ...)*)(%struct.RSAKey* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 1
%13 = call i32 (i64, ...) bitcast (i32 (...)* @safemalloc to i32 (i64, ...)*)(i64 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = load %struct.RSAKey*, %struct.RSAKey** %3
%18 = call i32 (i8*, %struct.RSAKey*, ...) bitcast (i32 (...)* @rsastr_fmt to i32 (i8*, %struct.RSAKey*, ...)*)(i8* %16, %struct.RSAKey* %17)
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
%struct.RSAKey = type opaque
define i8* @rsa2_fmtkey(i8* %0) {
%2 = bitcast i8* %0 to %struct.RSAKey*
%3 = tail call i32 (%struct.RSAKey*, ...) bitcast (i32 (...)* @rsastr_len to i32 (%struct.RSAKey*, ...)*)(%struct.RSAKey* %2)
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, ...) bitcast (i32 (...)* @safemalloc to i32 (i64, ...)*)(i64 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 (i8*, %struct.RSAKey*, ...) bitcast (i32 (...)* @rsastr_fmt to i32 (i8*, %struct.RSAKey*, ...)*)(i8* %7, %struct.RSAKey* %2)
ret i8* %7
}
const char *bitis_GetVersion() { return "0.0.0.1"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"0.0.0.1\00"
define i8* @bitis_GetVersion() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void __tiger__exit(int i) { exit(i); }


x86 assembly (clang, -O0):
<__tiger__exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<__tiger__exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @__tiger__exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
unsigned int read_reg(volatile void *reg_base, unsigned int offset) {
  return *((volatile unsigned int *)(reg_base + offset));
}


x86 assembly (clang, -O0):
<read_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read_reg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load volatile i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_reg(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int i;
  i = -1;
  while (str && str[++i])
    ft_putchar(str[i]);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <ft_putstr+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1160 <ft_putstr+0x50>
jmp    1176 <ft_putstr+0x66>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i64 [ %10, %6 ], [ 0, %3 ]
%9 = tail call i32 @ft_putchar(i8 signext %7)
%10 = add nuw nsw i64 %8, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ADC_(int);
int /*<<< orphan*/ c64_memIndirectZeroX();
void ADC_izx(void) {
  c64_memIndirectZeroX();
  ADC_(1);
}


x86 assembly (clang, -O0):
<ADC_izx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <c64_memIndirectZeroX@plt>
mov    $0x1,%edi
call   1040 <ADC_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_izx>:
push   %rax
xor    %eax,%eax
call   1030 <c64_memIndirectZeroX@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <ADC_@plt>

LLVM IR (-O0):
define void @ADC_izx() {
%1 = call i32 (...) @c64_memIndirectZeroX()
%2 = call i32 @ADC_(i32 1)
ret void
}

LLVM IR (-O2):
define void @ADC_izx() {
%1 = tail call i32 (...) @c64_memIndirectZeroX()
%2 = tail call i32 @ADC_(i32 1)
ret void
}
/* Variables and functions */
int alphasort(void const *, void const *);
int mysort(const void *d1, const void *d2) { return -alphasort(d1, d2); }


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

x86 assembly (clang, -O2):
<mysort>:
push   %rax
call   1030 <alphasort@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mysort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @alphasort(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @mysort(i8* %0, i8* %1) {
%3 = tail call i32 @alphasort(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_standard_real_run(void) {
  int fail, *b;
  double *c;
  int precision = 0;
  fail = _ada_use_c2phc(621, &precision, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_standard_real_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x26d,%edi
lea    -0x1c(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_standard_real_run>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x26d,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sweep_standard_real_run() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca double*
%4 = alloca i32
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = load double*, double** %3
%7 = call i32 @_ada_use_c2phc(i32 621, i32* %4, i32* %5, double* %6)
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @sweep_standard_real_run() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @_ada_use_c2phc(i32 621, i32* %1, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ insmod_main(int, char **);
int main(int argc, char *argv[]) {
  char *i_argv[2];
  i_argv[0] = "/sbin/insmod";
  i_argv[1] = "/tffs.o";
  insmod_main(2, i_argv);
  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)
lea    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x2,%edi
call   1030 <insmod_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
lea    0xee7(%rip),%rax
mov    %rax,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
call   1030 <insmod_main@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/sbin/insmod\00"
@.str.1 = [8 x i8] c"/tffs.o\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%10 = call i32 @insmod_main(i32 2, i8** %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/sbin/insmod\00"
@.str.1 = [8 x i8] c"/tffs.o\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = call i32 @insmod_main(i32 2, i8** %5)
ret i32 0
}
int xmlUCSIsLimbu(int code) { return (((code >= 0x1900) && (code <= 0x194F))); }


x86 assembly (clang, -O0):
<xmlUCSIsLimbu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1900,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsLimbu+0x26>
cmpl   $0x194f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsLimbu>:
add    $0xffffe700,%edi
xor    %eax,%eax
cmp    $0x50,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsLimbu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 6400
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 6479
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsLimbu(i32 %0) {
%2 = add i32 %0, -6400
%3 = icmp ult i32 %2, 80
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int wb_sleep(int time) { usleep(time); }


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

x86 assembly (clang, -O2):
<wb_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define i32 @wb_sleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 undef
}
void setPixel(unsigned char *vmem, unsigned short x, unsigned short y,
              unsigned char r, unsigned char g, unsigned char b) {
  unsigned int *pixel = (unsigned int *)(vmem + ((1024 * 4) * y + x * 4));
  *pixel = (r << 16) | (g << 8) | b;
}


x86 assembly (clang, -O0):
<setPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x28(%rbp)
mov    %ecx,%eax
mov    -0x28(%rbp),%ecx
mov    %eax,-0x24(%rbp)
mov    %edx,%eax
mov    -0x24(%rbp),%edx
mov    %eax,-0x20(%rbp)
mov    %esi,%eax
mov    -0x20(%rbp),%esi
mov    %eax,-0x1c(%rbp)
mov    %rdi,%r8
mov    -0x1c(%rbp),%edi
mov    %r9b,%al
mov    %r8,-0x8(%rbp)
mov    %di,-0xa(%rbp)
mov    %si,-0xc(%rbp)
mov    %dl,-0xd(%rbp)
mov    %cl,-0xe(%rbp)
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
movzwl -0xc(%rbp),%ecx
shl    $0xc,%ecx
movzwl -0xa(%rbp),%edx
shl    $0x2,%edx
add    %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movzbl -0xd(%rbp),%ecx
shl    $0x10,%ecx
movzbl -0xe(%rbp),%eax
shl    $0x8,%eax
or     %eax,%ecx
movzbl -0xf(%rbp),%eax
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPixel>:
mov    %edx,%eax
shl    $0xc,%rax
mov    %esi,%edx
lea    (%rax,%rdx,4),%rax
shl    $0x10,%ecx
shl    $0x8,%r8d
or     %ecx,%r8d
or     %r9d,%r8d
mov    %r8d,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @setPixel(i8* %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i16
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i32*
store i8* %0, i8** %7
store i16 %1, i16* %8
store i16 %2, i16* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%14 = load i8*, i8** %7
%15 = load i16, i16* %9
%16 = zext i16 %15 to i32
%17 = mul nsw i32 4096, %16
%18 = load i16, i16* %8
%19 = zext i16 %18 to i32
%20 = mul nsw i32 %19, 4
%21 = add nsw i32 %17, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %14, i64 %22
%24 = bitcast i8* %23 to i32*
store i32* %24, i32** %13
%25 = load i8, i8* %10
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 16
%28 = load i8, i8* %11
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 8
%31 = or i32 %27, %30
%32 = load i8, i8* %12
%33 = zext i8 %32 to i32
%34 = or i32 %31, %33
%35 = load i32*, i32** %13
store i32 %34, i32* %35
ret void
}

LLVM IR (-O2):
define void @setPixel(i8* nocapture writeonly %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3, i8 zeroext %4, i8 zeroext %5) {
%7 = zext i16 %2 to i64
%8 = shl nuw nsw i64 %7, 12
%9 = zext i16 %1 to i64
%10 = shl nuw nsw i64 %9, 2
%11 = add nuw nsw i64 %8, %10
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = bitcast i8* %12 to i32*
%14 = zext i8 %3 to i32
%15 = shl nuw nsw i32 %14, 16
%16 = zext i8 %4 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %17, %15
%19 = zext i8 %5 to i32
%20 = or i32 %18, %19
store i32 %20, i32* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LDX_();
int /*<<< orphan*/ c64_memZero();
void LDX_zp(void) {
  c64_memZero();
  LDX_();
}


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

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

LLVM IR (-O0):
define void @LDX_zp() {
%1 = call i32 (...) @c64_memZero()
%2 = call i32 (...) @LDX_()
ret void
}

LLVM IR (-O2):
define void @LDX_zp() {
%1 = tail call i32 (...) @c64_memZero()
%2 = tail call i32 (...) @LDX_()
ret void
}
void mxml_release_string(const char *mxml_string) {
  if (((void *)0) != mxml_string) {
    free((char *)mxml_string);
  }
}


x86 assembly (clang, -O0):
<mxml_release_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <mxml_release_string+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mxml_release_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @mxml_release_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
void tmpi_prog_main_init_default() {}


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

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

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

LLVM IR (-O2):
define void @tmpi_prog_main_init_default() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print_Array(int array[], int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<Print_Array>:
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    1159 <Print_Array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Print_Array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print_Array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <Print_Array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Print_Array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Print_Array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @Print_Array(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%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 = tail call i32 @putchar(i32 10)
ret void
}