// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/extract/extract.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':
                Base = arg;
                argUsed = 1;
                break;
            case 'c':
                TimingData = 0;
                break;
            case 'g':
                Gap = atof(arg);
                argUsed = 1;
                break;
            case 'p':
                Prelude = atof(arg);
                argUsed = 1;
                break;
            case 'r':
                Repeats = atoi(arg);
                argUsed = 1;
                break;
            case 's':
                StartingNote = atoi(arg);
                argUsed = 1;
                break;
            case 't':
                TakeNumber = atoi(arg);
                argUsed = 1;
                break;
            case 'T':
                Threshold = atof(arg);
                argUsed = 1;
                break;
            case 'h':
                printf("usage:\n");
                printf("  %s [OPTIONS] [INFILE]\n",PROGRAM_NAME);
                printf("options:\n");
                printf("  -b S   set the base name of the extract phrase to S\n");
                printf("         default is %s\n",Base);
                printf("  -c     do not store timing data\n");
                printf("         default is to store timing data\n");
                printf("  -g N.N set the longest gap in a phrase to N.N seconds\n");
                printf("         default is %f seconds\n",Gap);
                printf("  -p N.N set the phrase lead-in to N.N seconds\n");
                printf("         default is %f seconds\n",Prelude);
                printf("  -r N   set the number of note or phrase repeats to N\n");
                printf("         default is %d\n",Repeats);
                printf("  -s N   set the staring note or phrase number to N\n");
                printf("         default is %d\n",StartingNote);
                printf("  -t N   set the take number to N\n");
                printf("         default is %d\n",TakeNumber);
                printf("  -T N.N set the threshold for silence to N.N decibels\n");
                printf("         higher numbers mean more tolerance for noise\n");
                printf("         a zero threshold means the threshold is set automatically\n");
                printf("         default is %.2f\n",Threshold);
                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 0x13eb
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 0x13f7
jmp 0x1731
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 0x1438
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 0x144c
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 $-0x54, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x22, %eax
ja 0x16f4
movq -0x38(%rbp), %rax
leaq 0x2b8b(%rip), %rcx      # 0x4004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x5c47(%rip), %rsi      # 0x70d0
movq 0x5c48(%rip), %rdx      # 0x70d8
leaq 0x2d16(%rip), %rdi      # 0x41ad
movb $0x0, %al
callq 0x10a0
xorl %edi, %edi
callq 0x1160
movq -0x28(%rbp), %rax
movq %rax, 0x5c38(%rip)      # 0x70e8
movl $0x1, -0x18(%rbp)
jmp 0x170e
movl $0x0, 0x5c1a(%rip)      # 0x70e0
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1060
movsd %xmm0, 0x5c14(%rip)     # 0x70f0
movl $0x1, -0x18(%rbp)
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1060
movsd %xmm0, 0x5c07(%rip)     # 0x7100
movl $0x1, -0x18(%rbp)
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1150
movl %eax, 0x5bf4(%rip)      # 0x7108
movl $0x1, -0x18(%rbp)
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1150
movl %eax, 0x5bf9(%rip)      # 0x7128
movl $0x1, -0x18(%rbp)
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1150
movl %eax, 0x5bce(%rip)      # 0x7118
movl $0x1, -0x18(%rbp)
jmp 0x170e
movq -0x28(%rbp), %rdi
callq 0x1060
movsd %xmm0, 0x5b91(%rip)     # 0x70f8
movl $0x1, -0x18(%rbp)
jmp 0x170e
leaq 0x2c42(%rip), %rdi      # 0x41bc
movb $0x0, %al
callq 0x10a0
movq 0x5b48(%rip), %rsi      # 0x70d0
leaq 0x2c35(%rip), %rdi      # 0x41c4
movb $0x0, %al
callq 0x10a0
leaq 0x2c40(%rip), %rdi      # 0x41dd
movb $0x0, %al
callq 0x10a0
leaq 0x2c3c(%rip), %rdi      # 0x41e7
movb $0x0, %al
callq 0x10a0
movq 0x5b2f(%rip), %rsi      # 0x70e8
leaq 0x2c5e(%rip), %rdi      # 0x421e
movb $0x0, %al
callq 0x10a0
leaq 0x2c68(%rip), %rdi      # 0x4236
movb $0x0, %al
callq 0x10a0
leaq 0x2c7d(%rip), %rdi      # 0x4259
movb $0x0, %al
callq 0x10a0
leaq 0x2c99(%rip), %rdi      # 0x4283
movb $0x0, %al
callq 0x10a0
movsd 0x5af7(%rip), %xmm0     # 0x70f0
leaq 0x2cbc(%rip), %rdi      # 0x42bc
movb $0x1, %al
callq 0x10a0
leaq 0x2cce(%rip), %rdi      # 0x42dc
movb $0x0, %al
callq 0x10a0
movsd 0x5ae3(%rip), %xmm0     # 0x7100
leaq 0x2c98(%rip), %rdi      # 0x42bc
movb $0x1, %al
callq 0x10a0
leaq 0x2cda(%rip), %rdi      # 0x430c
movb $0x0, %al
callq 0x10a0
movl 0x5ac9(%rip), %esi      # 0x7108
leaq 0x2cfe(%rip), %rdi      # 0x4344
movb $0x0, %al
callq 0x10a0
leaq 0x2d08(%rip), %rdi      # 0x435c
movb $0x0, %al
callq 0x10a0
movl 0x5ac7(%rip), %esi      # 0x7128
leaq 0x2cdc(%rip), %rdi      # 0x4344
movb $0x0, %al
callq 0x10a0
leaq 0x2d1b(%rip), %rdi      # 0x4391
movb $0x0, %al
callq 0x10a0
movl 0x5a95(%rip), %esi      # 0x7118
leaq 0x2cba(%rip), %rdi      # 0x4344
movb $0x0, %al
callq 0x10a0
leaq 0x2d1c(%rip), %rdi      # 0x43b4
movb $0x0, %al
callq 0x10a0
leaq 0x2d46(%rip), %rdi      # 0x43ec
movb $0x0, %al
callq 0x10a0
leaq 0x2d6f(%rip), %rdi      # 0x4423
movb $0x0, %al
callq 0x10a0
movsd 0x5a35(%rip), %xmm0     # 0x70f8
leaq 0x2d9d(%rip), %rdi      # 0x4467
movb $0x1, %al
callq 0x10a0
leaq 0x2da9(%rip), %rdi      # 0x4481
movb $0x0, %al
callq 0x10a0
leaq 0x2dc0(%rip), %rdi      # 0x44a6
movb $0x0, %al
callq 0x10a0
xorl %edi, %edi
callq 0x1160
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x2dae(%rip), %rdi      # 0x44b5
movb $0x0, %al
callq 0x1ca0
cmpl $0x0, -0x1c(%rbp)
je 0x1723
cmpl $0x0, -0x18(%rbp)
je 0x1723
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x13c6
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)