// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/fixpitch/fixpitch.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 'b':
                Bias = atof(arg);
                argUsed = 1;
                break;
            case 'l':
                Lag = atoi(arg);
                argUsed = 1;
                break;
            case 'o':
                OctavesAllowed = atoi(arg);
                argUsed = 1;
                break;
            case 'r':
                Reach = atof(arg);
                argUsed = 1;
                break;
            case 'R':
                Report = 1;
                break;
            case 'h':
printf("pitch-a-fix usage:\n");
printf("  pitch-a-fix NOTES_FILE [INFILE [OUTFILE]]\n");
printf("pitch-a-fix options:\n");
printf("  -b N.N set the bias to N.N\n");
printf("         a bias above one will preferentially choose higher notes\n");
printf("         a below one bias will preferentially choose lower notes\n");
printf("         default is %f\n",Bias);
printf("  -l N   set the lag to N\n");
printf("         A lag of 3 means pitch correction will start on the fourth\n");
printf("         cycle in a row of a particular legal note\n");
printf("         smaller lag (and larger reach) sounds like Autotune\n");
printf("         default is %d\n",Lag);
printf("  -o N   set the number of allowed octaves to N\n");
printf("         a value greater than one will mean that cycles with\n");
printf("         frequencies that are an integral multiple (up to N) of\n");
printf("         legal notes will be considered for pitch correction\n");
printf("         default is %d\n",OctavesAllowed);
printf("  -R     generate a report (pitch-a-fix.rpt)\n");
printf("  -r N.N set the pitch correction reach to N.N semitones\n");
printf("         a setting of 1 means cycles more than one\n");
printf("         semitone away will not be pitch corrected\n");
printf("         larger reach (and smaller lag) sounds like Autotune\n");
printf("         default is %f\n",Reach);
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 0x27bb
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 0x27c7
jmp 0x2ab2
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 0x2808
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 0x281c
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 $-0x52, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x24, %eax
ja 0x2a75
movq -0x38(%rbp), %rax
leaq 0x47ff(%rip), %rcx      # 0x7048
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x78d7(%rip), %rsi      # 0xa130
movq 0x78d8(%rip), %rdx      # 0xa138
leaq 0x4e77(%rip), %rdi      # 0x76de
movb $0x0, %al
callq 0x20a0
xorl %edi, %edi
callq 0x21f0
movq -0x28(%rbp), %rdi
callq 0x2060
movsd %xmm0, 0x804a(%rip)     # 0xa8d0
movl $0x1, -0x18(%rbp)
jmp 0x2a8f
movq -0x28(%rbp), %rdi
callq 0x21e0
movl %eax, 0x8047(%rip)      # 0xa8e8
movl $0x1, -0x18(%rbp)
jmp 0x2a8f
movq -0x28(%rbp), %rdi
callq 0x21e0
movl %eax, 0x8004(%rip)      # 0xa8c0
movl $0x1, -0x18(%rbp)
jmp 0x2a8f
movq -0x28(%rbp), %rdi
callq 0x2060
movsd %xmm0, 0x7fef(%rip)     # 0xa8c8
movl $0x1, -0x18(%rbp)
jmp 0x2a8f
movl $0x1, 0x8025(%rip)      # 0xa914
jmp 0x2a8f
leaq 0x4df2(%rip), %rdi      # 0x76ed
movb $0x0, %al
callq 0x20a0
leaq 0x4df8(%rip), %rdi      # 0x7701
movb $0x0, %al
callq 0x20a0
leaq 0x4e17(%rip), %rdi      # 0x772e
movb $0x0, %al
callq 0x20a0
leaq 0x4e1f(%rip), %rdi      # 0x7744
movb $0x0, %al
callq 0x20a0
leaq 0x4e2f(%rip), %rdi      # 0x7762
movb $0x0, %al
callq 0x20a0
leaq 0x4e64(%rip), %rdi      # 0x77a5
movb $0x0, %al
callq 0x20a0
movsd 0x7f80(%rip), %xmm0     # 0xa8d0
leaq 0x4e90(%rip), %rdi      # 0x77e7
movb $0x1, %al
callq 0x20a0
leaq 0x4e9a(%rip), %rdi      # 0x77ff
movb $0x0, %al
callq 0x20a0
leaq 0x4ea7(%rip), %rdi      # 0x781a
movb $0x0, %al
callq 0x20a0
leaq 0x4ede(%rip), %rdi      # 0x785f
movb $0x0, %al
callq 0x20a0
leaq 0x4f04(%rip), %rdi      # 0x7893
movb $0x0, %al
callq 0x20a0
movl 0x7f4c(%rip), %esi      # 0xa8e8
leaq 0x4f2e(%rip), %rdi      # 0x78d1
movb $0x0, %al
callq 0x20a0
leaq 0x4f38(%rip), %rdi      # 0x78e9
movb $0x0, %al
callq 0x20a0
leaq 0x4f5b(%rip), %rdi      # 0x791a
movb $0x0, %al
callq 0x20a0
leaq 0x4f8b(%rip), %rdi      # 0x7958
movb $0x0, %al
callq 0x20a0
leaq 0x4fbe(%rip), %rdi      # 0x7999
movb $0x0, %al
callq 0x20a0
movl 0x7ed8(%rip), %esi      # 0xa8c0
leaq 0x4ee2(%rip), %rdi      # 0x78d1
movb $0x0, %al
callq 0x20a0
leaq 0x4fda(%rip), %rdi      # 0x79d7
movb $0x0, %al
callq 0x20a0
leaq 0x4ffa(%rip), %rdi      # 0x7a05
movb $0x0, %al
callq 0x20a0
leaq 0x5026(%rip), %rdi      # 0x7a3f
movb $0x0, %al
callq 0x20a0
leaq 0x504c(%rip), %rdi      # 0x7a73
movb $0x0, %al
callq 0x20a0
leaq 0x5072(%rip), %rdi      # 0x7aa7
movb $0x0, %al
callq 0x20a0
movsd 0x7e84(%rip), %xmm0     # 0xa8c8
leaq 0x4d9c(%rip), %rdi      # 0x77e7
movb $0x1, %al
callq 0x20a0
leaq 0x508c(%rip), %rdi      # 0x7ae5
movb $0x0, %al
callq 0x20a0
leaq 0x50a3(%rip), %rdi      # 0x7b0a
movb $0x0, %al
callq 0x20a0
xorl %edi, %edi
callq 0x21f0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x5091(%rip), %rdi      # 0x7b19
movb $0x0, %al
callq 0x3b30
cmpl $0x0, -0x1c(%rbp)
je 0x2aa4
cmpl $0x0, -0x18(%rbp)
je 0x2aa4
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2796
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)