// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/reverb/reverb.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 'a':
                a = atof(arg);
                argUsed = 1;
                break;
            case 'd':
                delay = atoi(arg);
                argUsed = 1;
                break;
            case 'g':
                g = atof(arg);
                argUsed = 1;
                break;
            case 's':
                stages = atoi(arg);
                argUsed = 1;
                break;
            default:
                printf("reverb options:\n");
                printf("  -a N.N  set the input gain to N.N\n");
                printf("          default is %f\n",a);
                printf("  -g N.N  set reverb loudness decay to N.N\n");
                printf("          good values are 0.4 to 0.8\n");
                printf("          higher values need higher -a\n");
                printf("          default is %f\n",g);
                printf("  -d N    set reverb delay to N milliseconds\n");
                printf("          good values are around 25 ms\n");
                printf("          default is %d\n",delay);
                printf("  -s N    set the number of stages to N\n");
                printf("          good values are around 5\n");
                printf("          the more stages, the higher -a needs to be\n");
                printf("          default is %d\n",stages);
                printf("  -h      help\n");
                exit(0);
                break;
            }

        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 0x25bb
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 0x25c7
jmp 0x27fd
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 0x2608
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 0x261c
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 $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x15, %eax
ja 0x26e5
movq -0x38(%rbp), %rax
leaq 0x99bb(%rip), %rcx      # 0xc004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xdb17(%rip), %rsi      # 0x10170
movq 0xdb18(%rip), %rdx      # 0x10178
leaq 0x9a67(%rip), %rdi      # 0xc0ce
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x2270
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xdb0a(%rip)     # 0x10190
movl $0x1, -0x18(%rbp)
jmp 0x27da
movq -0x28(%rbp), %rdi
callq 0x2250
movl %eax, 0xdadf(%rip)      # 0x10180
movl $0x1, -0x18(%rbp)
jmp 0x27da
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xdaca(%rip)     # 0x10188
movl $0x1, -0x18(%rbp)
jmp 0x27da
movq -0x28(%rbp), %rdi
callq 0x2250
movl %eax, 0xdaab(%rip)      # 0x10184
movl $0x1, -0x18(%rbp)
jmp 0x27da
leaq 0x99f1(%rip), %rdi      # 0xc0dd
movb $0x0, %al
callq 0x20c0
leaq 0x99f4(%rip), %rdi      # 0xc0ee
movb $0x0, %al
callq 0x20c0
movsd 0xda87(%rip), %xmm0     # 0x10190
leaq 0x9a03(%rip), %rdi      # 0xc113
movb $0x1, %al
callq 0x20c0
leaq 0x9a0e(%rip), %rdi      # 0xc12c
movb $0x0, %al
callq 0x20c0
leaq 0x9a2c(%rip), %rdi      # 0xc158
movb $0x0, %al
callq 0x20c0
leaq 0x9a44(%rip), %rdi      # 0xc17e
movb $0x0, %al
callq 0x20c0
movsd 0xda3f(%rip), %xmm0     # 0x10188
leaq 0x99c3(%rip), %rdi      # 0xc113
movb $0x1, %al
callq 0x20c0
leaq 0x9a48(%rip), %rdi      # 0xc1a6
movb $0x0, %al
callq 0x20c0
leaq 0x9a68(%rip), %rdi      # 0xc1d4
movb $0x0, %al
callq 0x20c0
movl 0xda07(%rip), %esi      # 0x10180
leaq 0x9a7c(%rip), %rdi      # 0xc1fc
movb $0x0, %al
callq 0x20c0
leaq 0x9a87(%rip), %rdi      # 0xc215
movb $0x0, %al
callq 0x20c0
leaq 0x9aa2(%rip), %rdi      # 0xc23e
movb $0x0, %al
callq 0x20c0
leaq 0x9ab8(%rip), %rdi      # 0xc262
movb $0x0, %al
callq 0x20c0
movl 0xd9cd(%rip), %esi      # 0x10184
leaq 0x9a3e(%rip), %rdi      # 0xc1fc
movb $0x0, %al
callq 0x20c0
leaq 0x9acc(%rip), %rdi      # 0xc298
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x2270
cmpl $0x0, -0x1c(%rbp)
je 0x27ef
cmpl $0x0, -0x18(%rbp)
je 0x27ef
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2596
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)