// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/correct/correct.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 'w':
                WindowSize = atoi(arg);
                argUsed = 1;
                break;
            case 'b':
                Bias = atof(arg);
                argUsed = 1;
                break;
            case 'c':
                CorrelationSize = atoi(arg);
                argUsed = 1;
                break;
            case 'p':
                Passes = atoi(arg);
                argUsed = 1;
                break;
            case 'h':
                printf("correct usage:\n");
                printf("  rracorrect [OPTIONS] [INFILE [OUTFILE]]\n");
                printf("correct options:\n");
                printf("  -b N.N set the bias to N.N\n");
                printf("         a bias above one will preferentially shift to higher notes\n");
                printf("         a below one bias will preferentially shift to lower notes\n");
                printf("         default is %.1f\n",Bias);
                printf("  -c N   set the correlation size to N\n");
                printf("         default is %d\n",CorrelationSize);
                printf("  -p N   set the number of passes looking for cycle starts to N\n");
                printf("         default is %d\n",Passes);
                printf("  -w N   set the window size to N\n");
                printf("         default is %d\n",WindowSize);
                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 0x267b
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 0x2687
jmp 0x28d3
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 0x26c8
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 0x26dc
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 $-0x62, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x15, %eax
ja 0x2896
movq -0x38(%rbp), %rax
leaq 0xa8fb(%rip), %rcx      # 0xd004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xfa67(%rip), %rsi      # 0x12180
movq 0xfa68(%rip), %rdx      # 0x12188
leaq 0xae1e(%rip), %rdi      # 0xd545
movb $0x0, %al
callq 0x20d0
xorl %edi, %edi
callq 0x2280
movq -0x28(%rbp), %rdi
callq 0x2260
movl %eax, 0x101cc(%rip)     # 0x12910
movl $0x1, -0x18(%rbp)
jmp 0x28b0
movq -0x28(%rbp), %rdi
callq 0x2080
movsd %xmm0, 0x101bf(%rip)    # 0x12920
movl $0x1, -0x18(%rbp)
jmp 0x28b0
movq -0x28(%rbp), %rdi
callq 0x2260
movl %eax, 0x1019c(%rip)     # 0x12918
movl $0x1, -0x18(%rbp)
jmp 0x28b0
movq -0x28(%rbp), %rdi
callq 0x2260
movl %eax, 0x1017d(%rip)     # 0x12914
movl $0x1, -0x18(%rbp)
jmp 0x28b0
leaq 0xadaa(%rip), %rdi      # 0xd554
movb $0x0, %al
callq 0x20d0
leaq 0xadac(%rip), %rdi      # 0xd564
movb $0x0, %al
callq 0x20d0
leaq 0xadc9(%rip), %rdi      # 0xd58f
movb $0x0, %al
callq 0x20d0
leaq 0xadcd(%rip), %rdi      # 0xd5a1
movb $0x0, %al
callq 0x20d0
leaq 0xaddd(%rip), %rdi      # 0xd5bf
movb $0x0, %al
callq 0x20d0
leaq 0xae14(%rip), %rdi      # 0xd604
movb $0x0, %al
callq 0x20d0
movsd 0x10121(%rip), %xmm0    # 0x12920
leaq 0xae42(%rip), %rdi      # 0xd648
movb $0x1, %al
callq 0x20d0
leaq 0xae4e(%rip), %rdi      # 0xd662
movb $0x0, %al
callq 0x20d0
movl 0x100f7(%rip), %esi     # 0x12918
leaq 0xae62(%rip), %rdi      # 0xd68a
movb $0x0, %al
callq 0x20d0
leaq 0xae6c(%rip), %rdi      # 0xd6a2
movb $0x0, %al
callq 0x20d0
movl 0x100d1(%rip), %esi     # 0x12914
leaq 0xae40(%rip), %rdi      # 0xd68a
movb $0x0, %al
callq 0x20d0
leaq 0xae8b(%rip), %rdi      # 0xd6e3
movb $0x0, %al
callq 0x20d0
movl 0x100ab(%rip), %esi     # 0x12910
leaq 0xae1e(%rip), %rdi      # 0xd68a
movb $0x0, %al
callq 0x20d0
leaq 0xae8c(%rip), %rdi      # 0xd706
movb $0x0, %al
callq 0x20d0
leaq 0xaea3(%rip), %rdi      # 0xd72b
movb $0x0, %al
callq 0x20d0
xorl %edi, %edi
callq 0x2280
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xae91(%rip), %rdi      # 0xd73a
movb $0x0, %al
callq 0x9670
cmpl $0x0, -0x1c(%rbp)
je 0x28c5
cmpl $0x0, -0x18(%rbp)
je 0x28c5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2656
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)