// File: /workspace/github_c_makefile_star2_O0/LenShustek[P]miditones/miditones_scroll.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;

   /* --- The following skeleton comes from C:\lcc\lib\wizard\textmode.tpl. */
   for (i = 1; i < argc; i++) {
      if (argv[i][0] == '/' || argv[i][0] == '-') {
         switch (toupper (argv[i][1])) {
         case 'H':
         case '?':
            SayUsage (argv[0]);
            exit (1);
         case 'C':
            codeoutput = true;
            break;
         case 'X':
            showhex = true;
            break;
         case 'N':
            showbytestream = false;
            break;
         case 'T':
            if (sscanf (&argv[i][2], "%d", &num_tonegens) != 1 || num_tonegens < 1
                  || num_tonegens > MAX_TONEGENS)
               goto opterror;
            break;
         case 'V':
            expect_volume = true;
            if (argv[i][2] == '\0')
               break;
            if (toupper (argv[i][2]) == 'I')
               ignore_volume = true;
            else
               goto opterror;
            break;

            /* add more  option switches here */
opterror:
         default:
            fprintf (stderr, "unknown option: %s\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 0x3440
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x32db
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x3424
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %edi
callq 0x3040
addl $-0x3f, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x19, %eax
ja 0x33e5
movq 0x8(%rsp), %rax
leaq 0x1cf3(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x3210
movl $0x1, %edi
callq 0x3100
movb $0x1, 0x59f8(%rip)      # 0x8d30
jmp 0x3422
movb $0x1, 0x59ef(%rip)      # 0x8d33
jmp 0x3422
movb $0x0, 0x4d54(%rip)      # 0x80a4
jmp 0x3422
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x2, %rdi
leaq 0x1e68(%rip), %rsi      # 0x51d6
leaq 0x4d2b(%rip), %rdx      # 0x80a0
movb $0x0, %al
callq 0x30d0
cmpl $0x1, %eax
jne 0x3393
cmpl $0x1, 0x4d18(%rip)      # 0x80a0
jb 0x3393
cmpl $0x10, 0x4d0f(%rip)     # 0x80a0
jbe 0x3395
jmp 0x33e3
jmp 0x3422
movb $0x1, 0x5990(%rip)      # 0x8d31
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x33ba
jmp 0x3422
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %edi
callq 0x3040
cmpl $0x49, %eax
jne 0x33df
movb $0x1, 0x5955(%rip)      # 0x8d32
jmp 0x33e1
jmp 0x33e3
jmp 0x3422
jmp 0x33e5
movq 0x4c0c(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq 0x18(%rsp), %rax
movslq 0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x1dd5(%rip), %rsi      # 0x51d9
movb $0x0, %al
callq 0x3090
movq 0x18(%rsp), %rax
movq (%rax), %rdi
callq 0x3210
movl $0x4, %edi
callq 0x3100
jmp 0x342e
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
jmp 0x3440
jmp 0x3430
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x329d
movl 0x10(%rsp), %eax
addq $0x28, %rsp
retq
nopl (%rax)