#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;
int usage(void) {
  fprintf(stderr, "SwitchRes version %s by Chris Kennedy (C) 2010\n",
          "1.484-970a03a");
  fprintf(stderr, "Ported from code by Calamity to calculate modelines.\n\n");
  fprintf(stderr, "Build Date:   %s\n", "Sat Feb 19 22:01:35 CST 2011");
  fprintf(stderr, "Compiler:     GCC %s\n", "9.4.0");
  fprintf(stderr, "Build System: %s\n\n",
          "Linux mcp 2.6.38-rc4-git4+ #7 SMP Mon Feb 14 02:15:06 CST 2011 "
          "x86_64 Intel(R) Xeon(TM) CPU 3.40GHz GenuineIntel GNU/Linux");
  fprintf(stderr, "Usage: switchres <gamerom>\n");
  fprintf(stderr, "Usage: switchres <system> --emulator mess --rom <rom> "
                  "--args <mess cmdline>\n");
  fprintf(stderr, "Usage: switchres <width> <height> <refresh>\n");
  fprintf(stderr, "Usage: switchres --calc <gamerom>\n\n");
  fprintf(stderr, "  --verbose               Increases verbosity, can be "
                  "specified multiple times\n");
  fprintf(stderr,
          "  --logfile <file>        Write out all messages to a file\n");
  fprintf(stderr, "  --calc                  Calculate modeline and exit\n");
  fprintf(stderr, "  --monitor  <type>       Type of monitor %s\n",
          "[cga ega vga multi ntsc pal h9110 d9200 d9800]");
  fprintf(stderr, "  --mrange <settings>     Use custom monitor range, can "
                  "have multiple ones\n");
  fprintf(stderr,
          "  --showmrange            Show monitor range picked or main one\n");
  fprintf(stderr, "  --ymin <height>         Minimum height to use\n");
  fprintf(
      stderr,
      "  --vectorwidth <width>   Default width to use on Vector games (640)\n");
  fprintf(stderr, "  --vectorheight <height> Default height to use on Vector "
                  "games (480)\n");
  fprintf(stderr, "  --nodoublescan          Video card can't doublescan\n");
  fprintf(stderr, "  --nointerlace           Video card can't interlace\n");
  fprintf(stderr, "  --throttle              Can't sync to refresh rate, use "
                  "throttle in mame\n");
  fprintf(stderr, "  --threads               Use multithreading even with "
                  "vsync, requires special mame build\n");
  fprintf(
      stderr,
      "  --novsync               Weight for x/y instead of vertical refresh\n");
  fprintf(stderr, "  --noswitchres           Don't switch resolutions, just "
                  "use as wrapper to mame, best for LCD's\n");
  fprintf(stderr, "  --notriplebuffer        Use Mame option waitvsync instead "
                  "of triple buffer (Windows)\n");
  fprintf(stderr, "  --aspect num:den        Method of calculating width on "
                  "vertical games, default 4:3\n");
  fprintf(stderr, "  --mo [0|1|2]            Monitor Orientation, "
                  "0=horizontal, 1=vertical, 2=both/rotateable\n");
  fprintf(stderr, "  --dcalign <HZ>          Align dotclock to Hz (Windows "
                  "10000 Linux 1000)\n");
  fprintf(stderr, "  --ff                    Frogger/Galaxian Hack is in mame "
                  "executable\n");
  fprintf(stderr,
          "  --redraw                Redraw Hack is in mame executable\n");
  fprintf(stderr,
          "  --soundsync             Sound Sync Hack is in mame executable\n");
  fprintf(
      stderr,
      "  --cleanstretch          Cleanstretch Hack is in mame executable\n");
  fprintf(stderr, "  --modesfile <file>      Write out modelines to a file for "
                  "Soft15Khz\n");
  fprintf(stderr, "  --resfile <file>        Read modelines from a file, newer "
                  "ArcadeVGA Card\n");
  fprintf(stderr, "  --test                  Just test what would be done, no "
                  "res change or game\n");
  fprintf(stderr, "\nOptions for other emulators besides MAME:\n");
  fprintf(stderr,
          "  --emulator <exe>        Emulator to run, default is mame\n");
  fprintf(stderr, "  --xrandr                Use this if the emulator doesn't "
                  "switch resolutions\n");
  fprintf(stderr, "  --args <...>            Extra command line args to send "
                  "to emulator\n");
  fprintf(stderr, "  --rom <file>            ROM file, normal <gamerom> "
                  "becomes system type\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
lea    0xf05(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xefc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xf1c(%rip),%rsi
lea    0xf27(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xf2d(%rip),%rsi
lea    0xf3c(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xf2b(%rip),%rsi
lea    0xf37(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xf9b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xfa0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
lea    0xfd6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
lea    0xfec(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dda(%rip),%rax
mov    (%rax),%edi
lea    0xff9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
lea    0x1032(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
lea    0x1057(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    0x1077(%rip),%rsi
lea    0x109e(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d77(%rip),%rax
mov    (%rax),%edi
lea    0x10b6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0x10eb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
lea    0x1115(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d32(%rip),%rax
mov    (%rax),%edi
lea    0x112f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
lea    0x115e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d04(%rip),%rax
mov    (%rax),%edi
lea    0x118e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
lea    0x11ae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
lea    0x11cd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cbf(%rip),%rax
mov    (%rax),%edi
lea    0x1202(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ca8(%rip),%rax
mov    (%rax),%edi
lea    0x1246(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c91(%rip),%rax
mov    (%rax),%edi
lea    0x1275(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
lea    0x12bf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
lea    0x1300(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
lea    0x133f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
lea    0x1384(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c1e(%rip),%rax
mov    (%rax),%edi
lea    0x13b8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2c07(%rip),%rax
mov    (%rax),%edi
lea    0x13e8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%edi
lea    0x140e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bd9(%rip),%rax
mov    (%rax),%edi
lea    0x1438(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bc2(%rip),%rax
mov    (%rax),%edi
lea    0x1464(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2bab(%rip),%rax
mov    (%rax),%edi
lea    0x1494(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%edi
lea    0x14c9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b7d(%rip),%rax
mov    (%rax),%edi
lea    0x1501(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b66(%rip),%rax
mov    (%rax),%edi
lea    0x1516(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b4f(%rip),%rax
mov    (%rax),%edi
lea    0x153b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b38(%rip),%rax
mov    (%rax),%edi
lea    0x1573(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2b21(%rip),%rax
mov    (%rax),%edi
lea    0x15a3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
lea    0xf08(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf06(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2d(%rip),%rsi
lea    0xf38(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf45(%rip),%rsi
lea    0xf54(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf4a(%rip),%rsi
lea    0xf56(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfc1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfcd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x100a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1027(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x103b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x107b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10a7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10ce(%rip),%rsi
lea    0x10f5(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1114(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1150(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1181(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11a2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x11d8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x120f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1236(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x125c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1298(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x12e3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1319(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x136a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x13b2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x13f8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1444(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x147f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x14b6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x14e3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1514(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1547(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x157e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x15ba(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x15f9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1615(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1641(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1680(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x16b7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"SwitchRes version %s by Chris Kennedy (C) 2010\0A\00"
@.str.1 = [14 x i8] c"1.484-970a03a\00"
@.str.2 = [55 x i8] c"Ported from code by Calamity to calculate modelines.\0A\0A\00"
@.str.3 = [18 x i8] c"Build Date: %s\0A\00"
@.str.4 = [29 x i8] c"Sat Feb 19 22:01:35 CST 2011\00"
@.str.5 = [22 x i8] c"Compiler: GCC %s\0A\00"
@.str.6 = [6 x i8] c"9.4.0\00"
@.str.7 = [19 x i8] c"Build System: %s\0A\0A\00"
@.str.8 = [123 x i8] c"Linux mcp 2.6.38-rc4-git4+ SMP Mon Feb 14 02:15:06 CST 2011 x86_64 Intel(R) Xeon(TM) CPU 3.40GHz GenuineIntel GNU/Linux\00"
@.str.9 = [28 x i8] c"Usage: switchres <gamerom>\0A\00"
@.str.10 = [77 x i8] c"Usage: switchres <system> --emulator mess --rom <rom> --args <mess cmdline>\0A\00"
@.str.11 = [45 x i8] c"Usage: switchres <width> <height> <refresh>\0A\00"
@.str.12 = [36 x i8] c"Usage: switchres --calc <gamerom>\0A\0A\00"
@.str.13 = [80 x i8] c" --verbose Increases verbosity, can be specified multiple times\0A\00"
@.str.14 = [60 x i8] c" --logfile <file> Write out all messages to a file\0A\00"
@.str.15 = [55 x i8] c" --calc Calculate modeline and exit\0A\00"
@.str.16 = [46 x i8] c" --monitor <type> Type of monitor %s\0A\00"
@.str.17 = [47 x i8] c"[cga ega vga multi ntsc pal h9110 d9200 d9800]\00"
@.str.18 = [76 x i8] c" --mrange <settings> Use custom monitor range, can have multiple ones\0A\00"
@.str.19 = [65 x i8] c" --showmrange Show monitor range picked or main one\0A\00"
@.str.20 = [49 x i8] c" --ymin <height> Minimum height to use\0A\00"
@.str.21 = [70 x i8] c" --vectorwidth <width> Default width to use on Vector games (640)\0A\00"
@.str.22 = [71 x i8] c" --vectorheight <height> Default height to use on Vector games (480)\0A\00"
@.str.23 = [55 x i8] c" --nodoublescan Video card can't doublescan\0A\00"
@.str.24 = [54 x i8] c" --nointerlace Video card can't interlace\0A\00"
@.str.25 = [76 x i8] c" --throttle Can't sync to refresh rate, use throttle in mame\0A\00"
@.str.26 = [91 x i8] c" --threads Use multithreading even with vsync, requires special mame build\0A\00"
@.str.27 = [70 x i8] c" --novsync Weight for x/y instead of vertical refresh\0A\00"
@.str.28 = [97 x i8] c" --noswitchres Don't switch resolutions, just use as wrapper to mame, best for LCD's\0A\00"
@.str.29 = [88 x i8] c" --notriplebuffer Use Mame option waitvsync instead of triple buffer (Windows)\0A\00"
@.str.30 = [86 x i8] c" --aspect num:den Method of calculating width on vertical games, default 4:3\0A\00"
@.str.31 = [92 x i8] c" --mo [0|1|2] Monitor Orientation, 0=horizontal, 1=vertical, 2=both/rotateable\0A\00"
@.str.32 = [75 x i8] c" --dcalign <HZ> Align dotclock to Hz (Windows 10000 Linux 1000)\0A\00"
@.str.33 = [71 x i8] c" --ff Frogger/Galaxian Hack is in mame executable\0A\00"
@.str.34 = [61 x i8] c" --redraw Redraw Hack is in mame executable\0A\00"
@.str.35 = [65 x i8] c" --soundsync Sound Sync Hack is in mame executable\0A\00"
@.str.36 = [67 x i8] c" --cleanstretch Cleanstretch Hack is in mame executable\0A\00"
@.str.37 = [71 x i8] c" --modesfile <file> Write out modelines to a file for Soft15Khz\0A\00"
@.str.38 = [76 x i8] c" --resfile <file> Read modelines from a file, newer ArcadeVGA Card\0A\00"
@.str.39 = [79 x i8] c" --test Just test what would be done, no res change or game\0A\00"
@.str.40 = [44 x i8] c"\0AOptions for other emulators besides MAME:\0A\00"
@.str.41 = [60 x i8] c" --emulator <exe> Emulator to run, default is mame\0A\00"
@.str.42 = [79 x i8] c" --xrandr Use this if the emulator doesn't switch resolutions\0A\00"
@.str.43 = [71 x i8] c" --args <...> Extra command line args to send to emulator\0A\00"
@.str.44 = [75 x i8] c" --rom <file> ROM file, normal <gamerom> becomes system type\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str.8, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.13, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.15, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.18, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.19, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.20, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.21, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.22, i64 0, i64 0))
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.23, i64 0, i64 0))
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.24, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.25, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.26, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.27, i64 0, i64 0))
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.28, i64 0, i64 0))
%49 = load i32, i32* @stderr
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.29, i64 0, i64 0))
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.30, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.31, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.32, i64 0, i64 0))
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.33, i64 0, i64 0))
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.34, i64 0, i64 0))
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.35, i64 0, i64 0))
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.36, i64 0, i64 0))
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.37, i64 0, i64 0))
%67 = load i32, i32* @stderr
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.38, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.39, i64 0, i64 0))
%71 = load i32, i32* @stderr
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.40, i64 0, i64 0))
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.41, i64 0, i64 0))
%75 = load i32, i32* @stderr
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.42, i64 0, i64 0))
%77 = load i32, i32* @stderr
%78 = call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.43, i64 0, i64 0))
%79 = load i32, i32* @stderr
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.44, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"SwitchRes version %s by Chris Kennedy (C) 2010\0A\00"
@.str.1 = [14 x i8] c"1.484-970a03a\00"
@.str.2 = [55 x i8] c"Ported from code by Calamity to calculate modelines.\0A\0A\00"
@.str.3 = [18 x i8] c"Build Date: %s\0A\00"
@.str.4 = [29 x i8] c"Sat Feb 19 22:01:35 CST 2011\00"
@.str.5 = [22 x i8] c"Compiler: GCC %s\0A\00"
@.str.6 = [6 x i8] c"9.4.0\00"
@.str.7 = [19 x i8] c"Build System: %s\0A\0A\00"
@.str.8 = [123 x i8] c"Linux mcp 2.6.38-rc4-git4+ SMP Mon Feb 14 02:15:06 CST 2011 x86_64 Intel(R) Xeon(TM) CPU 3.40GHz GenuineIntel GNU/Linux\00"
@.str.9 = [28 x i8] c"Usage: switchres <gamerom>\0A\00"
@.str.10 = [77 x i8] c"Usage: switchres <system> --emulator mess --rom <rom> --args <mess cmdline>\0A\00"
@.str.11 = [45 x i8] c"Usage: switchres <width> <height> <refresh>\0A\00"
@.str.12 = [36 x i8] c"Usage: switchres --calc <gamerom>\0A\0A\00"
@.str.13 = [80 x i8] c" --verbose Increases verbosity, can be specified multiple times\0A\00"
@.str.14 = [60 x i8] c" --logfile <file> Write out all messages to a file\0A\00"
@.str.15 = [55 x i8] c" --calc Calculate modeline and exit\0A\00"
@.str.16 = [46 x i8] c" --monitor <type> Type of monitor %s\0A\00"
@.str.17 = [47 x i8] c"[cga ega vga multi ntsc pal h9110 d9200 d9800]\00"
@.str.18 = [76 x i8] c" --mrange <settings> Use custom monitor range, can have multiple ones\0A\00"
@.str.19 = [65 x i8] c" --showmrange Show monitor range picked or main one\0A\00"
@.str.20 = [49 x i8] c" --ymin <height> Minimum height to use\0A\00"
@.str.21 = [70 x i8] c" --vectorwidth <width> Default width to use on Vector games (640)\0A\00"
@.str.22 = [71 x i8] c" --vectorheight <height> Default height to use on Vector games (480)\0A\00"
@.str.23 = [55 x i8] c" --nodoublescan Video card can't doublescan\0A\00"
@.str.24 = [54 x i8] c" --nointerlace Video card can't interlace\0A\00"
@.str.25 = [76 x i8] c" --throttle Can't sync to refresh rate, use throttle in mame\0A\00"
@.str.26 = [91 x i8] c" --threads Use multithreading even with vsync, requires special mame build\0A\00"
@.str.27 = [70 x i8] c" --novsync Weight for x/y instead of vertical refresh\0A\00"
@.str.28 = [97 x i8] c" --noswitchres Don't switch resolutions, just use as wrapper to mame, best for LCD's\0A\00"
@.str.29 = [88 x i8] c" --notriplebuffer Use Mame option waitvsync instead of triple buffer (Windows)\0A\00"
@.str.30 = [86 x i8] c" --aspect num:den Method of calculating width on vertical games, default 4:3\0A\00"
@.str.31 = [92 x i8] c" --mo [0|1|2] Monitor Orientation, 0=horizontal, 1=vertical, 2=both/rotateable\0A\00"
@.str.32 = [75 x i8] c" --dcalign <HZ> Align dotclock to Hz (Windows 10000 Linux 1000)\0A\00"
@.str.33 = [71 x i8] c" --ff Frogger/Galaxian Hack is in mame executable\0A\00"
@.str.34 = [61 x i8] c" --redraw Redraw Hack is in mame executable\0A\00"
@.str.35 = [65 x i8] c" --soundsync Sound Sync Hack is in mame executable\0A\00"
@.str.36 = [67 x i8] c" --cleanstretch Cleanstretch Hack is in mame executable\0A\00"
@.str.37 = [71 x i8] c" --modesfile <file> Write out modelines to a file for Soft15Khz\0A\00"
@.str.38 = [76 x i8] c" --resfile <file> Read modelines from a file, newer ArcadeVGA Card\0A\00"
@.str.39 = [79 x i8] c" --test Just test what would be done, no res change or game\0A\00"
@.str.40 = [44 x i8] c"\0AOptions for other emulators besides MAME:\0A\00"
@.str.41 = [60 x i8] c" --emulator <exe> Emulator to run, default is mame\0A\00"
@.str.42 = [79 x i8] c" --xrandr Use this if the emulator doesn't switch resolutions\0A\00"
@.str.43 = [71 x i8] c" --args <...> Extra command line args to send to emulator\0A\00"
@.str.44 = [75 x i8] c" --rom <file> ROM file, normal <gamerom> becomes system type\0A\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str.8, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.13, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.15, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.18, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.19, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.20, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.21, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.22, i64 0, i64 0))
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.23, i64 0, i64 0))
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.24, i64 0, i64 0))
%41 = load i32, i32* @stderr
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.25, i64 0, i64 0))
%43 = load i32, i32* @stderr
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.26, i64 0, i64 0))
%45 = load i32, i32* @stderr
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.27, i64 0, i64 0))
%47 = load i32, i32* @stderr
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.28, i64 0, i64 0))
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str.29, i64 0, i64 0))
%51 = load i32, i32* @stderr
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.30, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.31, i64 0, i64 0))
%55 = load i32, i32* @stderr
%56 = tail call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.32, i64 0, i64 0))
%57 = load i32, i32* @stderr
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.33, i64 0, i64 0))
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.34, i64 0, i64 0))
%61 = load i32, i32* @stderr
%62 = tail call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.35, i64 0, i64 0))
%63 = load i32, i32* @stderr
%64 = tail call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.36, i64 0, i64 0))
%65 = load i32, i32* @stderr
%66 = tail call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.37, i64 0, i64 0))
%67 = load i32, i32* @stderr
%68 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.38, i64 0, i64 0))
%69 = load i32, i32* @stderr
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.39, i64 0, i64 0))
%71 = load i32, i32* @stderr
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.40, i64 0, i64 0))
%73 = load i32, i32* @stderr
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.41, i64 0, i64 0))
%75 = load i32, i32* @stderr
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.42, i64 0, i64 0))
%77 = load i32, i32* @stderr
%78 = tail call i32 (i32, i8*, ...) @fprintf(i32 %77, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.43, i64 0, i64 0))
%79 = load i32, i32* @stderr
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.44, i64 0, i64 0))
ret i32 0
}