// File: godofecht[P]Slow-Feature-Analysis/./sfa.h
// Function: SFA::GetCorrelationTrace(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, int)
double GetCorrelationTrace(vector<double> va, vector<double> vb,int t)
    {
        int time_step = t;
        int lambda_correlation = fmin(11*ro,time_step);
        vector<double> vector_y1;
        vector<double> vector_y2;
        vector_y1.clear();
        vector_y2.clear();


     //       cout<<va.size()<<endl;
     //       cout<<lambda_correlation<<endl;

        for(int i=vb.size()-lambda_correlation;i<vb.size();i++)
        {
            if(i>-1)
            {
             //   cout<<va[i]<<endl;
                vector_y1.push_back(va[i]);
                vector_y2.push_back(vb[i]);
            }
        }
        double val =  pearsoncoeff(va,vb);

  //      cout<<val<<endl;

        if(isnan(val))
            return 0;
        else
            return val;        
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rsi, -0xc8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movsd 0x61a6(%rip), %xmm0     # 0xe070
mulsd 0x1d0(%rax), %xmm0
movl -0x28(%rbp), %edi
callq 0x9170
cvttsd2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x4340
leaq -0x60(%rbp), %rdi
callq 0x4340
leaq -0x48(%rbp), %rdi
callq 0x42f0
leaq -0x60(%rbp), %rdi
callq 0x42f0
movq -0xc0(%rbp), %rdi
callq 0x42b0
movslq -0x2c(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x64(%rbp)
movq -0xc0(%rbp), %rdi
movslq -0x64(%rbp), %rax
movq %rax, -0xd0(%rbp)
callq 0x42b0
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jae 0x7fa6
cmpl $-0x1, -0x64(%rbp)
jle 0x7f96
movq -0xc8(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x42d0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x43a0
jmp 0x7f65
movq -0xc0(%rbp), %rdi
movslq -0x64(%rbp), %rsi
callq 0x42d0
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x43a0
jmp 0x7f83
jmp 0x7f96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x80ac
jmp 0x7f98
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x7f1b
movq -0xc8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x4490
jmp 0x7fbb
movq -0xc0(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x4490
jmp 0x7fd0
leaq -0x98(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3880
movsd %xmm0, -0xd8(%rbp)
jmp 0x7fed
leaq -0xb0(%rbp), %rdi
callq 0x4430
leaq -0x98(%rbp), %rdi
callq 0x4430
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0x91b0
movb %al, -0xd9(%rbp)
jmp 0x8024
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x8030
jmp 0x8078
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xb4(%rbp)
jmp 0x808c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x806a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x4430
leaq -0x98(%rbp), %rdi
callq 0x4430
jmp 0x80ac
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movl $0x1, -0xb4(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x4430
leaq -0x48(%rbp), %rdi
callq 0x4430
movsd -0x8(%rbp), %xmm0
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x4430
leaq -0x48(%rbp), %rdi
callq 0x4430
movq -0x70(%rbp), %rdi
callq 0x22f0
nopw (%rax,%rax)