#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 *, char *);
int /*<<< orphan*/ stderr;
void SayUsage(char *programName) {
  static char *usage[] = {
      "Convert MIDI files to an Arduino PLAYTUNE bytestream",
      "miditones [-p] [-lg] [-lp] [-s1] [-tn] <basefilename>",
      "  -p   parse only, don't generate bytestream",
      "  -lp  log input parsing",
      "  -lg  log output generation",
      "  -s1  strategy 1: favor track 1",
      "  -s2  strategy 2: try to assign tracks to specific tone generators",
      "  -tn  use at most n tone generators (default is 6, max is 16)",
      "  -b   binary file output instead of C source text",
      "  -cn  mask for which tracks to process, e.g. -c3 for only 0 and 1",
      "  -kn  key shift in chromatic notes, positive or negative",
      "input file:  <basefilename>.mid",
      "output file: <basefilename>.bin or .c",
      "log file:    <basefilename>.log",
      ""};
  int i = 0;
  while (usage[i][0] != '\0')
    fprintf(stderr, "%s\n", usage[i++]);
}


x86 assembly (clang, -O0):
<SayUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0x2f02(%rip),%rax
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1171 <SayUsage+0x61>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %eax,%rcx
lea    0x2ed4(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0x1121(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1123 <SayUsage+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SayUsage>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0x1163(%rip),%rbx
lea    0xed4(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xef7(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf1b(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf36(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf3d(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf48(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf57(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf89(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xfb6(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xfd7(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1008(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1030(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x103e(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1052(%rip),%rdx
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@SayUsage.usage = internal global [15 x i8*] [i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i32 0, i32 0)]
@.str = [53 x i8] c"Convert MIDI files to an Arduino PLAYTUNE bytestream\00"
@.str.1 = [54 x i8] c"miditones [-p] [-lg] [-lp] [-s1] [-tn] <basefilename>\00"
@.str.2 = [45 x i8] c" -p parse only, don't generate bytestream\00"
@.str.3 = [25 x i8] c" -lp log input parsing\00"
@.str.4 = [29 x i8] c" -lg log output generation\00"
@.str.5 = [33 x i8] c" -s1 strategy 1: favor track 1\00"
@.str.6 = [68 x i8] c" -s2 strategy 2: try to assign tracks to specific tone generators\00"
@.str.7 = [63 x i8] c" -tn use at most n tone generators (default is 6, max is 16)\00"
@.str.8 = [51 x i8] c" -b binary file output instead of C source text\00"
@.str.9 = [67 x i8] c" -cn mask for which tracks to process, e.g. -c3 for only 0 and 1\00"
@.str.10 = [58 x i8] c" -kn key shift in chromatic notes, positive or negative\00"
@.str.11 = [32 x i8] c"input file: <basefilename>.mid\00"
@.str.12 = [38 x i8] c"output file: <basefilename>.bin or .c\00"
@.str.13 = [32 x i8] c"log file: <basefilename>.log\00"
@.str.14 = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.15 = [4 x i8] c"%s\0A\00"
define void @SayUsage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [15 x i8*], [15 x i8*]* @SayUsage.usage, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %4
%14 = load i32, i32* @stderr
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds [15 x i8*], [15 x i8*]* @SayUsage.usage, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %19)
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Convert MIDI files to an Arduino PLAYTUNE bytestream\00"
@.str.1 = [54 x i8] c"miditones [-p] [-lg] [-lp] [-s1] [-tn] <basefilename>\00"
@.str.2 = [45 x i8] c" -p parse only, don't generate bytestream\00"
@.str.3 = [25 x i8] c" -lp log input parsing\00"
@.str.4 = [29 x i8] c" -lg log output generation\00"
@.str.5 = [33 x i8] c" -s1 strategy 1: favor track 1\00"
@.str.6 = [68 x i8] c" -s2 strategy 2: try to assign tracks to specific tone generators\00"
@.str.7 = [63 x i8] c" -tn use at most n tone generators (default is 6, max is 16)\00"
@.str.8 = [51 x i8] c" -b binary file output instead of C source text\00"
@.str.9 = [67 x i8] c" -cn mask for which tracks to process, e.g. -c3 for only 0 and 1\00"
@.str.10 = [58 x i8] c" -kn key shift in chromatic notes, positive or negative\00"
@.str.11 = [32 x i8] c"input file: <basefilename>.mid\00"
@.str.12 = [38 x i8] c"output file: <basefilename>.bin or .c\00"
@.str.13 = [32 x i8] c"log file: <basefilename>.log\00"
@stderr = global i32 0
@.str.15 = [4 x i8] c"%s\0A\00"
define void @SayUsage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.10, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = tail call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.13, i64 0, i64 0))
ret void
}