xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ puts(char *);
void sig_handle(int signum) {
  puts("signal ALARM received");
  alarm(1);
}


x86 assembly (clang, -O0):
<sig_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"signal ALARM received\00"
define void @sig_handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"signal ALARM received\00"
define void @sig_handle(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @alarm(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int rename(char *, char *);
int main(void) {
  int result;
  result = rename("test.txt", "test1.txt");
  if (result < 0) {
    printf("rename failed!\n");
    return -1;
  } else {
    printf("rename success!\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1040 <rename@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1167 <main+0x47>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <main+0x5a>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1040 <rename@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xee4(%rip),%rax
lea    0xecd(%rip),%rdi
cmovs  %rax,%rdi
sar    $0x1f,%ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [10 x i8] c"test1.txt\00"
@.str.2 = [16 x i8] c"rename failed!\0A\00"
@.str.3 = [17 x i8] c"rename success!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @rename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [10 x i8] c"test1.txt\00"
@str = [16 x i8] c"rename success!\00"
@str.4 = [15 x i8] c"rename failed!\00"
define i32 @main() {
%1 = tail call i32 @rename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp slt i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0)
%4 = ashr i32 %1, 31
%5 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ get_random_bytes(unsigned long *, int);
unsigned long get_random_long(void) {
  unsigned long tmp;
  get_random_bytes(&tmp, sizeof(tmp));
  return tmp;
}


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

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

LLVM IR (-O0):
define i64 @get_random_long() {
%1 = alloca i64
%2 = call i32 @get_random_bytes(i64* %1, i32 8)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_random_long() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @get_random_bytes(i64* %1, i32 8)
%4 = load i64, i64* %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ bug1();
int /*<<< orphan*/ bug2();
int /*<<< orphan*/ bug3();
int /*<<< orphan*/ bug4();
int /*<<< orphan*/ bug5();
int main(void) {
  bug1();
  bug2();
  bug3();
  bug4();
  bug5();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bug1@plt>
mov    $0x0,%al
call   1060 <bug2@plt>
mov    $0x0,%al
call   1050 <bug3@plt>
mov    $0x0,%al
call   1070 <bug4@plt>
mov    $0x0,%al
call   1040 <bug5@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bug1@plt>
xor    %eax,%eax
call   1060 <bug2@plt>
xor    %eax,%eax
call   1050 <bug3@plt>
xor    %eax,%eax
call   1070 <bug4@plt>
xor    %eax,%eax
call   1040 <bug5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bug1()
%3 = call i32 (...) @bug2()
%4 = call i32 (...) @bug3()
%5 = call i32 (...) @bug4()
%6 = call i32 (...) @bug5()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bug1()
%2 = tail call i32 (...) @bug2()
%3 = tail call i32 (...) @bug3()
%4 = tail call i32 (...) @bug4()
%5 = tail call i32 (...) @bug5()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _m_from_int(int);
__m64 test_m_from_int(int a) { return _m_from_int(a); }


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

x86 assembly (clang, -O2):
<test_m_from_int>:
jmp    1030 <_m_from_int@plt>

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

LLVM IR (-O2):
define i32 @test_m_from_int(i32 %0) {
%2 = tail call i32 @_m_from_int(i32 %0)
ret i32 %2
}
int ls_costN_nm3_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm3_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm3_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ STOP_SELF();
void exit(int rc) { STOP_SELF(); }


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

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

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @STOP_SELF()
unreachable
}
unsigned int ima_quantize(int step, int diff) {
  unsigned int sign = (diff < 0) ? 8 : 0;
  unsigned int code;
  if (sign)
    diff = -diff;
  code = 4 * diff / step;
  if (code > 7)
    code = 7;
  return code | sign;
}


x86 assembly (clang, -O0):
<ima_quantize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x8,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112f <ima_quantize+0x2f>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jbe    114d <ima_quantize+0x4d>
movl   $0x7,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ima_quantize>:
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
shr    $0x1c,%esi
and    $0xfffffff8,%esi
shl    $0x2,%eax
cltd
idiv   %edi
cmp    $0x7,%eax
mov    $0x7,%ecx
cmovae %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @ima_quantize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 8, i32 0
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = sub nsw i32 0, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %4
%18 = mul nsw i32 4, %17
%19 = load i32, i32* %3
%20 = sdiv i32 %18, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = icmp ugt i32 %21, 7
br i1 %22, label %23, label %24
23: ; preds = %16
store i32 7, i32* %6
br label %24
24: ; preds = %23, %16
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = or i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @ima_quantize(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = lshr i32 %1, 28
%5 = and i32 %4, 8
%6 = shl nsw i32 %3, 2
%7 = sdiv i32 %6, %0
%8 = icmp ult i32 %7, 7
%9 = select i1 %8, i32 %7, i32 7
%10 = or i32 %9, %5
ret i32 %10
}
void nseel_asm_add(void) { __asm__("fadd\n"); }


x86 assembly (clang, -O0):
<nseel_asm_add>:
push   %rbp
mov    %rsp,%rbp
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_add>:
faddp  %st,%st(1)
ret

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

LLVM IR (-O2):
define void @nseel_asm_add() {
tail call void asm sideeffect "fadd\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ process_destroy(unsigned int);
void vfs_destroy(unsigned int process) { process_destroy(process); }


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

x86 assembly (clang, -O2):
<vfs_destroy>:
jmp    1030 <process_destroy@plt>

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

LLVM IR (-O2):
define void @vfs_destroy(i32 %0) {
%2 = tail call i32 @process_destroy(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void _fix32_encode(uint32_t v, uint8_t *buffer) {
  buffer[0] = (uint8_t)v;
  buffer[1] = (uint8_t)(v >> 8);
  buffer[2] = (uint8_t)(v >> 16);
  buffer[3] = (uint8_t)(v >> 24);
}


x86 assembly (clang, -O0):
<_fix32_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fix32_encode>:
movslq %edi,%rax
mov    %rax,(%rsi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rsi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rsi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rsi)
ret

LLVM IR (-O0):
define void @_fix32_encode(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 0
store i64 %6, i64* %8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = sext i32 %10 to i64
%12 = load i64*, i64** %4
%13 = getelementptr inbounds i64, i64* %12, i64 1
store i64 %11, i64* %13
%14 = load i32, i32* %3
%15 = ashr i32 %14, 16
%16 = sext i32 %15 to i64
%17 = load i64*, i64** %4
%18 = getelementptr inbounds i64, i64* %17, i64 2
store i64 %16, i64* %18
%19 = load i32, i32* %3
%20 = ashr i32 %19, 24
%21 = sext i32 %20 to i64
%22 = load i64*, i64** %4
%23 = getelementptr inbounds i64, i64* %22, i64 3
store i64 %21, i64* %23
ret void
}

LLVM IR (-O2):
define void @_fix32_encode(i32 %0, i64* nocapture writeonly %1) {
%3 = sext i32 %0 to i64
store i64 %3, i64* %1
%4 = ashr i32 %0, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %5, i64* %6
%7 = ashr i32 %0, 16
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %1, i64 2
store i64 %8, i64* %9
%10 = ashr i32 %0, 24
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %1, i64 3
store i64 %11, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(int argc, char **argv) {
  (void)argc;
  fprintf(stderr, "USAGE: `%s' <lhalotree file>\n", argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"USAGE: `%s' <lhalotree file>\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @stderr
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"USAGE: `%s' <lhalotree file>\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
void foo588() {}


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

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

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

LLVM IR (-O2):
define void @foo588() {
ret void
}
void disableLCDDisplay(void) {
  (*(volatile unsigned int *)(0x77100000)) &= ~3;
  (*(volatile unsigned int *)(0x77100020)) &= ~1;
  return;
}


x86 assembly (clang, -O0):
<disableLCDDisplay>:
push   %rbp
mov    %rsp,%rbp
mov    $0x77100000,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    $0x77100000,%eax
mov    %ecx,(%rax)
mov    $0x77100020,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x77100020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disableLCDDisplay>:
andl   $0xfffffffc,0x77100000
fc
andl   $0xfffffffe,0x77100020
fe
ret

LLVM IR (-O0):
define void @disableLCDDisplay() {
%1 = load volatile i32, i32* inttoptr (i64 1997537280 to i32*)
%2 = and i32 %1, -4
store volatile i32 %2, i32* inttoptr (i64 1997537280 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1997537312 to i32*)
%4 = and i32 %3, -2
store volatile i32 %4, i32* inttoptr (i64 1997537312 to i32*)
ret void
}

LLVM IR (-O2):
define void @disableLCDDisplay() {
%1 = load volatile i32, i32* inttoptr (i64 1997537280 to i32*)
%2 = and i32 %1, -4
store volatile i32 %2, i32* inttoptr (i64 1997537280 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 1997537312 to i32*)
%4 = and i32 %3, -2
store volatile i32 %4, i32* inttoptr (i64 1997537312 to i32*)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t clr_xlow_0_trail_1s(uint64_t u) { return (u + 1) ^ u; }


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

x86 assembly (clang, -O2):
<clr_xlow_0_trail_1s>:
lea    0x1(%rdi),%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clr_xlow_0_trail_1s(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = xor i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void spaces(int n) {
  while (n--)
    putchar(' ');
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <spaces+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %rbx
test   %edi,%edi
je     112f <spaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @spaces(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @spaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void flush(void) {
  while (((*(volatile unsigned int *)0xc11084cc) & (1 << 22)) == 0)
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0xc11084cc,%eax
mov    (%rax),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
jne    113a <flush+0x2a>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
mov    $0xc11084cc,%ebx
testl  $0x400000,(%rbx)
jne    112f <flush+0x1f>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <barrier@plt>
testl  $0x400000,(%rbx)
je     1120 <flush+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 3239085260 to i32*)
%3 = and i32 %2, 4194304
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @barrier()
br label %1
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = load volatile i32, i32* inttoptr (i64 3239085260 to i32*)
%2 = and i32 %1, 4194304
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = tail call i32 (...) @barrier()
%6 = load volatile i32, i32* inttoptr (i64 3239085260 to i32*)
%7 = and i32 %6, 4194304
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd7() {
  Assert_real((isgraph(215) == 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_isgraph.c",
              1080, ("isgraph should be 0 for 0xd7"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd7>:
push   %rax
mov    $0xd7,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x438,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd7\00"
define void @t_isgraph_0xd7() {
%1 = call i64 @isgraph(i32 215)
%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 1080, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd7\00"
define void @t_isgraph_0xd7() {
%1 = tail call i64 @isgraph(i32 215)
%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 1080, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int levelUpLimit(int level) {
  switch (level) {
  case 2:
    return 100;
  case 3:
    return 260;
  case 4:
    return 500;
  default:
    return 5000;
  }
}


x86 assembly (clang, -O0):
<levelUpLimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     113d <levelUpLimit+0x3d>
jmp    111b <levelUpLimit+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1149 <levelUpLimit+0x49>
jmp    112c <levelUpLimit+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1155 <levelUpLimit+0x55>
jmp    1161 <levelUpLimit+0x61>
movl   $0x64,-0x4(%rbp)
jmp    1168 <levelUpLimit+0x68>
movl   $0x104,-0x4(%rbp)
jmp    1168 <levelUpLimit+0x68>
movl   $0x1f4,-0x4(%rbp)
jmp    1168 <levelUpLimit+0x68>
movl   $0x1388,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<levelUpLimit>:
add    $0xfffffffe,%edi
mov    $0x1388,%eax
cmp    $0x2,%edi
ja     111a <levelUpLimit+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @levelUpLimit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 2, label %5
i32 3, label %6
i32 4, label %7
]
5: ; preds = %1
store i32 100, i32* %2
br label %9
6: ; preds = %1
store i32 260, i32* %2
br label %9
7: ; preds = %1
store i32 500, i32* %2
br label %9
8: ; preds = %1
store i32 5000, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.levelUpLimit = [3 x i32] [i32 100, i32 260, i32 500]
define i32 @levelUpLimit(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.levelUpLimit, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 5000, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t hashfn_int32_tw(int32_t key) {
  key += ~(key << 15);
  key ^= (key >> 10);
  key += (key << 3);
  key ^= (key >> 6);
  key += ~(key << 11);
  key ^= (key >> 16);
  return key;
}


x86 assembly (clang, -O0):
<hashfn_int32_tw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
xor    $0xffffffff,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfn_int32_tw>:
mov    %edi,%eax
shl    $0xf,%eax
not    %eax
add    %edi,%eax
mov    %eax,%ecx
sar    $0xa,%ecx
xor    %eax,%ecx
lea    (%rcx,%rcx,8),%eax
mov    %eax,%ecx
sar    $0x6,%ecx
xor    %eax,%ecx
mov    %ecx,%edx
shl    $0xb,%edx
not    %edx
add    %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hashfn_int32_tw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 15
%5 = xor i32 %4, -1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 10
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = shl i32 %12, 3
%14 = load i32, i32* %2
%15 = add nsw i32 %14, %13
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = ashr i32 %16, 6
%18 = load i32, i32* %2
%19 = xor i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = shl i32 %20, 11
%22 = xor i32 %21, -1
%23 = load i32, i32* %2
%24 = add nsw i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 16
%27 = load i32, i32* %2
%28 = xor i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @hashfn_int32_tw(i32 %0) {
%2 = shl i32 %0, 15
%3 = xor i32 %2, -1
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 10
%6 = xor i32 %5, %4
%7 = mul i32 %6, 9
%8 = ashr i32 %7, 6
%9 = xor i32 %8, %7
%10 = shl i32 %9, 11
%11 = xor i32 %10, -1
%12 = add nsw i32 %9, %11
%13 = ashr i32 %12, 16
%14 = xor i32 %13, %12
ret i32 %14
}
int test_bitReverse(int x) {
  int result = 0;
  int i;
  for (i = 0; i < 32; i++) {
    int bit = (x >> i) & 0x1;
    int pos = 31 - i;
    result |= bit << pos;
  }
  return result;
}


x86 assembly (clang, -O0):
<test_bitReverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1154 <test_bitReverse+0x54>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1f,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <test_bitReverse+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bitReverse>:
xor    %eax,%eax
mov    $0x1c,%r8d
xor    %r9d,%r9d
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
mov    %r9d,%ecx
shr    %cl,%edx
and    $0x1,%edx
lea    0x3(%r8),%ecx
shl    %cl,%edx
lea    0x1(%r9),%ecx
mov    %edi,%r10d
shr    %cl,%r10d
and    $0x1,%r10d
lea    0x2(%r8),%ecx
shl    %cl,%r10d
lea    0x2(%r9),%ecx
mov    %edi,%esi
shr    %cl,%esi
or     %eax,%edx
or     %edx,%r10d
and    $0x1,%esi
lea    0x1(%r8),%ecx
shl    %cl,%esi
lea    0x3(%r9),%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
mov    %r8d,%ecx
shl    %cl,%eax
or     %esi,%eax
or     %r10d,%eax
add    $0xfffffffc,%r8d
add    $0x4,%r9d
cmp    $0x20,%r9d
jne    1110 <test_bitReverse+0x10>
ret

LLVM IR (-O0):
define i32 @test_bitReverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = and i32 %13, 1
store i32 %14, i32* %5
%15 = load i32, i32* %4
%16 = sub nsw i32 31, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = shl i32 %17, %18
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
br label %22
22: ; preds = %10
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %7
25: ; preds = %7
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @test_bitReverse(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %27, %2 ]
%4 = phi i32 [ 0, %1 ], [ %28, %2 ]
%5 = lshr i32 %0, %4
%6 = and i32 %5, 1
%7 = sub nuw nsw i32 31, %4
%8 = shl nuw i32 %6, %7
%9 = or i32 %8, %3
%10 = or i32 %4, 1
%11 = lshr i32 %0, %10
%12 = and i32 %11, 1
%13 = sub nsw i32 30, %4
%14 = shl nuw i32 %12, %13
%15 = or i32 %14, %9
%16 = or i32 %4, 2
%17 = lshr i32 %0, %16
%18 = and i32 %17, 1
%19 = sub nsw i32 29, %4
%20 = shl nuw i32 %18, %19
%21 = or i32 %20, %15
%22 = or i32 %4, 3
%23 = lshr i32 %0, %22
%24 = and i32 %23, 1
%25 = sub nsw i32 28, %4
%26 = shl nuw i32 %24, %25
%27 = or i32 %26, %21
%28 = add nuw nsw i32 %4, 4
%29 = icmp eq i32 %28, 32
br i1 %29, label %30, label %2
30: ; preds = %2
ret i32 %27
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int namecmp(const char *s, const char *t) { return strncmp(s, t, 14); }


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

x86 assembly (clang, -O2):
<namecmp>:
mov    $0xe,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @namecmp(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 @strncmp(i8* %5, i8* %6, i32 14)
ret i32 %7
}

LLVM IR (-O2):
define i32 @namecmp(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 14)
ret i32 %3
}
long initmultiplayersparms(long argc, char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @initmultiplayersparms(i64 %0, i8** nocapture readnone %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8_copybox(int, int, int, int, int, int);
void __svgalib_driver32_copybox(int x1, int y1, int w, int h, int x2, int y2) {
  __svgalib_driver8_copybox(x1 * 4, y1, w * 4, h, x2 * 4, y2);
}


x86 assembly (clang, -O0):
<__svgalib_driver32_copybox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x2,%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
shl    $0x2,%r8d
mov    -0x18(%rbp),%r9d
call   1030 <__svgalib_driver8_copybox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver32_copybox>:
shl    $0x2,%edi
shl    $0x2,%edx
shl    $0x2,%r8d
jmp    1030 <__svgalib_driver8_copybox@plt>

LLVM IR (-O0):
define void @__svgalib_driver32_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 4
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 4
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = mul nsw i32 %19, 4
%21 = load i32, i32* %12
%22 = call i32 @__svgalib_driver8_copybox(i32 %14, i32 %15, i32 %17, i32 %18, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver32_copybox(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl nsw i32 %0, 2
%8 = shl nsw i32 %2, 2
%9 = shl nsw i32 %4, 2
%10 = tail call i32 @__svgalib_driver8_copybox(i32 %7, i32 %1, i32 %8, i32 %3, i32 %9, i32 %5)
ret void
}
int countDigits(int n) {
  int count = 0;
  while (n != 0) {
    n /= 10;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <countDigits+0x34>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <countDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <countDigits+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <countDigits+0x10>
ret

LLVM IR (-O0):
define i32 @countDigits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @countDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? c + 0x20 : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 32
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit_error(char *);
void syntax_error(void) { exit_error("Usage: ataritosemu [-v] <binary.prg>"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: ataritosemu [-v] <binary.prg>\00"
define void @syntax_error() {
%1 = call i32 @exit_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: ataritosemu [-v] <binary.prg>\00"
define void @syntax_error() {
%1 = tail call i32 @exit_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int exp(int);
int internal_exp_i(int value) { return exp(value); }


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

x86 assembly (clang, -O2):
<internal_exp_i>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define i32 @internal_exp_i(i32 %0) {
%2 = tail call i32 @exp(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t get_sub_bucket_index(int64_t value, int32_t bucket_index,
                             int32_t unit_magnitude) {
  return (int32_t)(value >> (bucket_index + unit_magnitude));
}


x86 assembly (clang, -O0):
<get_sub_bucket_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sub_bucket_index>:
mov    %edi,%eax
lea    (%rsi,%rdx,1),%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @get_sub_bucket_index(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 = add nsw i32 %8, %9
%11 = ashr i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_sub_bucket_index(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = ashr i32 %0, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char *);
int pthread_mutexattr_init(int /*<<< orphan*/ *);
char *strerror(int);
int PTHREAD_MUTEXATTR_INIT(pthread_mutexattr_t *a) {
  int err;
  if (err = pthread_mutexattr_init(a)) {
    printf("%s\n", strerror(err));
    abort();
  }
}


x86 assembly (clang, -O0):
<PTHREAD_MUTEXATTR_INIT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutexattr_init@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     117f <PTHREAD_MUTEXATTR_INIT+0x3f>
mov    -0x14(%rbp),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PTHREAD_MUTEXATTR_INIT>:
push   %rax
call   1050 <pthread_mutexattr_init@plt>
test   %eax,%eax
jne    114c <PTHREAD_MUTEXATTR_INIT+0xc>
pop    %rcx
ret
mov    %eax,%edi
call   1060 <strerror@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @PTHREAD_MUTEXATTR_INIT(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @pthread_mutexattr_init(i32* %5)
store i32 %6, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %4
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @PTHREAD_MUTEXATTR_INIT(i32* %0) {
%2 = tail call i32 @pthread_mutexattr_init(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @strerror(i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret i32 undef
}
unsigned long compact_gap(unsigned int order) { return 2UL << order; }


x86 assembly (clang, -O0):
<compact_gap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compact_gap>:
mov    %edi,%ecx
mov    $0x2,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @compact_gap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 2, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @compact_gap(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl i64 2, %2
ret i64 %3
}
void INT_Excep_IRQ1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_IRQ1() {
ret void
}
/* Variables and functions */
int GLUT_LEFT;
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int);
void entry(int state) {
  if (state == GLUT_LEFT)
    printf("LEFT %d\n", glutGetWindow());
  else
    printf("entered %d\n", glutGetWindow());
}


x86 assembly (clang, -O0):
<entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <entry+0x37>
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
jmp    116c <entry+0x4c>
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entry>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
cmp    %ebx,%ebp
lea    0xec2(%rip),%rcx
lea    0xec4(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@GLUT_LEFT = global i32 0
@.str = [9 x i8] c"LEFT %d\0A\00"
@.str.1 = [12 x i8] c"entered %d\0A\00"
define void @entry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @GLUT_LEFT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 (...) @glutGetWindow()
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = call i32 (...) @glutGetWindow()
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@GLUT_LEFT = global i32 0
@.str = [9 x i8] c"LEFT %d\0A\00"
@.str.1 = [12 x i8] c"entered %d\0A\00"
define void @entry(i32 %0) {
%2 = load i32, i32* @GLUT_LEFT
%3 = icmp eq i32 %2, %0
%4 = tail call i32 (...) @glutGetWindow()
%5 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 %4)
ret void
}
int cairo_code_draw_envMinimumLabel_get_height() { return 65; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envMinimumLabel_get_height() {
ret i32 65
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envMinimumLabel_get_height() {
ret i32 65
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int xdbg_func_null(const char *format, va_list ap) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xdbg_func_null(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int do_711() { return 711; }


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

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

LLVM IR (-O0):
define i32 @do_711() {
ret i32 711
}

LLVM IR (-O2):
define i32 @do_711() {
ret i32 711
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/, char const *,
                                          int /*<<< orphan*/);
void wl_registry_send_global(struct wl_resource *resource_, uint32_t name,
                             const char *interface, uint32_t version) {
  wl_resource_post_event(resource_, 0, name, interface, version);
}


x86 assembly (clang, -O0):
<wl_registry_send_global>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %esi,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_registry_send_global>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_registry_send_global(%struct.wl_resource* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.wl_resource*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.wl_resource*, %struct.wl_resource** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @wl_resource_post_event(%struct.wl_resource* %9, i32 0, i32 %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_registry_send_global(%struct.wl_resource* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, i32 %1, i8* %2, i32 %3)
ret void
}
double Tween_LinearEasing(double k) { return k; }


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

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

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

LLVM IR (-O2):
define double @Tween_LinearEasing(double returned %0) {
ret double %0
}