// File: /workspace/github_cpp_makefile_star2_O1/Pyboon[P]sage/isi_sage.cpp
// Function: IsiSage::UpdateTau(Eigen::Matrix<std::complex<double>, -1, -1, 0, -1, -1>, int)
RowVectorXcd IsiSage::UpdateTau(complex_mat data, const int iL){
    Util::log("updating Tau of the " + to_string(iL) + "th path");
    MatrixX2cd C2 = getAntennaResponse(result.theta_rx(iL), result.phi_rx(iL), 2);
    MatrixX2cd C1 = getAntennaResponse(result.theta_tx(iL), result.phi_tx(iL), 1);
    int min_tau = 1;
    int max_tau = config.sample_codes;
    int step = config.delay_step;
    int tau_size = (max_tau-min_tau)/step + 1;
    VectorXd tau_data(tau_size);
    for(int i_tau = 0; i_tau < tau_size; ++i_tau){
        tau_data(i_tau) = ObjectiveFunction(data.row(i_tau*step), result.doppler(iL), C1, C2, iL);
    }
    int max_index = 0;
    tau_data.maxCoeff(&max_index);
    result.tau(iL) = min_tau + max_index*step;
    return data.row(max_index);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdx, 0x60(%rsp)
movq %rsi, %r15
movq %rdi, 0x88(%rsp)
movl %ecx, %ebx
negl %ebx
cmovsl %ecx, %ebx
movl $0x1, %r12d
cmpl $0xa, %ebx
jb 0xbf5c
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %esi
cmpl $0x63, %esi
jbe 0xbf53
cmpl $0x3e7, %esi            # imm = 0x3E7
jbe 0xbf59
cmpl $0x2710, %esi           # imm = 0x2710
jb 0xbf5c
movl %esi, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %esi          # imm = 0x1869F
movl %edx, %esi
ja 0xbf20
addl $-0x3, %r12d
jmp 0xbf5c
addl $-0x2, %r12d
jmp 0xbf5c
decl %r12d
movl %ecx, 0x20(%rsp)
movl %ecx, %r13d
shrl $0x1f, %r13d
leal (%r12,%r13), %esi
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
movl $0x2d, %edx
callq 0x3300
addq (%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0xf91b
leaq 0x11878(%rip), %rcx     # 0x1d816
movl $0x14, %r8d
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xbfd8
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xbfe2
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq %r15, 0x10(%rsp)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x11794(%rip), %rsi     # 0x1d79e
callq 0x34b0
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc03f
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0xc048
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0xc8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x60e8
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0xc089
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
movq 0x10(%rsp), %rbx
je 0xc0a5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xc0c1
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
movl 0x20(%rsp), %eax
testl %eax, %eax
js 0xc413
movslq %eax, %r12
cmpq %r12, 0x208(%rbx)
jle 0xc413
cmpq %r12, 0x218(%rbx)
jle 0xc413
movq (%rbx), %rax
movq 0x200(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm0
movq 0x210(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm1
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq *0x20(%rax)
cmpq %r12, 0x1e8(%rbx)
jle 0xc413
cmpq %r12, 0x1f8(%rbx)
jle 0xc413
movq (%rbx), %rax
movq 0x1e0(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm0
movq 0x1f0(%rbx), %rcx
movsd (%rcx,%r12,8), %xmm1
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *0x20(%rax)
movl 0x1c(%rbx), %eax
movslq 0x130(%rbx), %rcx
decl %eax
cltd
movq %rcx, 0x18(%rsp)
idivl %ecx
cmpl $-0x2, %eax
jle 0xc470
movl %eax, %ebx
movl %eax, %r13d
incl %r13d
jne 0xc193
movq $0x0, 0x8(%rsp)
jmp 0xc1bd
leaq (,%r13,8), %rdi
callq 0x3370
testl %ebx, %ebx
je 0xc1af
movl %eax, %ecx
andl $0xf, %ecx
jne 0xc4a6
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xc4c5
testl %ebx, %ebx
js 0xc308
movq 0x18(%rsp), %rax
shlq $0x4, %rax
movq %rax, 0x90(%rsp)
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %ebx, %ebx
movq 0x60(%rsp), %rsi
movq (%rsi), %rax
movq 0x10(%rsi), %rcx
leaq (%rax,%rbp), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, 0x38(%rsp)
testq %rax, %rax
sete %al
testq %rcx, %rcx
setns %cl
orb %al, %cl
je 0xc432
movq %rsi, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x1, 0x58(%rsp)
testq %r15, %r15
js 0xc451
cmpq %r15, 0x8(%rsi)
jle 0xc451
leaq 0xa8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bbc2
movq 0x10(%rsp), %rax
cmpq %r12, 0x1d8(%rax)
jle 0xc413
movq 0x1d0(%rax), %rax
movsd (%rax,%r12,8), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1bd16
leaq 0xe8(%rsp), %r14
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x1bd16
movq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movsd 0x20(%rsp), %xmm0
leaq 0x98(%rsp), %rdx
movq %r14, %rcx
callq 0xdc1a
movq 0x8(%rsp), %rax
movsd %xmm0, (%rax,%rbx,8)
movq 0xe8(%rsp), %rdi
callq 0x3320
movq 0x98(%rsp), %rdi
callq 0x3320
movq 0xa8(%rsp), %rdi
callq 0x3320
incq %rbx
addq 0x18(%rsp), %r15
addq 0x90(%rsp), %rbp
cmpq %rbx, %r13
jne 0xc1dd
xorl %eax, %eax
cmpl $0x2, %r13d
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %r15
jb 0xc344
movsd (%r15), %xmm0
movl $0x1, %ecx
xorl %eax, %eax
movsd (%r15,%rcx,8), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %rcx, %rax
maxsd %xmm0, %xmm1
incq %rcx
movapd %xmm1, %xmm0
cmpq %rcx, %r13
jne 0xc326
cmpq %r12, 0x1c8(%rdx)
jle 0xc48f
movq 0x1c0(%rdx), %rcx
movq 0x18(%rsp), %rdx
imull %eax, %edx
incl %edx
movl %edx, (%rcx,%r12,4)
cltq
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x60(%rsp), %rdi
movq (%rdi), %rdx
movq 0x10(%rdi), %rsi
addq %rdx, %rcx
movq %rcx, 0x28(%rsp)
movq %rsi, 0x38(%rsp)
testq %rdx, %rdx
sete %cl
testq %rsi, %rsi
setns %dl
orb %cl, %dl
je 0xc432
movq %rdi, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x1, 0x58(%rsp)
testl %eax, %eax
js 0xc451
cmpq %rax, 0x8(%rdi)
jle 0xc451
leaq 0x28(%rsp), %rsi
movq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0x1bbc2
movq %r15, %rdi
callq 0x3320
movq 0xb8(%rsp), %rdi
callq 0x3320
movq 0x68(%rsp), %rdi
callq 0x3320
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10e7c(%rip), %rdi     # 0x1d296
leaq 0x105fb(%rip), %rsi     # 0x1ca1c
leaq 0x10f0c(%rip), %rcx     # 0x1d334
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0x11c49(%rip), %rdi     # 0x1e082
leaq 0x11cec(%rip), %rsi     # 0x1e12c
leaq 0x11d00(%rip), %rcx     # 0x1e147
movl $0xaf, %edx
callq 0x31b0
leaq 0x11aa9(%rip), %rdi     # 0x1df01
leaq 0x11b49(%rip), %rsi     # 0x1dfa8
leaq 0x11b5b(%rip), %rcx     # 0x1dfc1
movl $0x7a, %edx
callq 0x31b0
leaq 0x11fc8(%rip), %rdi     # 0x1e43f
leaq 0x103a3(%rip), %rsi     # 0x1c821
leaq 0x12044(%rip), %rcx     # 0x1e4c9
movl $0x138, %edx            # imm = 0x138
callq 0x31b0
leaq 0x10e00(%rip), %rdi     # 0x1d296
leaq 0x1057f(%rip), %rsi     # 0x1ca1c
leaq 0x10e0f(%rip), %rcx     # 0x1d2b3
jmp 0xc428
leaq 0x1042e(%rip), %rdi     # 0x1c8db
leaq 0x104e1(%rip), %rsi     # 0x1c995
leaq 0x104f9(%rip), %rcx     # 0x1c9b4
movl $0xa1, %edx
callq 0x31b0
movl $0x8, %edi
callq 0x3130
movq 0x22aea(%rip), %rcx     # 0x2efc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x22aec(%rip), %rsi     # 0x2efd0
movq 0x22abd(%rip), %rdx     # 0x2efa8
movq %rax, %rdi
callq 0x3440
movq %rax, %rbx
jmp 0xc5a7
jmp 0xc564
movq %rax, %rbx
jmp 0xc5b4
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0xc52a
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xc52a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xc546
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xc546
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xc5be
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xc5be
movq %rax, %rbx
jmp 0xc59d
movq %rax, %rbx
jmp 0xc590
movq %rax, %rbx
jmp 0xc583
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
callq 0x3320
movq 0x98(%rsp), %rdi
callq 0x3320
movq 0xa8(%rsp), %rdi
callq 0x3320
movq 0x8(%rsp), %rdi
callq 0x3320
movq 0xb8(%rsp), %rdi
callq 0x3320
movq 0x68(%rsp), %rdi
callq 0x3320
movq %rbx, %rdi
callq 0x3460