// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/tune/tune.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 'h':
                printf("usage: rratune factor [<input rra file> [<output rra file>]]\n");
                printf("       a factor greater than one raises the pitch\n");
                printf("       a factor less than one lowers the pitch\n");
                break;
            case 'v':
                printf("%s version %s\n", PROGRAM_NAME, PROGRAM_VERSION);
                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 $0x30, %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 0x25eb
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 0x25f7
jmp 0x26fc
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 0x2638
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 0x264c
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
movl %eax, -0x30(%rbp)
subl $0x68, %eax
je 0x2670
jmp 0x2666
movl -0x30(%rbp), %eax
subl $0x76, %eax
je 0x269c
jmp 0x26bf
leaq 0x99ec(%rip), %rdi      # 0xc063
movb $0x0, %al
callq 0x20c0
leaq 0x9a1c(%rip), %rdi      # 0xc0a1
movb $0x0, %al
callq 0x20c0
leaq 0x9a41(%rip), %rdi      # 0xc0d4
movb $0x0, %al
callq 0x20c0
jmp 0x26d9
movq 0xdacd(%rip), %rsi      # 0x10170
movq 0xdace(%rip), %rdx      # 0x10178
leaq 0x9a53(%rip), %rdi      # 0xc104
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x2270
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x9a41(%rip), %rdi      # 0xc113
movb $0x0, %al
callq 0x88e0
cmpl $0x0, -0x1c(%rbp)
je 0x26ee
cmpl $0x0, -0x18(%rbp)
je 0x26ee
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x25c6
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop