#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: emulator [options] <hex image file>\n");
  fprintf(stderr, "options:\n");
  fprintf(stderr,
          "  -v Verbose, will print register transfer traces to stdout\n");
  fprintf(stderr, "  -m Mode, one of:\n");
  fprintf(stderr, "     normal  Run to completion (default)\n");
  fprintf(stderr, "     cosim   Cosimulation validation mode\n");
  fprintf(stderr, "     gdb     Start GDB listener on port 8000\n");
  fprintf(stderr,
          "  -f <width>x<height> Display framebuffer output in window\n");
  fprintf(stderr, "  -d <filename>,<start>,<length>  Dump memory\n");
  fprintf(stderr, "  -b <filename> Load file into a virtual block device\n");
  fprintf(stderr, "  -t <num> Total threads (default 4)\n");
  fprintf(stderr, "  -c <size> Total amount of memory\n");
  fprintf(stderr,
          "  -r <cycles> Refresh rate, cycles between each screen update\n");
}


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>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xf0f(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xf24(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xf3a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
lea    0xf53(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xf7a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
lea    0xf94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xfb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
lea    0xfc7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
lea    0xfd6(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf28(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2e(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf4a(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf67(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf87(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfd6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfff(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1017(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x102d(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: emulator [options] <hex image file>\0A\00"
@.str.1 = [10 x i8] c"options:\0A\00"
@.str.2 = [61 x i8] c" -v Verbose, will print register transfer traces to stdout\0A\00"
@.str.3 = [20 x i8] c" -m Mode, one of:\0A\00"
@.str.4 = [42 x i8] c" normal Run to completion (default)\0A\00"
@.str.5 = [43 x i8] c" cosim Cosimulation validation mode\0A\00"
@.str.6 = [46 x i8] c" gdb Start GDB listener on port 8000\0A\00"
@.str.7 = [60 x i8] c" -f <width>x<height> Display framebuffer output in window\0A\00"
@.str.8 = [47 x i8] c" -d <filename>,<start>,<length> Dump memory\0A\00"
@.str.9 = [55 x i8] c" -b <filename> Load file into a virtual block device\0A\00"
@.str.10 = [38 x i8] c" -t <num> Total threads (default 4)\0A\00"
@.str.11 = [36 x i8] c" -c <size> Total amount of memory\0A\00"
@.str.12 = [63 x i8] c" -r <cycles> Refresh rate, cycles between each screen update\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: emulator [options] <hex image file>\0A\00"
@.str.1 = [10 x i8] c"options:\0A\00"
@.str.2 = [61 x i8] c" -v Verbose, will print register transfer traces to stdout\0A\00"
@.str.3 = [20 x i8] c" -m Mode, one of:\0A\00"
@.str.4 = [42 x i8] c" normal Run to completion (default)\0A\00"
@.str.5 = [43 x i8] c" cosim Cosimulation validation mode\0A\00"
@.str.6 = [46 x i8] c" gdb Start GDB listener on port 8000\0A\00"
@.str.7 = [60 x i8] c" -f <width>x<height> Display framebuffer output in window\0A\00"
@.str.8 = [47 x i8] c" -d <filename>,<start>,<length> Dump memory\0A\00"
@.str.9 = [55 x i8] c" -b <filename> Load file into a virtual block device\0A\00"
@.str.10 = [38 x i8] c" -t <num> Total threads (default 4)\0A\00"
@.str.11 = [36 x i8] c" -c <size> Total amount of memory\0A\00"
@.str.12 = [63 x i8] c" -r <cycles> Refresh rate, cycles between each screen update\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0))
ret void
}