// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/identify/identify.c
// Function: processOptions
static int
processOptions(int argc, char **argv)
    {
    int argIndex;
    int argUsed;
    int separateArg;
    char *arg;

    argIndex = 1;

    while (argIndex < argc && *argv[argIndex] == '-') {

        separateArg = 0;
        argUsed = 0;

        if (argv[argIndex][2] == '\0')
            {
            arg = argv[argIndex+1];
            separateArg = 1;
            }
        else
            arg = argv[argIndex]+2;

        switch (argv[argIndex][1])
            {
            /*
             * when option has an argument, do this
             *
             *     examples are -m4096 or -m 4096
             *
             *     case 'm':
             *         MemorySize = atol(arg);
             *         argUsed = 1;
             *         break;
             *
             *
             * when option does not have an argument, do this
             *
             *     example is -a
             *
             *     case 'a':
             *         PrintActions = 1;
             *         break;
             */
            case 'v':
                printf("%s version %s\n", PROGRAM_NAME, PROGRAM_VERSION);
                exit(0);
                break;
            case 'p':
                Pitch = 1;
                break;
            case 'f':
                Frequency = 1;
                break;
            case 'n':
                Note = 1;
                break;
            case 'o':
                initialOffset = atof(arg);
                argUsed = 1;
                break;
            case 'h':
                printf("identify options:\n");
                printf("  -f     only report the detected frequency\n");
                printf("  -p     generate a command to repitch the note\n");
                printf("  -n     only report the nearest note\n");
                printf("  -o N   start analyzing N seconds into the note\n");
                printf("  -v     display the version number\n");
                printf("  -h     help\n");
                exit(0);
                break;
            default:
                Fatal("option %s not understood\n",argv[argIndex]);
            }

        if (separateArg && argUsed)
            ++argIndex;

        ++argIndex;
        }

    return argIndex;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %ecx
xorl %eax, %eax
cmpl -0x4(%rbp), %ecx
movb %al, -0x29(%rbp)
jge 0x272b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x2737
jmp 0x28d5
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x2(%rax), %eax
cmpl $0x0, %eax
jne 0x2778
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
jmp 0x278c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x2, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %eax
addl $-0x66, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x10, %eax
ja 0x2898
movq -0x38(%rbp), %rax
leaq 0x386f(%rip), %rcx      # 0x6028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x6957(%rip), %rsi      # 0x9120
movq 0x6958(%rip), %rdx      # 0x9128
leaq 0x3b65(%rip), %rdi      # 0x633c
movb $0x0, %al
callq 0x2090
xorl %edi, %edi
callq 0x21d0
movl $0x1, 0x70f5(%rip)      # 0x98e4
jmp 0x28b2
movl $0x1, 0x70ee(%rip)      # 0x98ec
jmp 0x28b2
movl $0x1, 0x70db(%rip)      # 0x98e8
jmp 0x28b2
movq -0x28(%rbp), %rdi
callq 0x2050
movsd %xmm0, 0x709d(%rip)     # 0x98c0
movl $0x1, -0x18(%rbp)
jmp 0x28b2
leaq 0x3b15(%rip), %rdi      # 0x634b
movb $0x0, %al
callq 0x2090
leaq 0x3b1a(%rip), %rdi      # 0x635e
movb $0x0, %al
callq 0x2090
leaq 0x3b39(%rip), %rdi      # 0x638b
movb $0x0, %al
callq 0x2090
leaq 0x3b5c(%rip), %rdi      # 0x63bc
movb $0x0, %al
callq 0x2090
leaq 0x3b75(%rip), %rdi      # 0x63e3
movb $0x0, %al
callq 0x2090
leaq 0x3b99(%rip), %rdi      # 0x6415
movb $0x0, %al
callq 0x2090
leaq 0x3bb0(%rip), %rdi      # 0x643a
movb $0x0, %al
callq 0x2090
xorl %edi, %edi
callq 0x21d0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3b9e(%rip), %rdi      # 0x6449
movb $0x0, %al
callq 0x2dd0
cmpl $0x0, -0x1c(%rbp)
je 0x28c7
cmpl $0x0, -0x18(%rbp)
je 0x28c7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2706
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop