#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*/ EXIT_FAILURE;
int /*<<< orphan*/ banner();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  banner();
  printf("Syntax: bmp2cgb.exe [options] picture[.bmp]\n\n");
  printf("Options:\n");
  printf("\t-c    disable character optimization\n");
  printf("\t-x    disable horizontal flip optimization\n");
  printf("\t-y    disable vertical flip optimization\n");
  printf("\t-z    disable horizontal & vertical flip optimization\n");
  printf("\t-o    disable palette optimization\n");
  printf("\n");
  printf("\t-e#   expand map width to 32 blocks using character (0-255)\n");
  printf("\t-m#   map padding - starting character (1-511)\n");
  printf("\t-p#   palette padding - starting slot (1-7)\n");
  printf(
      "\t-r    rebase character map to $8800-$97FF ($8000-$8FFF is default)\n");
  printf("\n");
  printf("\t-d    extended debug information without data output\n");
  printf(
      "\t-s#   sprites output (transparent color RGB hex value ie. 4682b4)\n");
  printf("\t-t    RGBTuner ROM image output\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <banner@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
call   1030 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
lea    0xf72(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa4(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc9(%rip),%rdi
call   1030 <printf@plt>
lea    0xfeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
lea    0x1018(%rip),%rdi
call   1030 <printf@plt>
lea    0x1043(%rip),%rdi
call   1030 <printf@plt>
lea    0x107b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1050 <banner@plt>
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
lea    0xf27(%rip),%rdi
call   1040 <puts@plt>
lea    0xf52(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf60(%rip),%rdi
call   1040 <puts@plt>
lea    0xf91(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb5(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd6(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1004(%rip),%rdi
call   1040 <puts@plt>
lea    0x102e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1065(%rip),%rdi
call   1040 <puts@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Syntax: bmp2cgb.exe [options] picture[.bmp]\0A\0A\00"
@.str.1 = [10 x i8] c"Options:\0A\00"
@.str.2 = [39 x i8] c"\09-c disable character optimization\0A\00"
@.str.3 = [45 x i8] c"\09-x disable horizontal flip optimization\0A\00"
@.str.4 = [43 x i8] c"\09-y disable vertical flip optimization\0A\00"
@.str.5 = [56 x i8] c"\09-z disable horizontal & vertical flip optimization\0A\00"
@.str.6 = [37 x i8] c"\09-o disable palette optimization\0A\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [62 x i8] c"\09-e# expand map width to 32 blocks using character (0-255)\0A\00"
@.str.9 = [49 x i8] c"\09-m# map padding - starting character (1-511)\0A\00"
@.str.10 = [46 x i8] c"\09-p# palette padding - starting slot (1-7)\0A\00"
@.str.11 = [69 x i8] c"\09-r rebase character map to $8800-$97FF ($8000-$8FFF is default)\0A\00"
@.str.12 = [55 x i8] c"\09-d extended debug information without data output\0A\00"
@.str.13 = [68 x i8] c"\09-s# sprites output (transparent color RGB hex value ie. 4682b4)\0A\00"
@.str.14 = [34 x i8] c"\09-t RGBTuner ROM image output\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = call i32 (...) @banner()
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.12, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.13, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [45 x i8] c"Syntax: bmp2cgb.exe [options] picture[.bmp]\0A\00"
@str.15 = [9 x i8] c"Options:\00"
@str.16 = [38 x i8] c"\09-c disable character optimization\00"
@str.17 = [44 x i8] c"\09-x disable horizontal flip optimization\00"
@str.18 = [42 x i8] c"\09-y disable vertical flip optimization\00"
@str.19 = [55 x i8] c"\09-z disable horizontal & vertical flip optimization\00"
@str.20 = [36 x i8] c"\09-o disable palette optimization\00"
@str.21 = [61 x i8] c"\09-e# expand map width to 32 blocks using character (0-255)\00"
@str.22 = [48 x i8] c"\09-m# map padding - starting character (1-511)\00"
@str.23 = [45 x i8] c"\09-p# palette padding - starting slot (1-7)\00"
@str.24 = [68 x i8] c"\09-r rebase character map to $8800-$97FF ($8000-$8FFF is default)\00"
@str.25 = [54 x i8] c"\09-d extended debug information without data output\00"
@str.26 = [67 x i8] c"\09-s# sprites output (transparent color RGB hex value ie. 4682b4)\00"
@str.27 = [33 x i8] c"\09-t RGBTuner ROM image output\00"
define void @usage() {
%1 = tail call i32 (...) @banner()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.16, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.25, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str.26, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.27, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
}