// File: /workspace/github_cpp_makefile_star2_O1/jmmccracken[P]PAI/ccmth.cpp
// Function: CCMcorr_async(CCM_asyncData)
double CCMcorr_async(CCM_asyncData sThreadData){

    double dResult;
    int iResult;

    if( bFindLag ){
        iResult = FindLagTimeStep(sThreadData.dX,sThreadData.iLibraryLength,sThreadData.iMaxAutoCorrToCheck,sThreadData.dCompareTolerance,bVerboseFlag);
        return( (double) iResult );
    }else if( bFindE ){
        iResult = FindEmbeddingDimension(sThreadData.dX,sThreadData.iLibraryLength,sThreadData.iNumberOfTimeStep2Check,sThreadData.dWeightToleranceLevel,sThreadData.iLagTimeStep,bVerboseFlag);
        return( (double) iResult );
    }else if( bPAICalcPart1 ){
        CCMcorr(sThreadData.dCCMcorr,sThreadData.dX,sThreadData.iLibraryLength,sThreadData.dX,sThreadData.iLibraryLength,sThreadData.iEmbeddingDimension,sThreadData.iLagTimeStep,sThreadData.dEstimatedY,sThreadData.iEstimatedYLength,sThreadData.bL2);
	dResult = sThreadData.dCCMcorr;
        return( dResult );
    }else if( bPAICalcPart2 ){
        CCMcorr2(sThreadData.dCCMcorr,sThreadData.dX,sThreadData.iLibraryLength,sThreadData.dX,sThreadData.iLibraryLength,sThreadData.dY,sThreadData.iLibraryLength,sThreadData.iEmbeddingDimension,sThreadData.iLagTimeStep,sThreadData.iYEmbeddingDimension,sThreadData.iYLagTimeStep,sThreadData.dEstimatedY,sThreadData.iEstimatedYLength,sThreadData.bL2);
	dResult = sThreadData.dCCMcorr;
        return( dResult );
    }else{
	CCMcorr(sThreadData.dCCMcorr,sThreadData.dX,sThreadData.iLibraryLength,sThreadData.dY,sThreadData.iLibraryLength,sThreadData.iEmbeddingDimension,sThreadData.iLagTimeStep,sThreadData.dEstimatedY,sThreadData.iEstimatedYLength,sThreadData.bL2);
	dResult = sThreadData.dCCMcorr;
        return( dResult );
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x10(%rbp), %rbx
cmpb $0x1, 0x6e3f(%rip)      # 0xd233
jne 0x6413
movq 0x40(%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movsd 0x20(%rbx), %xmm0
movzbl 0x6e24(%rip), %ecx      # 0xd230
callq 0x3f4c
jmp 0x643b
cmpb $0x1, 0x6e1a(%rip)      # 0xd234
jne 0x6447
movq 0x40(%rbx), %rdi
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %esi
movl 0x10(%rbx), %edx
movsd 0x28(%rbx), %xmm0
movzbl 0x6dfa(%rip), %r8d      # 0xd230
callq 0x3360
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
jmp 0x64f2
cmpb $0x1, 0x6de8(%rip)      # 0xd236
jne 0x647a
leaq 0x30(%rbx), %rdi
movq 0x40(%rbx), %rcx
movl 0x8(%rbx), %edx
movl (%rbx), %r9d
movl 0x4(%rbx), %eax
movl 0x14(%rbx), %r10d
movzbl 0x38(%rbx), %r11d
movq %rcx, %rsi
movl %edx, %r8d
pushq %r11
pushq %r10
pushq 0x50(%rbx)
pushq %rax
jmp 0x64e4
leaq 0x30(%rbx), %rdi
movq 0x40(%rbx), %rsi
movl 0x8(%rbx), %edx
movq 0x48(%rbx), %r9
movl (%rbx), %eax
movl 0x4(%rbx), %r10d
cmpb $0x1, 0x6da1(%rip)      # 0xd237
jne 0x64c9
movl 0x14(%rbx), %r11d
movl 0x18(%rbx), %r14d
movl 0x1c(%rbx), %r15d
movzbl 0x38(%rbx), %r12d
movq %rsi, %rcx
movl %edx, %r8d
pushq %r12
pushq %r11
pushq 0x50(%rbx)
pushq %r15
pushq %r14
pushq %r10
pushq %rax
pushq %rdx
callq 0x495e
addq $0x40, %rsp
jmp 0x64ed
movl 0x14(%rbx), %r11d
movzbl 0x38(%rbx), %r14d
movq %r9, %rcx
movl %edx, %r8d
movl %eax, %r9d
pushq %r14
pushq %r11
pushq 0x50(%rbx)
pushq %r10
callq 0x45ef
addq $0x20, %rsp
movsd 0x30(%rbx), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq