// File: /workspace/github_cpp_makefile_star2_O1/jmmccracken[P]PAI/ccmth.cpp
// Function: ReadCmdLineArgs(int, char**)
bool ReadCmdLineArgs(int argc, char **argv){

    bool bInputSet = false,
         bOutputSet = false;

    for(int iter=1;iter < argc;iter++ ){

        if( (strcmp("-h",argv[iter]) == 0) || (strcmp("-?",argv[iter]) == 0) ){
            CmdLineHelp(argv[0]);
            return( false );

        }else if( strcmp("-E",argv[iter]) == 0 ){

            iEmbeddingDimension = atoi(argv[iter+1]);

        }else if( strcmp("-t",argv[iter]) == 0 ){

            iLagTimeStep = atoi(argv[iter+1]);

        }else if( strcmp("-Ey",argv[iter]) == 0 ){

            iYEmbeddingDimension = atoi(argv[iter+1]);

        }else if( strcmp("-ty",argv[iter]) == 0 ){

            iYLagTimeStep = atoi(argv[iter+1]);

        }else if( strcmp("-L",argv[iter]) == 0 ){

            iLibraryLength = atoi(argv[iter+1]);

        }else if( strcmp("-f",argv[iter]) == 0 ){

            cFilename = argv[iter+1];
            bInputSet = true;

        }else if( strcmp("-n",argv[iter]) == 0 ){

            iNumOfTimeSeries = atoi(argv[iter+1]);

        }else if( strcmp("-p",argv[iter]) == 0 ){

            iNumThreads = atoi(argv[iter+1]);

        }else if( strcmp("-o",argv[iter]) == 0 ){

            cOutputname = argv[iter+1];
            bOutputSet = true;

        }else if( strcmp("-eY",argv[iter]) == 0 ){

            cTSOutputname = argv[iter+1];
            bSaveEstimatedTS = true;

        }else if( strcmp("-v",argv[iter]) == 0 ){

            bVerboseFlag = true;

        }else if( strcmp("-PAI",argv[iter]) == 0 ){

            bPAI = true;

        }else if( strcmp("-L2",argv[iter]) == 0 ){

            bL2 = true;

        }else if( strcmp("-Op",argv[iter]) == 0 ){

            bOptThreading = true;
            iThreadWaitSec = atoi(argv[iter+1]);

        }else if( strcmp("-FindLag",argv[iter]) == 0 ){

            bFindLag = true;
            iMaxAutoCorrToCheck = atoi(argv[iter+1]);
            dCompareTolerance = atof(argv[iter+2]);
        }else if( strcmp("-FindE",argv[iter]) == 0 ){

            bFindE = true;
            iNumberOfTimeStep2Check = atoi(argv[iter+1]);
            dWeightToleranceLevel = atof(argv[iter+2]);

        }

    }

    //Make sure the required things were defined
    if( iEmbeddingDimension < 0 && !bFindLag ){
        fprintf(stderr, "Error: embedding dimension is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( iLagTimeStep < 0 && !bFindLag ){
        fprintf(stderr, "Error: lag time step is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( iLibraryLength < 0 ){
        fprintf(stderr, "Error: library length is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( !bInputSet ){
        fprintf(stderr, "Error: input data filename is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( iNumOfTimeSeries < 0 ){
        fprintf(stderr, "Error: number of time series in input data file not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( !bOutputSet ){
        fprintf(stderr, "Error: output data filename is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( bOptThreading && (iThreadWaitSec < 0) ){
        fprintf(stderr, "Error: Thread wait time must be defined as an integer > 0\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }
    if( !bSaveEstimatedTS ){
        fprintf(stderr, "Error: output data filename for estimated time series not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindLag && (iMaxAutoCorrToCheck < 0) ){
        fprintf(stderr, "Error: maximum autocorrelation lag time to check is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindLag && (dCompareTolerance < 0) ){
        fprintf(stderr, "Error: autocorrelation comparison tolerance is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindE && (iNumberOfTimeStep2Check < 0) ){
        fprintf(stderr, "Error: number of time steps to check is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindE && (dWeightToleranceLevel < 0) ){
        fprintf(stderr, "Error: weight tolerance is not defined\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindE && bFindLag ){
        fprintf(stderr, "Error: -FindLag and -FindE cannot be used together\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindE && bPAI ){
        fprintf(stderr, "Error: -FindE and -PAI cannot be used together\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( bFindLag && bPAI ){
        fprintf(stderr, "Error: -FindLag and -PAI cannot be used together\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }if( (iNumThreads != 0) && bSaveEstimatedTS ){
        fprintf(stderr, "Error: -eY cannot be used with threading\n\n");
        CmdLineHelp(argv[0]);
        return( false );
    }

    //Issue any warnings
    if( iNumThreads < 0 ){
        fprintf(stderr, "Warning: number of threads improperly defined; using default\n");
        iNumThreads = 0;
    }
    if( bVerboseFlag && (iNumThreads != 0) ){
        fprintf(stderr, "Warning: verbose logging is not available with multiple threads; turning off verbose output\n");
        bVerboseFlag = false;
    }


    return( true );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x2, %edi
jl 0x61e1
movl %edi, %r12d
movl $0x1, %r15d
movl $0x0, -0x2c(%rbp)
leaq 0x27be(%rip), %r14      # 0x868a
movl $0x0, -0x30(%rbp)
movq (%rbx,%r15,8), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6311
leaq 0x279c(%rip), %rdi      # 0x868d
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6311
leaq 0x2788(%rip), %rdi      # 0x8690
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x609f
leaq 0x2774(%rip), %rdi      # 0x8693
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60b4
leaq 0x2760(%rip), %rdi      # 0x8696
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60c9
leaq 0x274d(%rip), %rdi      # 0x869a
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60de
leaq 0x273a(%rip), %rdi      # 0x869e
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60f3
leaq 0x2726(%rip), %rdi      # 0x86a1
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6108
leaq 0x2712(%rip), %rdi      # 0x86a4
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x611e
leaq 0x26fe(%rip), %rdi      # 0x86a7
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6133
leaq 0x26ea(%rip), %rdi      # 0x86aa
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6148
leaq 0x26d6(%rip), %rdi      # 0x86ad
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x615b
leaq 0x26c3(%rip), %rdi      # 0x86b1
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6170
leaq 0x26af(%rip), %rdi      # 0x86b4
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6179
leaq 0x269d(%rip), %rdi      # 0x86b9
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6182
leaq 0x268a(%rip), %rdi      # 0x86bd
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x618b
leaq 0x2677(%rip), %rdi      # 0x86c1
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x61a4
leaq 0x2669(%rip), %rdi      # 0x86ca
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
jne 0x61cd
movb $0x1, 0x71bc(%rip)      # 0xd234
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x7148(%rip)      # 0xd1d0
movq 0x10(%rbx,%r15,8), %rdi
callq 0x3220
movsd %xmm0, 0x714e(%rip)     # 0xd1e8
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x7109(%rip)      # 0xd1b8
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x70f8(%rip)      # 0xd1bc
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x70fb(%rip)      # 0xd1d4
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x70ea(%rip)      # 0xd1d8
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x70bd(%rip)      # 0xd1c0
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x7114(%rip)      # 0xd228
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x7096(%rip)      # 0xd1c4
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x70cd(%rip)      # 0xd210
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x70c4(%rip)      # 0xd218
movb $0x1, %al
movl %eax, -0x2c(%rbp)
jmp 0x61cd
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x70b9(%rip)      # 0xd220
movb $0x1, 0x70c4(%rip)      # 0xd232
jmp 0x61cd
movb $0x1, 0x70b9(%rip)      # 0xd230
jmp 0x61cd
movb $0x1, 0x70b5(%rip)      # 0xd235
jmp 0x61cd
movb $0x1, 0x70af(%rip)      # 0xd238
jmp 0x61cd
movb $0x1, 0x709f(%rip)      # 0xd231
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x7026(%rip)      # 0xd1c8
jmp 0x61cd
movb $0x1, 0x7088(%rip)      # 0xd233
movq 0x8(%rbx,%r15,8), %rdi
callq 0x3290
movl %eax, 0x7011(%rip)      # 0xd1cc
movq 0x10(%rbx,%r15,8), %rdi
callq 0x3220
movsd %xmm0, 0x7013(%rip)     # 0xd1e0
incq %r15
cmpq %r15, %r12
jne 0x5ed3
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
jmp 0x61e5
xorl %ecx, %ecx
xorl %eax, %eax
cmpl $0x0, 0x6fcc(%rip)      # 0xd1b8
jns 0x61fb
cmpb $0x0, 0x703e(%rip)      # 0xd233
je 0x63aa
cmpl $0x0, 0x6fba(%rip)      # 0xd1bc
jns 0x6211
cmpb $0x0, 0x7028(%rip)      # 0xd233
je 0x63b7
cmpl $0x0, 0x6fa8(%rip)      # 0xd1c0
js 0x632c
testb $0x1, %cl
je 0x6336
cmpl $0x0, 0x6f96(%rip)      # 0xd1c4
js 0x6340
testb $0x1, %al
je 0x634a
cmpb $0x1, 0x6fee(%rip)      # 0xd231
jne 0x6252
cmpl $0x0, 0x6f7c(%rip)      # 0xd1c8
js 0x6354
cmpb $0x0, 0x6fd9(%rip)      # 0xd232
je 0x635e
movb 0x6fce(%rip), %al       # 0xd233
cmpb $0x1, %al
jne 0x6276
cmpl $0x0, 0x6f5c(%rip)      # 0xd1cc
js 0x6368
testb %al, %al
je 0x628c
xorpd %xmm0, %xmm0
ucomisd 0x6f5a(%rip), %xmm0     # 0xd1e0
ja 0x6372
movb 0x6fa2(%rip), %cl       # 0xd234
cmpb $0x1, %cl
jne 0x62a4
cmpl $0x0, 0x6f32(%rip)      # 0xd1d0
js 0x637c
testb %cl, %cl
je 0x62ba
xorpd %xmm0, %xmm0
ucomisd 0x6f34(%rip), %xmm0     # 0xd1e8
ja 0x6386
movl %eax, %edx
andb %cl, %dl
cmpb $0x1, %dl
je 0x6390
testb %cl, %cl
je 0x62d8
cmpb $0x1, 0x6f63(%rip)      # 0xd235
je 0x63c4
testb %al, %al
je 0x62e9
cmpb $0x1, 0x6f52(%rip)      # 0xd235
je 0x63d1
cmpl $0x0, 0x6f20(%rip)      # 0xd210
jne 0x639d
movb $0x1, %bl
cmpb $0x1, 0x6f31(%rip)      # 0xd230
jne 0x631b
cmpl $0x0, 0x6f08(%rip)      # 0xd210
je 0x631b
callq 0x3b7c
jmp 0x631b
movq (%rbx), %rdi
callq 0x64fb
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3d70
jmp 0x6319
movq %rbx, %rdi
callq 0x3ab0
jmp 0x6319
movq %rbx, %rdi
callq 0x3d3d
jmp 0x6319
movq %rbx, %rdi
callq 0x3ae3
jmp 0x6319
movq %rbx, %rdi
callq 0x3d0a
jmp 0x6319
movq %rbx, %rdi
callq 0x3b16
jmp 0x6319
movq %rbx, %rdi
callq 0x3cd7
jmp 0x6319
movq %rbx, %rdi
callq 0x3ca4
jmp 0x6319
movq %rbx, %rdi
callq 0x3c71
jmp 0x6319
movq %rbx, %rdi
callq 0x3c3e
jmp 0x6319
movq %rbx, %rdi
callq 0x3c0b
jmp 0x6319
movq %rbx, %rdi
callq 0x3b49
jmp 0x6319
movq %rbx, %rdi
callq 0x3a4a
jmp 0x6319
movq %rbx, %rdi
callq 0x3a7d
jmp 0x6319
movq %rbx, %rdi
callq 0x3bd8
jmp 0x6319
movq %rbx, %rdi
callq 0x3ba5
jmp 0x6319