// File: /workspace/github_cpp_makefile_star2_O2/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, 0x74fd(%rip)      # 0xd24b
jne 0x5d6d
movq 0x40(%rbx), %rdi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movsd 0x20(%rbx), %xmm0
movzbl 0x74e2(%rip), %ecx      # 0xd248
callq 0x347c
jmp 0x5d95
cmpb $0x1, 0x74d8(%rip)      # 0xd24c
jne 0x5d9e
movq 0x40(%rbx), %rdi
movl 0x4(%rbx), %ecx
movl 0x8(%rbx), %esi
movl 0x10(%rbx), %edx
movsd 0x28(%rbx), %xmm0
movzbl 0x74b8(%rip), %r8d      # 0xd248
callq 0x3815
cvtsi2sd %eax, %xmm0
jmp 0x5e49
cmpb $0x1, 0x74a9(%rip)      # 0xd24e
jne 0x5dd1
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 0x5e3b
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, 0x7462(%rip)      # 0xd24f
jne 0x5e20
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 0x4241
addq $0x40, %rsp
jmp 0x5e44
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 0x3f30
addq $0x20, %rsp
movsd 0x30(%rbx), %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq