// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/fixclip/fixclip.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 'c':
                Checking = !Checking;
                break;
            case 'd':
                DipFactor = atoi(arg);
                argUsed = 1;
                break;
            case 's':
                Smoothings = atoi(arg);
                argUsed = 1;
                break;
            case 'h':
                printf("fixclip options:\n");
                printf("    -c     just check if clips are present\n");
                printf("           clips reported on stderr\n");
                printf("           return value is non-zero if clips present\n");
                printf("    -d N   set the dip factor to N\n");
                printf("           default is %d\n",DipFactor);
                printf("    -h     help\n");
                printf("    -s N   set the number of smoothing passes to N\n");
                printf("           default is %d\n",Smoothings);
                exit(0);
                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 $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 0x19ab
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 0x19b7
jmp 0x1b85
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 0x19f8
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 0x1a0c
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 $-0x63, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x13, %eax
ja 0x1b48
movq -0x38(%rbp), %rax
leaq 0x35d7(%rip), %rcx      # 0x5010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x670b(%rip)      # 0x8154
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x66fb(%rip)      # 0x8154
jmp 0x1b62
movq -0x28(%rbp), %rdi
callq 0x11d0
movl %eax, 0x66c7(%rip)      # 0x8134
movl $0x1, -0x18(%rbp)
jmp 0x1b62
movq -0x28(%rbp), %rdi
callq 0x11d0
movl %eax, 0x66a8(%rip)      # 0x8130
movl $0x1, -0x18(%rbp)
jmp 0x1b62
leaq 0x36ba(%rip), %rdi      # 0x5155
movb $0x0, %al
callq 0x1090
leaq 0x36be(%rip), %rdi      # 0x5167
movb $0x0, %al
callq 0x1090
leaq 0x36dc(%rip), %rdi      # 0x5193
movb $0x0, %al
callq 0x1090
leaq 0x36f3(%rip), %rdi      # 0x51b8
movb $0x0, %al
callq 0x1090
leaq 0x371b(%rip), %rdi      # 0x51ee
movb $0x0, %al
callq 0x1090
movl 0x6654(%rip), %esi      # 0x8134
leaq 0x372b(%rip), %rdi      # 0x5212
movb $0x0, %al
callq 0x1090
leaq 0x3737(%rip), %rdi      # 0x522c
movb $0x0, %al
callq 0x1090
leaq 0x373a(%rip), %rdi      # 0x523d
movb $0x0, %al
callq 0x1090
movl 0x6620(%rip), %esi      # 0x8130
leaq 0x36fb(%rip), %rdi      # 0x5212
movb $0x0, %al
callq 0x1090
xorl %edi, %edi
callq 0x11e0
movq 0x65f4(%rip), %rsi      # 0x8120
movq 0x65f5(%rip), %rdx      # 0x8128
leaq 0x3737(%rip), %rdi      # 0x5271
movb $0x0, %al
callq 0x1090
xorl %edi, %edi
callq 0x11e0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3725(%rip), %rdi      # 0x5280
movb $0x0, %al
callq 0x1ec0
cmpl $0x0, -0x1c(%rbp)
je 0x1b77
cmpl $0x0, -0x18(%rbp)
je 0x1b77
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1986
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop