// File: /workspace/github_cpp_makefile_star2_O2/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
movslq %edi, %rax
movq %rax, -0x38(%rbp)
pushq $0x1
popq %r15
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq -0x38(%rbp), %r15
jge 0x5a99
movq (%rbx,%r15,8), %r13
movzbl (%r13), %r12d
leal -0x2d(%r12), %r14d
negl %r14d
movl %r14d, %eax
cmpl $0x2d, %r12d
jne 0x5765
movzbl 0x1(%r13), %eax
subl $0x68, %eax
jne 0x5741
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x5d1f
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x5765
movzbl 0x1(%r13), %eax
subl $0x3f, %eax
jne 0x5763
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x5d1f
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x57a9
movzbl 0x1(%r13), %eax
subl $0x45, %eax
jne 0x5785
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x598d
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x57a9
movzbl 0x1(%r13), %eax
subl $0x74, %eax
jne 0x57a7
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x5963
leaq 0x2eac(%rip), %rdi      # 0x8664
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5978
leaq 0x2e99(%rip), %rdi      # 0x8668
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x59a2
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x581b
movzbl 0x1(%r13), %eax
subl $0x4c, %eax
jne 0x57f7
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x59cd
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x581b
movzbl 0x1(%r13), %eax
subl $0x66, %eax
jne 0x5819
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x59b7
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x585f
movzbl 0x1(%r13), %eax
subl $0x6e, %eax
jne 0x583b
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x5a0d
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x585f
movzbl 0x1(%r13), %eax
subl $0x70, %eax
jne 0x585d
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x59e2
movl %r14d, %eax
cmpb $0x2d, %r12b
jne 0x5881
movzbl 0x1(%r13), %eax
subl $0x6f, %eax
jne 0x587f
movzbl 0x2(%r13), %eax
negl %eax
testl %eax, %eax
je 0x59f7
leaq 0x2ddc(%rip), %rdi      # 0x866c
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5a1f
cmpb $0x2d, %r12b
jne 0x58b9
movzbl 0x1(%r13), %r14d
subl $0x76, %r14d
jne 0x58b6
movzbl 0x2(%r13), %r14d
negl %r14d
testl %r14d, %r14d
je 0x5a34
leaq 0x2da7(%rip), %rdi      # 0x8670
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5a3d
leaq 0x2d95(%rip), %rdi      # 0x8675
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5a46
leaq 0x2d82(%rip), %rdi      # 0x8679
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5a4f
leaq 0x2d6f(%rip), %rdi      # 0x867d
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
je 0x5a68
leaq 0x2d61(%rip), %rdi      # 0x8686
movq %r13, %rsi
callq 0x3280
testl %eax, %eax
jne 0x5a91
movb $0x1, 0x7910(%rip)      # 0xd24c
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x789c(%rip)      # 0xd1e8
movq 0x10(%rbx,%r15,8), %rdi
callq 0x3240
movsd %xmm0, 0x78a2(%rip)     # 0xd200
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x7861(%rip)      # 0xd1d4
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x7864(%rip)      # 0xd1ec
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x7833(%rip)      # 0xd1d0
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x783e(%rip)      # 0xd1f0
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x787d(%rip)      # 0xd240
movb $0x1, %al
movl %eax, -0x30(%rbp)
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x77fb(%rip)      # 0xd1d8
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x7836(%rip)      # 0xd228
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x782d(%rip)      # 0xd230
movb $0x1, %al
movl %eax, -0x2c(%rbp)
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x77bf(%rip)      # 0xd1dc
jmp 0x5a91
movq 0x8(%rbx,%r15,8), %rax
movq %rax, 0x780d(%rip)      # 0xd238
movb $0x1, 0x7818(%rip)      # 0xd24a
jmp 0x5a91
movb $0x1, 0x780d(%rip)      # 0xd248
jmp 0x5a91
movb $0x1, 0x7809(%rip)      # 0xd24d
jmp 0x5a91
movb $0x1, 0x7803(%rip)      # 0xd250
jmp 0x5a91
movb $0x1, 0x77f3(%rip)      # 0xd249
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x777a(%rip)      # 0xd1e0
jmp 0x5a91
movb $0x1, 0x77dc(%rip)      # 0xd24b
movq 0x8(%rbx,%r15,8), %rdi
callq 0x32c0
movl %eax, 0x7765(%rip)      # 0xd1e4
movq 0x10(%rbx,%r15,8), %rdi
callq 0x3240
movsd %xmm0, 0x7767(%rip)     # 0xd1f8
incq %r15
jmp 0x570e
cmpl $0x0, 0x7730(%rip)      # 0xd1d0
jns 0x5aaf
cmpb $0x0, 0x77a2(%rip)      # 0xd24b
je 0x5cc4
cmpl $0x0, 0x771e(%rip)      # 0xd1d4
jns 0x5ac5
cmpb $0x0, 0x778c(%rip)      # 0xd24b
je 0x5cd9
cmpl $0x0, 0x770c(%rip)      # 0xd1d8
js 0x5bc7
testb $0x1, -0x30(%rbp)
je 0x5bdf
cmpl $0x0, 0x76f9(%rip)      # 0xd1dc
js 0x5bf5
testb $0x1, -0x2c(%rbp)
je 0x5c0d
cmpb $0x1, 0x774f(%rip)      # 0xd249
jne 0x5b09
cmpl $0x0, 0x76dd(%rip)      # 0xd1e0
js 0x5c25
cmpb $0x0, 0x773a(%rip)      # 0xd24a
je 0x5c3d
movb 0x772f(%rip), %al       # 0xd24b
cmpb $0x1, %al
jne 0x5b2d
cmpl $0x0, 0x76bd(%rip)      # 0xd1e4
js 0x5c55
testb %al, %al
je 0x5b43
xorpd %xmm0, %xmm0
ucomisd 0x76bb(%rip), %xmm0     # 0xd1f8
ja 0x5c6d
movb 0x7703(%rip), %cl       # 0xd24c
cmpb $0x1, %cl
jne 0x5b5b
cmpl $0x0, 0x7693(%rip)      # 0xd1e8
js 0x5c85
testb %cl, %cl
je 0x5b71
xorpd %xmm0, %xmm0
ucomisd 0x7695(%rip), %xmm0     # 0xd200
ja 0x5c9a
movl %eax, %edx
andb %cl, %dl
cmpb $0x1, %dl
je 0x5caf
testb %cl, %cl
je 0x5b8f
cmpb $0x1, 0x76c4(%rip)      # 0xd24d
je 0x5cee
testb %al, %al
je 0x5ba0
cmpb $0x1, 0x76b3(%rip)      # 0xd24d
je 0x5d03
movb $0x1, %al
cmpl $0x0, 0x767f(%rip)      # 0xd228
je 0x5d29
movq 0x7412(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2dd4(%rip), %rdi      # 0x8994
pushq $0x2a
jmp 0x5d16
movq 0x73fa(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b07(%rip), %rdi      # 0x86df
pushq $0x26
jmp 0x5d16
movq 0x73e2(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b16(%rip), %rdi      # 0x8706
jmp 0x5cd5
movq 0x73cc(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b2c(%rip), %rdi      # 0x8732
pushq $0x3d
jmp 0x5d16
movq 0x73b4(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b52(%rip), %rdi      # 0x8770
pushq $0x2c
jmp 0x5d16
movq 0x739c(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b67(%rip), %rdi      # 0x879d
pushq $0x3b
jmp 0x5d16
movq 0x7384(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2b8b(%rip), %rdi      # 0x87d9
pushq $0x43
jmp 0x5d16
movq 0x736c(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2bb7(%rip), %rdi      # 0x881d
pushq $0x41
jmp 0x5d16
movq 0x7354(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2be1(%rip), %rdi      # 0x885f
pushq $0x3c
jmp 0x5d16
movq 0x733c(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2c06(%rip), %rdi      # 0x889c
pushq $0x35
jmp 0x5d16
movq 0x7327(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2c27(%rip), %rdi      # 0x88d2
pushq $0x28
jmp 0x5d16
movq 0x7312(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2c3b(%rip), %rdi      # 0x88fb
pushq $0x34
jmp 0x5d16
movq 0x72fd(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x29b8(%rip), %rdi      # 0x868d
pushq $0x2b
jmp 0x5d16
movq 0x72e8(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x29cf(%rip), %rdi      # 0x86b9
pushq $0x25
jmp 0x5d16
movq 0x72d3(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2c31(%rip), %rdi      # 0x8930
pushq $0x30
jmp 0x5d16
movq 0x72be(%rip), %rax      # 0xcfc8
movq (%rax), %rcx
leaq 0x2c4d(%rip), %rdi      # 0x8961
pushq $0x32
popq %rsi
pushq $0x1
popq %rdx
callq 0x3360
movq (%rbx), %rdi
callq 0x5e52
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq