xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "Usage: inet [-n topology_size] [-d fraction of "
                  "degree_one_nodes]\n            [-p plane_dimension] [-s "
                  "seed] [-f debug_output] [-V(sersion)]\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: inet [-n topology_size] [-d fraction of degree_one_nodes]\0A [-p plane_dimension] [-s seed] [-f debug_output] [-V(sersion)]\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: inet [-n topology_size] [-d fraction of degree_one_nodes]\0A [-p plane_dimension] [-s seed] [-f debug_output] [-V(sersion)]\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long increment(long in) { return in + 1; }


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

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @increment(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @increment(i64 %0) {
%2 = add nsw i64 %0, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ trap_UI_ClosePopup(char *);
void CG_CloseLimbo_f(void) { trap_UI_ClosePopup("UIMENU_WM_LIMBO"); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"UIMENU_WM_LIMBO\00"
define void @CG_CloseLimbo_f() {
%1 = tail call i32 @trap_UI_ClosePopup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_string(char *);
void send_resign() { write_string("resign\n"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"resign\0A\00"
define void @send_resign() {
%1 = tail call i32 @write_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void BN_free(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_free() {
ret void
}
long long callee(i)
long long i;
{
  register long long result;
  result = 0x12345678;
  result = result << i;
  result += 0x9abcdef0;
  return result;
}


x86 assembly (clang, -O0):
<callee>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x12345678,-0x10(%rbp)
12
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    %cl,%rax
mov    %rax,-0x10(%rbp)
movabs $0x9abcdef0,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<callee>:
mov    %rdi,%rcx
mov    $0x12345678,%edx
shl    %cl,%rdx
mov    $0x9abcdef0,%eax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @callee(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 305419896, i64* %3
%4 = load i64, i64* %3
%5 = load i64, i64* %2
%6 = shl i64 %4, %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add nsw i64 %7, 2596069104
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @callee(i64 %0) {
%2 = shl i64 305419896, %0
%3 = add nsw i64 %2, 2596069104
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  f(5);
  int y = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit2(int);
void empty_return() {
  int i = 0;
  (void)(i);
  exit2(-1);
}


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

x86 assembly (clang, -O2):
<empty_return>:
mov    $0xffffffff,%edi
jmp    1030 <exit2@plt>

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

LLVM IR (-O2):
define void @empty_return() {
%1 = tail call i32 @exit2(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *x) {
  fprintf(stderr, "Usage: %s <file>\n", x);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s <file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ draw_img_point(void *, int, int, int);
void wipe_image(void *img) {
  for (int i = 0; i < 1000; i++)
    for (int k = 0; k < 1000; k++)
      draw_img_point(img, i, k, 0x000000);
}


x86 assembly (clang, -O0):
<wipe_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1176 <wipe_image+0x66>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    1163 <wipe_image+0x53>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %ecx,%ecx
call   1030 <draw_img_point@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <wipe_image+0x27>
jmp    1168 <wipe_image+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <wipe_image+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wipe_image>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1030 <draw_img_point@plt>
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1130 <wipe_image+0x20>
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1120 <wipe_image+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @wipe_image(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %24
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %17, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 1000
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @draw_img_point(i8* %13, i32 %14, i32 %15, i32 0)
br label %17
17: ; preds = %12
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %9
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %5
24: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wipe_image(i8* %0) {
br label %2
2: ; preds = %1, %5
%3 = phi i32 [ 0, %1 ], [ %6, %5 ]
br label %8
4: ; preds = %5
ret void
5: ; preds = %8
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %4, label %2
8: ; preds = %2, %8
%9 = phi i32 [ 0, %2 ], [ %11, %8 ]
%10 = tail call i32 @draw_img_point(i8* %0, i32 %3, i32 %9, i32 0)
%11 = add nuw nsw i32 %9, 1
%12 = icmp eq i32 %11, 1000
br i1 %12, label %5, label %8
}
/* Variables and functions */
int /*<<< orphan*/ check(int *);
int *getPointer();
void testStoreCheck(int *a) {
  a = getPointer();
  check(a);
  *a = 1;
}


x86 assembly (clang, -O0):
<testStoreCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getPointer@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <check@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testStoreCheck>:
push   %rbx
xor    %eax,%eax
call   1040 <getPointer@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <check@plt>
movl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @testStoreCheck(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32* (...) @getPointer()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @check(i32* %4)
%6 = load i32*, i32** %2
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @testStoreCheck(i32* nocapture readnone %0) {
%2 = tail call i32* (...) @getPointer()
%3 = tail call i32 @check(i32* %2)
store i32 1, i32* %2
ret void
}
/* Type definitions */
struct utmp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ t2p_orig_getutent();
struct utmp *time2posix_utmp(int /*<<< orphan*/);
struct utmp *getutent(void) {
  return time2posix_utmp(t2p_orig_getutent());
}


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

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

LLVM IR (-O0):
%struct.utmp = type { i32 }
define %struct.utmp* @getutent() {
%1 = call i32 (...) @t2p_orig_getutent()
%2 = call %struct.utmp* @time2posix_utmp(i32 %1)
ret %struct.utmp* %2
}

LLVM IR (-O2):
%struct.utmp = type { i32 }
define %struct.utmp* @getutent() {
%1 = tail call i32 (...) @t2p_orig_getutent()
%2 = tail call %struct.utmp* @time2posix_utmp(i32 %1)
ret %struct.utmp* %2
}
int is5xx(int status) { return ((status >= 500) && (status < 600)); }


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

x86 assembly (clang, -O2):
<is5xx>:
add    $0xfffffe0c,%edi
xor    %eax,%eax
cmp    $0x64,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is5xx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 500
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 600
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 @is5xx(i32 %0) {
%2 = add i32 %0, -500
%3 = icmp ult i32 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int syscall_rval1();
int syscall_rval2();
int main(void) {
  int ret = 0;
  ret |= syscall_rval1();
  ret |= syscall_rval2();
  if (ret != 0)
    fprintf(stderr, "FAIL\n");
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <syscall_rval1@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <syscall_rval2@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117f <main+0x4f>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <syscall_rval1@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <syscall_rval2@plt>
mov    %eax,%ebx
or     %ebp,%ebx
je     115e <main+0x2e>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"FAIL\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @syscall_rval1()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @syscall_rval2()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %0
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"FAIL\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @syscall_rval1()
%2 = tail call i32 (...) @syscall_rval2()
%3 = or i32 %2, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ readsector_hd(int, int, char *);
void readblock_hd(int hd, int blockno, char *buffer) {
  readsector_hd(hd, blockno * 2, buffer);
  readsector_hd(hd, blockno * 2 + 1, buffer + 512);
}


x86 assembly (clang, -O0):
<readblock_hd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1030 <readsector_hd@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
add    $0x200,%rdx
call   1030 <readsector_hd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readblock_hd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
lea    (%r14,%r14,1),%esi
call   1030 <readsector_hd@plt>
lea    (%r14,%r14,1),%esi
add    $0x1,%esi
add    $0x200,%rbx
mov    %ebp,%edi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <readsector_hd@plt>

LLVM IR (-O0):
define void @readblock_hd(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 2
%10 = load i8*, i8** %6
%11 = call i32 @readsector_hd(i32 %7, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 2
%15 = add nsw i32 %14, 1
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 512
%18 = call i32 @readsector_hd(i32 %12, i32 %15, i8* %17)
ret void
}

LLVM IR (-O2):
define void @readblock_hd(i32 %0, i32 %1, i8* %2) {
%4 = shl nsw i32 %1, 1
%5 = tail call i32 @readsector_hd(i32 %0, i32 %4, i8* %2)
%6 = or i32 %4, 1
%7 = getelementptr inbounds i8, i8* %2, i64 512
%8 = tail call i32 @readsector_hd(i32 %0, i32 %6, i8* %7)
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buffer *);
void buffer_close(struct buffer *buffer) { free(buffer); }


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

x86 assembly (clang, -O2):
<buffer_close>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_close(%struct.buffer* nocapture %0) {
%2 = tail call i32 @free(%struct.buffer* %0)
ret void
}
/* Type definitions */
struct sStreamCodec {
  int dummy;
};

/* Variables and functions */
scalar_t__ StreamDecoder_GetU32(struct sStreamCodec *);
signed long StreamDecoder_GetS32(struct sStreamCodec *p) {
  return (signed long)StreamDecoder_GetU32(p);
}


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

x86 assembly (clang, -O2):
<StreamDecoder_GetS32>:
jmp    1030 <StreamDecoder_GetU32@plt>

LLVM IR (-O0):
%struct.sStreamCodec = type { i32 }
define i64 @StreamDecoder_GetS32(%struct.sStreamCodec* %0) {
%2 = alloca %struct.sStreamCodec*
store %struct.sStreamCodec* %0, %struct.sStreamCodec** %2
%3 = load %struct.sStreamCodec*, %struct.sStreamCodec** %2
%4 = call i64 @StreamDecoder_GetU32(%struct.sStreamCodec* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.sStreamCodec = type { i32 }
define i64 @StreamDecoder_GetS32(%struct.sStreamCodec* %0) {
%2 = tail call i64 @StreamDecoder_GetU32(%struct.sStreamCodec* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x9f() {
  Assert_real((isupper(159) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              800, ("isupper should be 0 for 0x9f"));
}


x86 assembly (clang, -O0):
<t_isupper_0x9f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9f,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x320,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x9f>:
push   %rax
mov    $0x9f,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x320,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9f\00"
define void @t_isupper_0x9f() {
%1 = call i64 @isupper(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9f\00"
define void @t_isupper_0x9f() {
%1 = tail call i64 @isupper(i32 159)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 800, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void native_runtime_configure(void *addr, int argc, char **argv) {
  void (*cb)(int, char **);
  *(void **)&(cb) = addr;
  cb(argc, argv);
}


x86 assembly (clang, -O0):
<native_runtime_configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_runtime_configure>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @native_runtime_configure(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca void (i32, i8**)*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = bitcast void (i32, i8**)** %7 to i8**
store i8* %8, i8** %9
%10 = load void (i32, i8**)*, void (i32, i8**)** %7
%11 = load i32, i32* %5
%12 = load i8**, i8*** %6
ret void
}

LLVM IR (-O2):
define void @native_runtime_configure(i8* nocapture %0, i32 %1, i8** %2) {
%4 = bitcast i8* %0 to void (i32, i8**)*
tail call void %4(i32 %1, i8** %2)
ret void
}
/* Type definitions */
struct subcommand {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ loadfile_usage(struct subcommand *);
int /*<<< orphan*/ printf(char *);
void loadsof_usage(struct subcommand *scp) {
  loadfile_usage(scp);
  printf("\n");
  printf("Note: if the file is not compressed it must end in. sof\n");
}


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

x86 assembly (clang, -O2):
<loadsof_usage>:
push   %rax
call   1040 <loadfile_usage@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1050 <puts@plt>

LLVM IR (-O0):
%struct.subcommand = type { i32 }
@.str = [2 x i8] c"\0A\00"
@.str.1 = [57 x i8] c"Note: if the file is not compressed it must end in. sof\0A\00"
define void @loadsof_usage(%struct.subcommand* %0) {
%2 = alloca %struct.subcommand*
store %struct.subcommand* %0, %struct.subcommand** %2
%3 = load %struct.subcommand*, %struct.subcommand** %2
%4 = call i32 @loadfile_usage(%struct.subcommand* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.subcommand = type { i32 }
@str = [56 x i8] c"Note: if the file is not compressed it must end in. sof\00"
define void @loadsof_usage(%struct.subcommand* %0) {
%2 = tail call i32 @loadfile_usage(%struct.subcommand* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MakeSymbol(int, long);
void DoPragma(void) { MakeSymbol(50, 1L); }


x86 assembly (clang, -O0):
<DoPragma>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
mov    $0x1,%esi
call   1030 <MakeSymbol@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoPragma>:
mov    $0x1,%esi
mov    $0x32,%edi
jmp    1030 <MakeSymbol@plt>

LLVM IR (-O0):
define void @DoPragma() {
%1 = call i32 @MakeSymbol(i32 50, i64 1)
ret void
}

LLVM IR (-O2):
define void @DoPragma() {
%1 = tail call i32 @MakeSymbol(i32 50, i64 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _f_setlong(unsigned char *, unsigned long);
unsigned char *_setlong(unsigned long num, unsigned char *ptr) {
  _f_setlong(ptr, num);
  return ptr + 4;
}


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

x86 assembly (clang, -O2):
<_setlong>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <_f_setlong@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_setlong(i64 %0, i8* %1) {
%3 = tail call i32 @_f_setlong(i8* %1, i64 %0)
%4 = getelementptr inbounds i8, i8* %1, i64 4
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ glutBitmapHelvetica10;
unsigned glob_glutBitmapHelvetica10(void) {
  return (unsigned)&glutBitmapHelvetica10;
}


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

x86 assembly (clang, -O2):
<glob_glutBitmapHelvetica10>:
mov    0x2eda(%rip),%eax
ret

LLVM IR (-O0):
@glutBitmapHelvetica10 = global i32 0
define i32 @glob_glutBitmapHelvetica10() {
ret i32 ptrtoint (i32* @glutBitmapHelvetica10 to i32)
}

LLVM IR (-O2):
@glutBitmapHelvetica10 = global i32 0
define i32 @glob_glutBitmapHelvetica10() {
ret i32 ptrtoint (i32* @glutBitmapHelvetica10 to i32)
}
/* Variables and functions */
void *m_malloc_(size_t, char *, int);
void *m_malloc_compat(size_t size) {
  return m_malloc_(size,
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/"
                   "heads/master/dg/z88dk/src/z80asm/lib/alloc.c",
                   253);
}


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

x86 assembly (clang, -O2):
<m_malloc_compat>:
lea    0xee9(%rip),%rsi
mov    $0xfd,%edx
jmp    1030 <m_malloc_@plt>

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/src/z80asm/lib/alloc.c\00"
define i8* @m_malloc_compat(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @m_malloc_(i64 %3, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 253)
ret i8* %4
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/src/z80asm/lib/alloc.c\00"
define i8* @m_malloc_compat(i64 %0) {
%2 = tail call i8* @m_malloc_(i64 %0, i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 253)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
int get_XGravityEvent_type(void *_p) {
  return (int)((XGravityEvent *)_p)->type;
}


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

x86 assembly (clang, -O2):
<get_XGravityEvent_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGravityEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGravityEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int ceil_log2_int32(int);
int get_bin_idx_for_alloc(int alloc_sz) {
  int idx = ceil_log2_int32(alloc_sz) - 5;
  ((void)0);
  if (idx >= (31 - 5 + 1))
    idx = (31 - 5 + 1) - 1;
  return idx;
}


x86 assembly (clang, -O0):
<get_bin_idx_for_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceil_log2_int32@plt>
sub    $0x5,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1b,-0x8(%rbp)
jl     113a <get_bin_idx_for_alloc+0x2a>
movl   $0x1a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bin_idx_for_alloc>:
push   %rax
call   1030 <ceil_log2_int32@plt>
cmp    $0x1f,%eax
mov    $0x1f,%ecx
cmovge %ecx,%eax
add    $0xfffffffb,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_bin_idx_for_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ceil_log2_int32(i32 %4)
%6 = sub nsw i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 27
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 26, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_bin_idx_for_alloc(i32 %0) {
%2 = tail call i32 @ceil_log2_int32(i32 %0)
%3 = icmp slt i32 %2, 31
%4 = select i1 %3, i32 %2, i32 31
%5 = add nsw i32 %4, -5
ret i32 %5
}
int test_imm_F5int32_mem(int *val) {
  return ((*val) & (0xF5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F5int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xf5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F5int32_mem>:
testb  $0xf5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F5int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 245
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char desaturate(unsigned char r, unsigned char g, unsigned char b) {
  return (r * 19661 + g * 38666 + b * 7209) / 65536;
}


x86 assembly (clang, -O0):
<desaturate>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x4ccd,%eax,%eax
movzbl -0x2(%rbp),%ecx
imul   $0x970a,%ecx,%ecx
add    %ecx,%eax
movzbl -0x3(%rbp),%ecx
imul   $0x1c29,%ecx,%ecx
add    %ecx,%eax
mov    $0x10000,%ecx
cltd
idiv   %ecx
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<desaturate>:
imul   $0x4ccd,%edi,%eax
imul   $0x970a,%esi,%ecx
add    %eax,%ecx
imul   $0x1c29,%edx,%eax
add    %ecx,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define zeroext i8 @desaturate(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %8, 19661
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 38666
%13 = add nsw i32 %9, %12
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = mul nsw i32 %15, 7209
%17 = add nsw i32 %13, %16
%18 = sdiv i32 %17, 65536
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @desaturate(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i32
%5 = mul nuw nsw i32 %4, 19661
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 38666
%8 = add nuw nsw i32 %7, %5
%9 = zext i8 %2 to i32
%10 = mul nuw nsw i32 %9, 7209
%11 = add nuw nsw i32 %8, %10
%12 = lshr i32 %11, 16
%13 = trunc i32 %12 to i8
ret i8 %13
}
OP(ed, bd) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ do_loops();
int /*<<< orphan*/ do_vars();
main() {
  do_loops();
  do_vars();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <do_loops@plt>
mov    $0x0,%al
call   1040 <do_vars@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @do_loops()
%2 = call i32 (...) @do_vars()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_loops()
%2 = tail call i32 (...) @do_vars()
ret i32 0
}
void supertwoxsai_generic_output(void *data, unsigned *out_width,
                                 unsigned *out_height, unsigned width,
                                 unsigned height) {
  *out_width = width * 2;
  *out_height = height * 2;
}


x86 assembly (clang, -O0):
<supertwoxsai_generic_output>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<supertwoxsai_generic_output>:
add    %ecx,%ecx
mov    %ecx,(%rsi)
add    %r8d,%r8d
mov    %r8d,(%rdx)
ret

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

LLVM IR (-O2):
define void @supertwoxsai_generic_output(i8* nocapture readnone %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = shl i32 %3, 1
store i32 %6, i32* %1
%7 = shl i32 %4, 1
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spxec_ifft(void *, float *, float *);
void spxec_ifft_float(void *table, float *in, float *out) {
  spxec_ifft(table, in, out);
}


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

x86 assembly (clang, -O2):
<spxec_ifft_float>:
jmp    1030 <spxec_ifft@plt>

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

LLVM IR (-O2):
define void @spxec_ifft_float(i8* %0, float* %1, float* %2) {
%4 = tail call i32 @spxec_ifft(i8* %0, float* %1, float* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
int test_callfunc4(char *dest, int n_args, int a1, int a2) {
  sprintf(dest, "%d %d %d", n_args, a1, a2);
  return n_args;
}


x86 assembly (clang, -O0):
<test_callfunc4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec6(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_callfunc4>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%ebx
lea    0xee1(%rip),%rsi
mov    %ebx,%edx
call   1030 <sprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @test_callfunc4(i8* nocapture writeonly %0, i32 returned %1, i32 %2, i32 %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rango(int);
int /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num1 = 1;
  while (num1 != 0) {
    printf("Ingrese un numero: ");
    scanf_s("%i", &num1);
    rango(num1);
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1189 <main+0x49>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf_s@plt>
mov    -0x8(%rbp),%edi
call   1050 <rango@plt>
jmp    1156 <main+0x16>
lea    0xe87(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xea8(%rip),%r14
lea    0xeb5(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf_s@plt>
mov    0xc(%rsp),%edi
call   1050 <rango@plt>
cmpl   $0x0,0xc(%rsp)
jne    1170 <main+0x30>
lea    0xe7d(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Ingrese un numero: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @rango(i32 %9)
br label %3
11: ; preds = %3
%12 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Ingrese un numero: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @rango(i32 %6)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ceil(int);
int k_comp(int e, int alpha, int gamma) {
  return ceil((alpha - e + 63) * 0.30102999566398114);
}


x86 assembly (clang, -O0):
<k_comp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x3f,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_comp>:
sub    %edi,%esi
add    $0x3f,%esi
cvtsi2sd %esi,%xmm0
mulsd  0xedf(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @k_comp(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* %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 63
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 0x3FD34413509F79FE
%13 = fptosi double %12 to i32
%14 = call i32 @ceil(i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @k_comp(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 63, %0
%5 = add i32 %4, %1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3FD34413509F79FE
%8 = fptosi double %7 to i32
%9 = tail call i32 @ceil(i32 %8)
ret i32 %9
}
void av_parse_video_size() {}


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

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

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

LLVM IR (-O2):
define void @av_parse_video_size() {
ret void
}
/* Variables and functions */
int cube(int);
int square(int);
int main(void) {
  int counter;
  int x = 3;
  for (counter = square(x); counter < 5; counter = cube(counter)) {
    int a = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <square@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1162 <main+0x42>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <cube@plt>
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <square@plt>
cmp    $0x4,%eax
jg     113c <main+0x1c>
mov    %eax,%edi
call   1040 <cube@plt>
cmp    $0x5,%eax
jl     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @square(i32 3)
%2 = icmp slt i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ %1, %0 ]
%5 = tail call i32 @cube(i32 %4)
%6 = icmp slt i32 %5, 5
br i1 %6, label %3, label %7
7: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int lower(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  for (int i = 'A'; i <= 'Z'; ++i) {
    printf("lower(%c) -> %c\n", i, lower(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <lower@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x41,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <lower@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x5b,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"lower(%c) -> %c\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 65, %0 ], [ %6, %2 ]
%4 = tail call i32 @lower(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 91
br i1 %7, label %1, label %2
}
/* Variables and functions */
int tree2a(int);
int tree2b(int);
int tree2c(int j) { return tree2a(j) + tree2b(j * 3); }


x86 assembly (clang, -O0):
<tree2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tree2a@plt>
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x4(%rbp),%edi
call   1040 <tree2b@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree2c>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <tree2a@plt>
mov    %eax,%ebp
lea    (%rbx,%rbx,2),%edi
call   1040 <tree2b@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @tree2c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @tree2a(i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 3
%7 = call i32 @tree2b(i32 %6)
%8 = add nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @tree2c(i32 %0) {
%2 = tail call i32 @tree2a(i32 %0)
%3 = mul nsw i32 %0, 3
%4 = tail call i32 @tree2b(i32 %3)
%5 = add nsw i32 %4, %2
ret i32 %5
}