#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",
      "",
      "Use:  miditones <options> <basefilename>",
      "   input file will be <basefilename>.mid",
      "   output file will be <basefilename>.bin or .c or .h",
      "   log file will be <basefilename>.log",
      "",
      "Commonly-used options:",
      "  -v    include volume data",
      "  -i    include instrument change commands",
      "  -pt   translate notes in the percussion track to notes 129 to 255",
      "  -d    include a self-describing file header",
      "  -b    generate a binary file output instead of C source code",
      "  -t=n  use at most n tone generators (default is 6, max is 16)",
      "",
      "  The best options for later Playtune music players are: -v -i -pt -d",
      "",
      "Lesser-used command-line options:",
      "  -c=n   mask for which tracks to process, e.g. -c3 for only 0 and 1",
      "  -dp    define PROGMEM in output C code",
      "  -k=n   key shift in chromatic notes, positive or negative",
      "  -lp    log input parsing",
      "  -lg    log output generation",
      "  -n=n   put about n items on each line of the C file output",
      "  -p     parse only, don't generate bytestream",
      "  -pi    ignore notes in the percussion track, 9",
      "  -r     terminate output file with \"restart\" instead of \"stop\" "
      "command",
      "  -s1    strategy 1: favor track 1",
      "  -s2    strategy 2: try to assign tracks to specific tone generators",
      "  -showskipped      display information about each note that had to be "
      "skipped",
      "  -delaymin=x       minimum delay is x msec, to save bytestream space",
      "  -attacktime=x     the high volume attack phase lasts x msec",
      "  -attacknotemax=x  notes over x msec don't use the attack/sustain "
      "profile",
      "  -sustainlevel=p   the sustain level is p percent of maximum volume",
      "  -releasetime=x    release each note x msec before it ends",
      "  -notemin=x        don't let release shorten the note to less than x "
      "msec",
      "  -scorename        use <basefilename> as the score name in a .h file",
      NULL};
  for (int i = 0; usage[i] != NULL; ++i)
    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
cmpq   $0x0,(%rax,%rcx,8)
je     116b <SayUsage+0x5b>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
movslq -0xc(%rbp),%rcx
lea    0x2ee3(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0x15a5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <SayUsage+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SayUsage>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0x2bbf(%rip),%r15
mov    0x2eb0(%rip),%r12
lea    0x15ce(%rip),%r14
nop
mov    (%rbx,%r15,1),%rdx
mov    (%r12),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x8,%rbx
cmp    $0x128,%rbx
jne    1130 <SayUsage+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SayUsage.usage = internal global [38 x i8*] [i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.33, i32 0, i32 0), i8* null]
@.str = [53 x i8] c"Convert MIDI files to an Arduino PLAYTUNE bytestream\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [41 x i8] c"Use: miditones <options> <basefilename>\00"
@.str.3 = [41 x i8] c" input file will be <basefilename>.mid\00"
@.str.4 = [54 x i8] c" output file will be <basefilename>.bin or .c or .h\00"
@.str.5 = [39 x i8] c" log file will be <basefilename>.log\00"
@.str.6 = [23 x i8] c"Commonly-used options:\00"
@.str.7 = [28 x i8] c" -v include volume data\00"
@.str.8 = [43 x i8] c" -i include instrument change commands\00"
@.str.9 = [68 x i8] c" -pt translate notes in the percussion track to notes 129 to 255\00"
@.str.10 = [46 x i8] c" -d include a self-describing file header\00"
@.str.11 = [63 x i8] c" -b generate a binary file output instead of C source code\00"
@.str.12 = [64 x i8] c" -t=n use at most n tone generators (default is 6, max is 16)\00"
@.str.13 = [70 x i8] c" The best options for later Playtune music players are: -v -i -pt -d\00"
@.str.14 = [34 x i8] c"Lesser-used command-line options:\00"
@.str.15 = [69 x i8] c" -c=n mask for which tracks to process, e.g. -c3 for only 0 and 1\00"
@.str.16 = [41 x i8] c" -dp define PROGMEM in output C code\00"
@.str.17 = [60 x i8] c" -k=n key shift in chromatic notes, positive or negative\00"
@.str.18 = [27 x i8] c" -lp log input parsing\00"
@.str.19 = [31 x i8] c" -lg log output generation\00"
@.str.20 = [61 x i8] c" -n=n put about n items on each line of the C file output\00"
@.str.21 = [47 x i8] c" -p parse only, don't generate bytestream\00"
@.str.22 = [49 x i8] c" -pi ignore notes in the percussion track, 9\00"
@.str.23 = [72 x i8] c" -r terminate output file with \22restart\22 instead of \22stop\22 command\00"
@.str.24 = [35 x i8] c" -s1 strategy 1: favor track 1\00"
@.str.25 = [70 x i8] c" -s2 strategy 2: try to assign tracks to specific tone generators\00"
@.str.26 = [79 x i8] c" -showskipped display information about each note that had to be skipped\00"
@.str.27 = [70 x i8] c" -delaymin=x minimum delay is x msec, to save bytestream space\00"
@.str.28 = [62 x i8] c" -attacktime=x the high volume attack phase lasts x msec\00"
@.str.29 = [75 x i8] c" -attacknotemax=x notes over x msec don't use the attack/sustain profile\00"
@.str.30 = [69 x i8] c" -sustainlevel=p the sustain level is p percent of maximum volume\00"
@.str.31 = [60 x i8] c" -releasetime=x release each note x msec before it ends\00"
@.str.32 = [75 x i8] c" -notemin=x don't let release shorten the note to less than x msec\00"
@.str.33 = [70 x i8] c" -scorename use <basefilename> as the score name in a .h file\00"
@stderr = global i32 0
@.str.34 = [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 = %17, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [38 x i8*], [38 x i8*]* @SayUsage.usage, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %20
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [38 x i8*], [38 x i8*]* @SayUsage.usage, i64 0, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.34, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
@SayUsage.usage = internal unnamed_addr constant [38 x i8*] [i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.33, i32 0, i32 0), i8* null]
@.str = [53 x i8] c"Convert MIDI files to an Arduino PLAYTUNE bytestream\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [41 x i8] c"Use: miditones <options> <basefilename>\00"
@.str.3 = [41 x i8] c" input file will be <basefilename>.mid\00"
@.str.4 = [54 x i8] c" output file will be <basefilename>.bin or .c or .h\00"
@.str.5 = [39 x i8] c" log file will be <basefilename>.log\00"
@.str.6 = [23 x i8] c"Commonly-used options:\00"
@.str.7 = [28 x i8] c" -v include volume data\00"
@.str.8 = [43 x i8] c" -i include instrument change commands\00"
@.str.9 = [68 x i8] c" -pt translate notes in the percussion track to notes 129 to 255\00"
@.str.10 = [46 x i8] c" -d include a self-describing file header\00"
@.str.11 = [63 x i8] c" -b generate a binary file output instead of C source code\00"
@.str.12 = [64 x i8] c" -t=n use at most n tone generators (default is 6, max is 16)\00"
@.str.13 = [70 x i8] c" The best options for later Playtune music players are: -v -i -pt -d\00"
@.str.14 = [34 x i8] c"Lesser-used command-line options:\00"
@.str.15 = [69 x i8] c" -c=n mask for which tracks to process, e.g. -c3 for only 0 and 1\00"
@.str.16 = [41 x i8] c" -dp define PROGMEM in output C code\00"
@.str.17 = [60 x i8] c" -k=n key shift in chromatic notes, positive or negative\00"
@.str.18 = [27 x i8] c" -lp log input parsing\00"
@.str.19 = [31 x i8] c" -lg log output generation\00"
@.str.20 = [61 x i8] c" -n=n put about n items on each line of the C file output\00"
@.str.21 = [47 x i8] c" -p parse only, don't generate bytestream\00"
@.str.22 = [49 x i8] c" -pi ignore notes in the percussion track, 9\00"
@.str.23 = [72 x i8] c" -r terminate output file with \22restart\22 instead of \22stop\22 command\00"
@.str.24 = [35 x i8] c" -s1 strategy 1: favor track 1\00"
@.str.25 = [70 x i8] c" -s2 strategy 2: try to assign tracks to specific tone generators\00"
@.str.26 = [79 x i8] c" -showskipped display information about each note that had to be skipped\00"
@.str.27 = [70 x i8] c" -delaymin=x minimum delay is x msec, to save bytestream space\00"
@.str.28 = [62 x i8] c" -attacktime=x the high volume attack phase lasts x msec\00"
@.str.29 = [75 x i8] c" -attacknotemax=x notes over x msec don't use the attack/sustain profile\00"
@.str.30 = [69 x i8] c" -sustainlevel=p the sustain level is p percent of maximum volume\00"
@.str.31 = [60 x i8] c" -releasetime=x release each note x msec before it ends\00"
@.str.32 = [75 x i8] c" -notemin=x don't let release shorten the note to less than x msec\00"
@.str.33 = [70 x i8] c" -scorename use <basefilename> as the score name in a .h file\00"
@stderr = global i32 0
@.str.34 = [4 x i8] c"%s\0A\00"
define void @SayUsage(i8* nocapture readnone %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = getelementptr inbounds [38 x i8*], [38 x i8*]* @SayUsage.usage, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.34, i64 0, i64 0), i8* %6)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 37
br i1 %10, label %2, label %3
}