// File: /workspace/github_cpp_makefile_star2_O2/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 $0x118, %rsp            # imm = 0x118
movl %ecx, %ebx
movq %rdx, 0x28(%rsp)
movq %rsi, %r15
movq %rdi, 0x48(%rsp)
leaq 0x70(%rsp), %r14
movq %r14, %rdi
movl %ecx, %esi
callq 0xaa69
leaq 0x14a0e(%rip), %rsi     # 0x1d856
leaq 0xc0(%rsp), %rdi
movq %r14, %rdx
callq 0xaa45
leaq 0x1497f(%rip), %rdx     # 0x1d7de
leaq 0xf8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x545f
leaq 0xf8(%rsp), %rdi
callq 0x547e
leaq 0xf8(%rsp), %rdi
callq 0x3100
leaq 0xc0(%rsp), %rdi
callq 0x3100
leaq 0x70(%rsp), %rdi
callq 0x3100
leaq 0x200(%r15), %rdi
movslq %ebx, %rbx
movq %rbx, %rsi
callq 0x564e
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
leaq 0x210(%r15), %rdi
movq %rbx, %rsi
callq 0x564e
movsd (%rax), %xmm1
movq (%r15), %rax
leaq 0x70(%rsp), %rdi
pushq $0x2
popq %rdx
movq %r15, %rsi
movsd (%rsp), %xmm0
callq *0x20(%rax)
leaq 0x1e0(%r15), %rdi
movq %rbx, 0x10(%rsp)
movq %rbx, %rsi
callq 0x564e
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
leaq 0x1f0(%r15), %rdi
movq 0x10(%rsp), %rsi
callq 0x564e
movsd (%rax), %xmm1
movq (%r15), %rax
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rdx
movq %r15, %rsi
movsd (%rsp), %xmm0
callq *0x20(%rax)
movl 0x1c(%r15), %eax
movslq 0x130(%r15), %rcx
decl %eax
cltd
movq %rcx, 0x20(%rsp)
idivl %ecx
incl %eax
leaq 0x1c(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0xaade
leaq 0x1c0(%r15), %rax
movq %rax, 0x40(%rsp)
movq %r15, 0x50(%rsp)
leaq 0x1d0(%r15), %rax
movq %rax, 0x58(%rsp)
xorl %ebx, %ebx
leaq 0xc0(%rsp), %r13
leaq 0xb0(%rsp), %r14
leaq 0xa0(%rsp), %r12
leaq 0x90(%rsp), %r15
xorl %ebp, %ebp
movslq 0x1c(%rsp), %rax
cmpq %rax, %rbp
jge 0x905c
movq %r13, %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
callq 0xb9f6
movq %r14, %rdi
movq %r13, %rsi
callq 0x1af42
movq 0x58(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x564e
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %r12, %rdi
leaq 0x60(%rsp), %rsi
callq 0x1b0e6
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
callq 0x1b0e6
movq 0x50(%rsp), %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
movq %r12, %rdx
movq %r15, %rcx
callq 0x9f64
movsd %xmm0, (%rsp)
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x564e
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x90(%rsp), %rdi
callq 0x32c0
movq 0xa0(%rsp), %rdi
callq 0x32c0
movq 0xb0(%rsp), %rdi
callq 0x32c0
incq %rbp
addq 0x20(%rsp), %rbx
jmp 0x8f9a
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0xab3e
movl 0xc(%rsp), %ebx
movq 0x40(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5618
imull 0x20(%rsp), %ebx
incl %ebx
movl %ebx, (%rax)
movslq 0xc(%rsp), %rdx
leaq 0xc0(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xb9f6
movq 0x48(%rsp), %rbx
leaq 0xc0(%rsp), %rsi
movq %rbx, %rdi
callq 0x1af42
movq 0x30(%rsp), %rdi
callq 0x32c0
movq 0x60(%rsp), %rdi
callq 0x32c0
movq 0x70(%rsp), %rdi
callq 0x32c0
movq %rbx, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x916d
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x3100
jmp 0x9103
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x3100
jmp 0x9115
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x3100
jmp 0x9181
jmp 0x9160
jmp 0x9160
movq %rax, %rbx
jmp 0x9177
movq %rax, %rbx
jmp 0x9144
movq %rax, %rbx
jmp 0x9151
movq %rax, %rbx
movq 0x90(%rsp), %rdi
callq 0x32c0
movq 0xa0(%rsp), %rdi
callq 0x32c0
movq 0xb0(%rsp), %rdi
callq 0x32c0
jmp 0x9163
movq %rax, %rbx
movq 0x30(%rsp), %rdi
callq 0x32c0
movq 0x60(%rsp), %rdi
callq 0x32c0
movq 0x70(%rsp), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3430
nop