// File: /workspace/github_c_makefile_star2_O0/LenShustek[P]miditones/miditones.c
// Function: HandleOptions
int HandleOptions (int argc, char *argv[]) {
   /* returns the index of the first argument that is not an option,
   i.e. does not start with a dash or a slash */
   int i, firstnonoption = 0;
   for (i = 1; i < argc; i++) {
      if (argv[i][0] == '/' || argv[i][0] == '-') {
         int tempint;
         char *arg = argv[i] + 1;
         if (opt_key(arg, "h") || opt_key(arg, "?")) {
            SayUsage(argv[0]); exit(1); }
         else if (opt_key(arg, "b")) binaryoutput = true;
         else if (opt_int(arg, "c", &channel_mask, 1, 0xffff))
            printf("Channel (track) mask is %04X\n", channel_mask);
         else if (opt_key(arg, "d")) do_header = true;
         else if (opt_key(arg, "dp")) define_progmem = true;
         else if (opt_key(arg, "lg")) loggen = true;
         else if (opt_key(arg, "i")) instrumentoutput = true;
         else if (opt_int(arg, "k", &keyshift, -100, 100))
            printf("Using keyshift %d\n", keyshift);
         else if (opt_key(arg, "lp")) logparse = true;
         else if (opt_int(arg, "n", &outfile_maxitems, 1, INT_MAX));
         else if (opt_key(arg, "p")) parseonly = true;
         else if (opt_key(arg, "pi")) percussion_ignore = true;
         else if (opt_key(arg, "pt")) percussion_translate = true;
         else if (opt_key(arg, "r")) gen_restart = true;
         else if (opt_key(arg, "asm1802")) {
            asm_output = true; comment = ";"; byteop = "    db  "; hex = "$"; outfile_maxitems = 16; }
         else if (opt_key(arg, "asm6502")) {
            asm_output = true; comment = ";"; byteop = "    .byte  "; hex = "$"; outfile_maxitems = 16; }
         else if (opt_int(arg, "delaymin", &tempint, 1, 1000)) delaymin_usec = tempint * 1000;
         else if (opt_int(arg, "releasetime", &tempint, 0, INT_MAX)) releasetime_usec = tempint * 1000;
         else if (opt_int(arg, "notemin", &tempint, 0, INT_MAX)) notemin_usec = tempint * 1000;
         else if (opt_int(arg, "attacktime", &tempint, 0, INT_MAX)) {
            attacktime_usec = tempint * 1000;
            check_option(volume_output, "-attacktime only works with -v"); }
         else if (opt_int(arg, "attacknotemax", &tempint, 0, INT_MAX)) {
            attacknotemax_usec = tempint * 1000;
            check_option(volume_output, "-attacknotemax only works with -v"); }
         else if (opt_int(arg, "sustainlevel", &sustainlevel_pct, 1, 100))
            check_option(volume_output, "-sustainlevel only works with -v");
         else if (opt_key(arg, "s1")) strategy1 = true;
         else if (opt_key(arg, "s2")) strategy2 = true;
         else if (opt_key(arg, "scorename")) scorename = true;
         else if (opt_key(arg, "showskipped")) showskipped = true;
         else if (opt_key(arg, "noduplicates")) noduplicates = true;
         else if (opt_int(arg, "t", &num_tonegens, 1, MAX_TONEGENS))
            printf("Using %d tone generators\n", num_tonegens);
         else if (opt_key(arg, "v")) volume_output = true;
         /* add more  option switches here */
         else {
            fprintf(stderr, "\n*** bad option: %s\n\n", argv[i]);
            SayUsage(argv[0]);
            exit(4); } }
      else {
         firstnonoption = i;
         break; } }
   return firstnonoption; }

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x1bcd
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x159b
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1bb1
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
leaq 0x730f(%rip), %rsi      # 0x88cb
callq 0x12b0
testb $0x1, %al
jne 0x15db
movq (%rsp), %rdi
leaq 0x6b2e(%rip), %rsi      # 0x80fe
callq 0x12b0
testb $0x1, %al
jne 0x15db
jmp 0x15f2
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x14e0
movl $0x1, %edi
callq 0x1140
movq (%rsp), %rdi
leaq 0x725b(%rip), %rsi      # 0x8858
callq 0x12b0
testb $0x1, %al
jne 0x1608
jmp 0x1614
movb $0x1, 0x9cf1(%rip)      # 0xb300
jmp 0x1bad
movq (%rsp), %rdi
leaq 0x6c62(%rip), %rsi      # 0x8281
leaq 0x9aba(%rip), %rdx      # 0xb0e0
movl $0x1, %ecx
movl $0xffff, %r8d           # imm = 0xFFFF
callq 0x1320
testb $0x1, %al
jne 0x163c
jmp 0x1655
movl 0x9a9e(%rip), %esi      # 0xb0e0
leaq 0x63d4(%rip), %rdi      # 0x7a1d
movb $0x0, %al
callq 0x1070
jmp 0x1bab
movq (%rsp), %rdi
leaq 0x6602(%rip), %rsi      # 0x7c62
callq 0x12b0
testb $0x1, %al
jne 0x166b
jmp 0x1677
movb $0x1, 0x9c8f(%rip)      # 0xb301
jmp 0x1ba9
movq (%rsp), %rdi
leaq 0x63b9(%rip), %rsi      # 0x7a3b
callq 0x12b0
testb $0x1, %al
jne 0x168d
jmp 0x1699
movb $0x1, 0x9c6e(%rip)      # 0xb302
jmp 0x1ba7
movq (%rsp), %rdi
leaq 0x639a(%rip), %rsi      # 0x7a3e
callq 0x12b0
testb $0x1, %al
jne 0x16af
jmp 0x16bb
movb $0x1, 0x9c4d(%rip)      # 0xb303
jmp 0x1ba5
movq (%rsp), %rdi
leaq 0x6392(%rip), %rsi      # 0x7a58
callq 0x12b0
testb $0x1, %al
jne 0x16d1
jmp 0x16dd
movb $0x1, 0x9c2c(%rip)      # 0xb304
jmp 0x1ba3
movq (%rsp), %rdi
leaq 0x6af4(%rip), %rsi      # 0x81dc
leaq 0x9bbd(%rip), %rdx      # 0xb2ac
movl $0xffffff9c, %ecx       # imm = 0xFFFFFF9C
movl $0x64, %r8d
callq 0x1320
testb $0x1, %al
jne 0x1705
jmp 0x171e
movl 0x9ba1(%rip), %esi      # 0xb2ac
leaq 0x632f(%rip), %rdi      # 0x7a41
movb $0x0, %al
callq 0x1070
jmp 0x1ba1
movq (%rsp), %rdi
leaq 0x632b(%rip), %rsi      # 0x7a54
callq 0x12b0
testb $0x1, %al
jne 0x1734
jmp 0x1740
movb $0x1, 0x9bca(%rip)      # 0xb305
jmp 0x1b9f
movq (%rsp), %rdi
leaq 0x5aef(%rip), %rsi      # 0x723a
leaq 0x9986(%rip), %rdx      # 0xb0d8
movl $0x1, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x1320
testb $0x1, %al
jne 0x1768
jmp 0x176d
jmp 0x1b9d
movq (%rsp), %rdi
leaq 0x62c4(%rip), %rsi      # 0x7a3c
callq 0x12b0
testb $0x1, %al
jne 0x1783
jmp 0x178f
movb $0x1, 0x9b7c(%rip)      # 0xb306
jmp 0x1b9b
movq (%rsp), %rdi
leaq 0x62bd(%rip), %rsi      # 0x7a57
callq 0x12b0
testb $0x1, %al
jne 0x17a5
jmp 0x17b1
movb $0x1, 0x9b5b(%rip)      # 0xb307
jmp 0x1b99
movq (%rsp), %rdi
leaq 0x629e(%rip), %rsi      # 0x7a5a
callq 0x12b0
testb $0x1, %al
jne 0x17c7
jmp 0x17d3
movb $0x1, 0x9b3a(%rip)      # 0xb308
jmp 0x1b97
movq (%rsp), %rdi
leaq 0x5c1b(%rip), %rsi      # 0x73f9
callq 0x12b0
testb $0x1, %al
jne 0x17e9
jmp 0x17f5
movb $0x1, 0x9b19(%rip)      # 0xb309
jmp 0x1b95
movq (%rsp), %rdi
leaq 0x625d(%rip), %rsi      # 0x7a5d
callq 0x12b0
testb $0x1, %al
jne 0x180b
jmp 0x184b
movb $0x1, 0x9af8(%rip)      # 0xb30a
leaq 0x6ebd(%rip), %rax      # 0x86d6
movq %rax, 0x98a0(%rip)      # 0xb0c0
leaq 0x623e(%rip), %rax      # 0x7a65
movq %rax, 0x98a2(%rip)      # 0xb0d0
leaq 0x6239(%rip), %rax      # 0x7a6e
movq %rax, 0x988c(%rip)      # 0xb0c8
movl $0x10, 0x9892(%rip)     # 0xb0d8
jmp 0x1b93
movq (%rsp), %rdi
leaq 0x621a(%rip), %rsi      # 0x7a70
callq 0x12b0
testb $0x1, %al
jne 0x1861
jmp 0x18a1
movb $0x1, 0x9aa2(%rip)      # 0xb30a
leaq 0x6e67(%rip), %rax      # 0x86d6
movq %rax, 0x984a(%rip)      # 0xb0c0
leaq 0x61fb(%rip), %rax      # 0x7a78
movq %rax, 0x984c(%rip)      # 0xb0d0
leaq 0x61e3(%rip), %rax      # 0x7a6e
movq %rax, 0x9836(%rip)      # 0xb0c8
movl $0x10, 0x983c(%rip)     # 0xb0d8
jmp 0x1b91
movq (%rsp), %rdi
leaq 0x61d8(%rip), %rsi      # 0x7a84
leaq 0xc(%rsp), %rdx
movl $0x1, %ecx
movl $0x3e8, %r8d            # imm = 0x3E8
callq 0x1320
testb $0x1, %al
jne 0x18c7
jmp 0x18dd
imull $0x3e8, 0xc(%rsp), %eax # imm = 0x3E8
cltq
movq %rax, 0x99d8(%rip)      # 0xb2b0
jmp 0x1b8f
movq (%rsp), %rdi
leaq 0x61a5(%rip), %rsi      # 0x7a8d
leaq 0xc(%rsp), %rdx
xorl %ecx, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x1320
testb $0x1, %al
jne 0x1900
jmp 0x1916
imull $0x3e8, 0xc(%rsp), %eax # imm = 0x3E8
cltq
movq %rax, 0x99a7(%rip)      # 0xb2b8
jmp 0x1b8d
movq (%rsp), %rdi
leaq 0x6178(%rip), %rsi      # 0x7a99
leaq 0xc(%rsp), %rdx
xorl %ecx, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x1320
testb $0x1, %al
jne 0x1939
jmp 0x194f
imull $0x3e8, 0xc(%rsp), %eax # imm = 0x3E8
cltq
movq %rax, 0x979e(%rip)      # 0xb0e8
jmp 0x1b8b
movq (%rsp), %rdi
leaq 0x6147(%rip), %rsi      # 0x7aa1
leaq 0xc(%rsp), %rdx
xorl %ecx, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x1320
testb $0x1, %al
jne 0x1972
jmp 0x199f
imull $0x3e8, 0xc(%rsp), %eax # imm = 0x3E8
cltq
movq %rax, 0x993d(%rip)      # 0xb2c0
movb 0x9982(%rip), %al       # 0xb30b
leaq 0x611c(%rip), %rsi      # 0x7aac
andb $0x1, %al
movzbl %al, %edi
callq 0x1260
jmp 0x1b89
movq (%rsp), %rdi
leaq 0x6121(%rip), %rsi      # 0x7acb
leaq 0xc(%rsp), %rdx
xorl %ecx, %ecx
movl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
callq 0x1320
testb $0x1, %al
jne 0x19c2
jmp 0x19ef
imull $0x3e8, 0xc(%rsp), %eax # imm = 0x3E8
cltq
movq %rax, 0x971d(%rip)      # 0xb0f0
movb 0x9932(%rip), %al       # 0xb30b
leaq 0x60f9(%rip), %rsi      # 0x7ad9
andb $0x1, %al
movzbl %al, %edi
callq 0x1260
jmp 0x1b87
movq (%rsp), %rdi
leaq 0x6101(%rip), %rsi      # 0x7afb
leaq 0x96f7(%rip), %rdx      # 0xb0f8
movl $0x1, %ecx
movl $0x64, %r8d
callq 0x1320
testb $0x1, %al
jne 0x1a17
jmp 0x1a33
movb 0x98ee(%rip), %al       # 0xb30b
leaq 0x60e4(%rip), %rsi      # 0x7b08
andb $0x1, %al
movzbl %al, %edi
callq 0x1260
jmp 0x1b85
movq (%rsp), %rdi
leaq 0x60eb(%rip), %rsi      # 0x7b29
callq 0x12b0
testb $0x1, %al
jne 0x1a49
jmp 0x1a55
movb $0x1, 0x98bc(%rip)      # 0xb30c
jmp 0x1b83
movq (%rsp), %rdi
leaq 0x60cc(%rip), %rsi      # 0x7b2c
callq 0x12b0
testb $0x1, %al
jne 0x1a6b
jmp 0x1a77
movb $0x1, 0x989b(%rip)      # 0xb30d
jmp 0x1b81
movq (%rsp), %rdi
leaq 0x60ad(%rip), %rsi      # 0x7b2f
callq 0x12b0
testb $0x1, %al
jne 0x1a8d
jmp 0x1a99
movb $0x1, 0x987a(%rip)      # 0xb30e
jmp 0x1b7f
movq (%rsp), %rdi
leaq 0x6095(%rip), %rsi      # 0x7b39
callq 0x12b0
testb $0x1, %al
jne 0x1aaf
jmp 0x1abb
movb $0x1, 0x9859(%rip)      # 0xb30f
jmp 0x1b7d
movq (%rsp), %rdi
leaq 0x607f(%rip), %rsi      # 0x7b45
callq 0x12b0
testb $0x1, %al
jne 0x1ad1
jmp 0x1add
movb $0x1, 0x9838(%rip)      # 0xb310
jmp 0x1b7b
movq (%rsp), %rdi
leaq 0x6787(%rip), %rsi      # 0x826f
leaq 0x95ed(%rip), %rdx      # 0xb0dc
movl $0x1, %ecx
movl $0x10, %r8d
callq 0x1320
testb $0x1, %al
jne 0x1b05
jmp 0x1b1b
movl 0x95d1(%rip), %esi      # 0xb0dc
leaq 0x6040(%rip), %rdi      # 0x7b52
movb $0x0, %al
callq 0x1070
jmp 0x1b79
movq (%rsp), %rdi
leaq 0x5fa3(%rip), %rsi      # 0x7ac9
callq 0x12b0
testb $0x1, %al
jne 0x1b31
jmp 0x1b3a
movb $0x1, 0x97d3(%rip)      # 0xb30b
jmp 0x1b77
movq 0x94b7(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x6013(%rip), %rsi      # 0x7b6c
movb $0x0, %al
callq 0x10a0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x14e0
movl $0x4, %edi
callq 0x1140
jmp 0x1b79
jmp 0x1b7b
jmp 0x1b7d
jmp 0x1b7f
jmp 0x1b81
jmp 0x1b83
jmp 0x1b85
jmp 0x1b87
jmp 0x1b89
jmp 0x1b8b
jmp 0x1b8d
jmp 0x1b8f
jmp 0x1b91
jmp 0x1b93
jmp 0x1b95
jmp 0x1b97
jmp 0x1b99
jmp 0x1b9b
jmp 0x1b9d
jmp 0x1b9f
jmp 0x1ba1
jmp 0x1ba3
jmp 0x1ba5
jmp 0x1ba7
jmp 0x1ba9
jmp 0x1bab
jmp 0x1bad
jmp 0x1baf
jmp 0x1bbb
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
jmp 0x1bcd
jmp 0x1bbd
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x155d
movl 0x10(%rsp), %eax
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)