// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/silence/silence.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 'a':
                amplify = atof(arg);
                argUsed = 1;
                break;
            case 't':
                thresholdDb = atoi(arg);
                argUsed = 1;
                break;
            case 'u':
                volumeUpWait = atof(arg);
                argUsed = 1;
                break;
            case 'U':
                volumeUpRamp = atof(arg);
                argUsed = 1;
                break;
            case 'd':
                volumeDownWait = atof(arg);
                argUsed = 1;
                break;
            case 'D':
                volumeDownRamp = atof(arg);
                argUsed = 1;
                break;
            case 'v':
                printf("%s version %s\n", PROGRAM_NAME, PROGRAM_VERSION);
                exit(0);
                break;
            case 'h':
                printf("silence:\n");
                printf("    reduces the volume on regions that appear to\n");
                printf("    be silent - it is mainly used to remove\n");
                printf("    recording hiss and background noises\n");
                printf("\n");
                printf("silence options:\n");
                printf("  -a N     set amplification factor to N\n");
                printf("           amplification happens after compression\n");
                printf("           default value is %f\n",amplify);
                printf("  -t N     set threshold to N decibels\n");
                printf("           good values range from -20 downwards\n");
                printf("           lower values mean more of the audio is "
                    "unchanged\n");
                printf("           default value is %d\n",thresholdDb);
                printf("  -u N     set volume up wait time to N seconds\n");
                printf("           wait time is how long to wait before "
                    "increasing volume\n");
                printf("           good values range from 0 to 0.01 seconds\n");
                printf("           default value is %f\n",volumeUpWait);
                printf("  -U N     set volume up ramp time to N seconds\n");
                printf("           ramp time is how long it takes to achieve "
                    "full volume\n");
                printf("           once the wait time has passed\n");
                printf("           good values range from 0.01 upwards\n");
                printf("           default value is %f\n",volumeUpRamp);
                printf("  -d N     set volume down wait time to N seconds\n");
                printf("           good values range from 0 to 0.02 seconds\n");
                printf("           default value is %f\n",volumeDownWait);
                printf("  -D N     set volume down ramp time to N seconds\n");
                printf("           good values range from 0.02 upwards\n");
                printf("           default value is %f\n",volumeDownRamp);
                printf("  -v       display this program's 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 0x293b
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 0x2947
jmp 0x2cb7
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 0x2988
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 0x299c
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 $-0x44, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x32, %eax
ja 0x2c7a
movq -0x38(%rbp), %rax
leaq 0x965f(%rip), %rcx      # 0xc028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xe7c5(%rip)     # 0x111a8
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq -0x28(%rbp), %rdi
callq 0x2250
movl %eax, 0xe782(%rip)      # 0x11180
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xe77d(%rip)     # 0x11198
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xe750(%rip)     # 0x11188
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xe74b(%rip)     # 0x111a0
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq -0x28(%rbp), %rdi
callq 0x2070
movsd %xmm0, 0xe71e(%rip)     # 0x11190
movl $0x1, -0x18(%rbp)
jmp 0x2c94
movq 0xe6eb(%rip), %rsi      # 0x11170
movq 0xe6ec(%rip), %rdx      # 0x11178
leaq 0x97cb(%rip), %rdi      # 0xc25e
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x2270
leaq 0x97c5(%rip), %rdi      # 0xc26d
movb $0x0, %al
callq 0x20c0
leaq 0x97c1(%rip), %rdi      # 0xc277
movb $0x0, %al
callq 0x20c0
leaq 0x97e5(%rip), %rdi      # 0xc2a9
movb $0x0, %al
callq 0x20c0
leaq 0x9804(%rip), %rdi      # 0xc2d6
movb $0x0, %al
callq 0x20c0
leaq 0x9ed0(%rip), %rdi      # 0xc9b0
movb $0x0, %al
callq 0x20c0
leaq 0x9812(%rip), %rdi      # 0xc300
movb $0x0, %al
callq 0x20c0
leaq 0x9816(%rip), %rdi      # 0xc312
movb $0x0, %al
callq 0x20c0
leaq 0x9832(%rip), %rdi      # 0xc33c
movb $0x0, %al
callq 0x20c0
movsd 0xe68f(%rip), %xmm0     # 0x111a8
leaq 0x9850(%rip), %rdi      # 0xc370
movb $0x1, %al
callq 0x20c0
leaq 0x9862(%rip), %rdi      # 0xc390
movb $0x0, %al
callq 0x20c0
leaq 0x987c(%rip), %rdi      # 0xc3b8
movb $0x0, %al
callq 0x20c0
leaq 0x989f(%rip), %rdi      # 0xc3e9
movb $0x0, %al
callq 0x20c0
movl 0xe629(%rip), %esi      # 0x11180
leaq 0x98c8(%rip), %rdi      # 0xc426
movb $0x0, %al
callq 0x20c0
leaq 0x98da(%rip), %rdi      # 0xc446
movb $0x0, %al
callq 0x20c0
leaq 0x98fd(%rip), %rdi      # 0xc477
movb $0x0, %al
callq 0x20c0
leaq 0x9932(%rip), %rdi      # 0xc4ba
movb $0x0, %al
callq 0x20c0
movsd 0xe601(%rip), %xmm0     # 0x11198
leaq 0x97d2(%rip), %rdi      # 0xc370
movb $0x1, %al
callq 0x20c0
leaq 0x9943(%rip), %rdi      # 0xc4ef
movb $0x0, %al
callq 0x20c0
leaq 0x9966(%rip), %rdi      # 0xc520
movb $0x0, %al
callq 0x20c0
leaq 0x999a(%rip), %rdi      # 0xc562
movb $0x0, %al
callq 0x20c0
leaq 0x99b6(%rip), %rdi      # 0xc58c
movb $0x0, %al
callq 0x20c0
movsd 0xe5a3(%rip), %xmm0     # 0x11188
leaq 0x9784(%rip), %rdi      # 0xc370
movb $0x1, %al
callq 0x20c0
leaq 0x99c2(%rip), %rdi      # 0xc5bc
movb $0x0, %al
callq 0x20c0
leaq 0x99e7(%rip), %rdi      # 0xc5ef
movb $0x0, %al
callq 0x20c0
movsd 0xe589(%rip), %xmm0     # 0x111a0
leaq 0x9752(%rip), %rdi      # 0xc370
movb $0x1, %al
callq 0x20c0
leaq 0x99f8(%rip), %rdi      # 0xc624
movb $0x0, %al
callq 0x20c0
leaq 0x9a1d(%rip), %rdi      # 0xc657
movb $0x0, %al
callq 0x20c0
movsd 0xe547(%rip), %xmm0     # 0x11190
leaq 0x9720(%rip), %rdi      # 0xc370
movb $0x1, %al
callq 0x20c0
leaq 0x9a29(%rip), %rdi      # 0xc687
movb $0x0, %al
callq 0x20c0
leaq 0x9a4d(%rip), %rdi      # 0xc6b9
movb $0x0, %al
callq 0x20c0
xorl %edi, %edi
callq 0x2270
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x9a3d(%rip), %rdi      # 0xc6ca
movb $0x0, %al
callq 0x8f80
cmpl $0x0, -0x1c(%rbp)
je 0x2ca9
cmpl $0x0, -0x18(%rbp)
je 0x2ca9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2916
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq