// File: /workspace/github_cpp_makefile_star2_O3/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, 0x6e9c(%rip)      # 0xd233
jne 0x63b6
movq 0x40(%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movsd 0x20(%rbx), %xmm0
movzbl 0x6e81(%rip), %ecx      # 0xd230
callq 0x3ebc
jmp 0x63de
cmpb $0x1, 0x6e77(%rip)      # 0xd234
jne 0x63ea
movq 0x40(%rbx), %rdi
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %esi
movl 0x10(%rbx), %edx
movsd 0x28(%rbx), %xmm0
movzbl 0x6e57(%rip), %r8d      # 0xd230
callq 0x3360
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
jmp 0x6495
cmpb $0x1, 0x6e45(%rip)      # 0xd236
jne 0x641d
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 0x6487
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, 0x6dfe(%rip)      # 0xd237
jne 0x646c
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 0x4931
addq $0x40, %rsp
jmp 0x6490
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 0x4569
addq $0x20, %rsp
movsd 0x30(%rbx), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq