// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x18, %rsp
movq %rsi, %rbx
cmpl $0x2, %edi
jl 0x61ee
movl %edi, %eax
movq %rax, -0x38(%rbp)
movl $0x1, %r14d
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq (%rbx,%r14,8), %r13
movzbl (%r13), %r12d
leal -0x2d(%r12), %r15d
negl %r15d
movl %r15d, %eax
cmpl $0x2d, %r12d
jne 0x5eb3
movzbl 0x1(%r13), %eax
subl $0x68, %eax
jne 0x5e8f
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x6368
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5eb3
movzbl 0x1(%r13), %eax
subl $0x3f, %eax
jne 0x5eb1
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x6368
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5ef7
movzbl 0x1(%r13), %eax
subl $0x45, %eax
jne 0x5ed3
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x60db
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5ef7
movzbl 0x1(%r13), %eax
subl $0x74, %eax
jne 0x5ef5
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x60b1
leaq 0x2784(%rip), %rdi      # 0x868a
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60c6
leaq 0x2771(%rip), %rdi      # 0x868e
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x60f0
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5f69
movzbl 0x1(%r13), %eax
subl $0x4c, %eax
jne 0x5f45
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x611b
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5f69
movzbl 0x1(%r13), %eax
subl $0x66, %eax
jne 0x5f67
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x6105
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5fad
movzbl 0x1(%r13), %eax
subl $0x6e, %eax
jne 0x5f89
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x615b
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5fad
movzbl 0x1(%r13), %eax
subl $0x70, %eax
jne 0x5fab
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x6130
movl %r15d, %eax
cmpb $0x2d, %r12b
jne 0x5fcf
movzbl 0x1(%r13), %eax
subl $0x6f, %eax
jne 0x5fcd
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x6145
leaq 0x26b4(%rip), %rdi      # 0x8692
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x616d
cmpb $0x2d, %r12b
jne 0x6007
movzbl 0x1(%r13), %r15d
subl $0x76, %r15d
jne 0x6004
movzbl 0x2(%r13), %r15d
negl %r15d
testl %r15d, %r15d
je 0x6182
leaq 0x267f(%rip), %rdi      # 0x8696
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x618b
leaq 0x266d(%rip), %rdi      # 0x869b
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x6194
leaq 0x265a(%rip), %rdi      # 0x869f
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x619d
leaq 0x2647(%rip), %rdi      # 0x86a3
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
je 0x61b6
leaq 0x2639(%rip), %rdi      # 0x86ac
movq %r13, %rsi
callq 0x3250
testl %eax, %eax
jne 0x61df
movb $0x1, 0x71aa(%rip)      # 0xd234
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x7136(%rip)      # 0xd1d0
movq 0x10(%rbx,%r14,8), %rdi
callq 0x3220
movsd %xmm0, 0x713c(%rip)     # 0xd1e8
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x70fb(%rip)      # 0xd1bc
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x70fe(%rip)      # 0xd1d4
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x70cd(%rip)      # 0xd1b8
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x70d8(%rip)      # 0xd1d8
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rax
movq %rax, 0x7117(%rip)      # 0xd228
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x7095(%rip)      # 0xd1c0
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x70d0(%rip)      # 0xd210
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rax
movq %rax, 0x70c7(%rip)      # 0xd218
movb $0x1, %al
movl %eax, -0x2c(%rbp)
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x7059(%rip)      # 0xd1c4
jmp 0x61df
movq 0x8(%rbx,%r14,8), %rax
movq %rax, 0x70a7(%rip)      # 0xd220
movb $0x1, 0x70b2(%rip)      # 0xd232
jmp 0x61df
movb $0x1, 0x70a7(%rip)      # 0xd230
jmp 0x61df
movb $0x1, 0x70a3(%rip)      # 0xd235
jmp 0x61df
movb $0x1, 0x709d(%rip)      # 0xd238
jmp 0x61df
movb $0x1, 0x708d(%rip)      # 0xd231
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x7014(%rip)      # 0xd1c8
jmp 0x61df
movb $0x1, 0x7076(%rip)      # 0xd233
movq 0x8(%rbx,%r14,8), %rdi
callq 0x3290
movl %eax, 0x6fff(%rip)      # 0xd1cc
movq 0x10(%rbx,%r14,8), %rdi
callq 0x3220
movsd %xmm0, 0x7001(%rip)     # 0xd1e0
incq %r14
cmpq %r14, -0x38(%rbp)
jne 0x5e66
jmp 0x61fc
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x0, 0x6fb5(%rip)      # 0xd1b8
jns 0x6212
cmpb $0x0, 0x7027(%rip)      # 0xd233
je 0x634e
cmpl $0x0, 0x6fa3(%rip)      # 0xd1bc
jns 0x6228
cmpb $0x0, 0x7011(%rip)      # 0xd233
je 0x6355
cmpl $0x0, 0x6f91(%rip)      # 0xd1c0
js 0x6301
testb $0x1, -0x30(%rbp)
je 0x6308
cmpl $0x0, 0x6f7e(%rip)      # 0xd1c4
js 0x630f
testb $0x1, -0x2c(%rbp)
je 0x6316
cmpb $0x1, 0x6fd4(%rip)      # 0xd231
jne 0x626c
cmpl $0x0, 0x6f62(%rip)      # 0xd1c8
js 0x631d
cmpb $0x0, 0x6fbf(%rip)      # 0xd232
je 0x6324
movb 0x6fb4(%rip), %al       # 0xd233
cmpb $0x1, %al
jne 0x6290
cmpl $0x0, 0x6f42(%rip)      # 0xd1cc
js 0x632b
testb %al, %al
je 0x62a6
xorpd %xmm0, %xmm0
ucomisd 0x6f40(%rip), %xmm0     # 0xd1e0
ja 0x6332
movb 0x6f88(%rip), %cl       # 0xd234
cmpb $0x1, %cl
jne 0x62ba
cmpl $0x0, 0x6f18(%rip)      # 0xd1d0
js 0x6339
testb %cl, %cl
je 0x62cc
xorpd %xmm0, %xmm0
ucomisd 0x6f1e(%rip), %xmm0     # 0xd1e8
ja 0x6340
movl %eax, %edx
andb %cl, %dl
cmpb $0x1, %dl
je 0x6347
testb %cl, %cl
je 0x62e2
cmpb $0x1, 0x6f55(%rip)      # 0xd235
je 0x635c
testb %al, %al
je 0x62ef
cmpb $0x1, 0x6f48(%rip)      # 0xd235
je 0x6363
movb $0x1, %al
cmpl $0x0, 0x6f18(%rip)      # 0xd210
je 0x6372
callq 0x3b16
jmp 0x6368
callq 0x3cec
jmp 0x6368
callq 0x3a89
jmp 0x6368
callq 0x3cbd
jmp 0x6368
callq 0x3ab8
jmp 0x6368
callq 0x3c8e
jmp 0x6368
callq 0x3ae7
jmp 0x6368
callq 0x3c5f
jmp 0x6368
callq 0x3c30
jmp 0x6368
callq 0x3c01
jmp 0x6368
callq 0x3bd2
jmp 0x6368
callq 0x3ba3
jmp 0x6368
callq 0x3a2b
jmp 0x6368
callq 0x3a5a
jmp 0x6368
callq 0x3b74
jmp 0x6368
callq 0x3b45
movq (%rbx), %rdi
callq 0x649e
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq