// File: 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
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdx, -0x1a8(%rbp)
movq %rdi, -0x1a0(%rbp)
movq %rdi, %rax
movq %rax, -0x198(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x190(%rbp)
movl -0x1c(%rbp), %esi
leaq -0x80(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x1fef0
movq -0x188(%rbp), %rdx
leaq 0x52b58(%rip), %rsi     # 0x6fc56
leaq -0x60(%rbp), %rdi
callq 0x1fea0
jmp 0x1d109
leaq 0x52ace(%rip), %rdx     # 0x6fbde
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x13b30
jmp 0x1d11f
leaq -0x40(%rbp), %rdi
callq 0x13b80
jmp 0x1d12a
leaq -0x40(%rbp), %rdi
callq 0x9470
leaq -0x60(%rbp), %rdi
callq 0x9470
leaq -0x80(%rbp), %rdi
callq 0x9470
movq -0x190(%rbp), %rdi
addq $0x200, %rdi            # imm = 0x200
movslq -0x1c(%rbp), %rsi
callq 0x14140
movq -0x190(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x1b8(%rbp)
addq $0x210, %rdi            # imm = 0x210
movslq -0x1c(%rbp), %rsi
callq 0x14140
movsd -0x1b8(%rbp), %xmm0
movq -0x190(%rbp), %rsi
movsd (%rax), %xmm1
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq -0xa0(%rbp), %rdi
movl $0x2, %edx
callq *%rax
movq -0x190(%rbp), %rdi
addq $0x1e0, %rdi            # imm = 0x1E0
movslq -0x1c(%rbp), %rsi
callq 0x14140
movq %rax, -0x1b0(%rbp)
jmp 0x1d1c7
movq -0x190(%rbp), %rdi
movq -0x1b0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1c8(%rbp)
addq $0x1f0, %rdi            # imm = 0x1F0
movslq -0x1c(%rbp), %rsi
callq 0x14140
movq %rax, -0x1c0(%rbp)
jmp 0x1d1fa
movsd -0x1c8(%rbp), %xmm0
movq -0x190(%rbp), %rsi
movq -0x1c0(%rbp), %rax
movsd (%rax), %xmm1
movq (%rsi), %rax
movq 0x20(%rax), %rax
leaq -0xb0(%rbp), %rdi
movl $0x1, %edx
callq *%rax
jmp 0x1d22b
movq -0x190(%rbp), %rax
movl $0x1, -0xb4(%rbp)
movl 0x1c(%rax), %ecx
movl %ecx, -0xb8(%rbp)
movl 0x130(%rax), %eax
movl %eax, -0xbc(%rbp)
movl -0xb8(%rbp), %eax
movl -0xb4(%rbp), %ecx
subl %ecx, %eax
movl -0xbc(%rbp), %ecx
cltd
idivl %ecx
incl %eax
movl %eax, -0xc0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x20110
jmp 0x1d285
movl $0x0, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jge 0x1d4da
movq -0x1a8(%rbp), %rsi
movl -0xd4(%rbp), %eax
movl -0xbc(%rbp), %ecx
imull %ecx, %eax
movslq %eax, %rdx
leaq -0x120(%rbp), %rdi
callq 0x20060
jmp 0x1d2c8
leaq -0xe8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x21a50
jmp 0x1d2dd
movq -0x190(%rbp), %rdi
addq $0x1d0, %rdi            # imm = 0x1D0
movslq -0x1c(%rbp), %rsi
callq 0x14140
movq %rax, -0x1d0(%rbp)
jmp 0x1d2fd
movq -0x1d0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x21a90
jmp 0x1d325
leaq -0x140(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x21a90
jmp 0x1d33a
movsd -0x1d8(%rbp), %xmm0
movq -0x190(%rbp), %rdi
movl -0x1c(%rbp), %r8d
leaq -0xe8(%rbp), %rsi
leaq -0x130(%rbp), %rdx
leaq -0x140(%rbp), %rcx
callq 0x1ead0
movsd %xmm0, -0x1e0(%rbp)
jmp 0x1d371
movslq -0xd4(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x14140
movq %rax, -0x1e8(%rbp)
jmp 0x1d38d
movq -0x1e8(%rbp), %rax
movsd -0x1e0(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x140(%rbp), %rdi
callq 0x13f10
leaq -0x130(%rbp), %rdi
callq 0x13f10
leaq -0xe8(%rbp), %rdi
callq 0x20040
movl -0xd4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd4(%rbp)
jmp 0x1d28f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d424
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d41b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x9470
leaq -0x60(%rbp), %rdi
callq 0x9470
leaq -0x80(%rbp), %rdi
callq 0x9470
jmp 0x1d5ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d5c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d5b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d5aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d4c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x1d4bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x13f10
leaq -0x130(%rbp), %rdi
callq 0x13f10
leaq -0xe8(%rbp), %rdi
callq 0x20040
jmp 0x1d5aa
movl $0x0, -0x144(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0x144(%rbp), %rsi
callq 0x20260
jmp 0x1d4f9
movq -0x190(%rbp), %rdi
movl -0xb4(%rbp), %eax
movl -0x144(%rbp), %ecx
movl -0xbc(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x1f4(%rbp)
addq $0x1c0, %rdi            # imm = 0x1C0
movslq -0x1c(%rbp), %rsi
callq 0x14090
movq %rax, -0x1f0(%rbp)
jmp 0x1d536
movq -0x1a8(%rbp), %rsi
movq -0x1f0(%rbp), %rax
movl -0x1f4(%rbp), %ecx
movl %ecx, (%rax)
movslq -0x144(%rbp), %rdx
leaq -0x180(%rbp), %rdi
callq 0x20060
jmp 0x1d561
movq -0x1a0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x21a50
jmp 0x1d576
leaq -0xd0(%rbp), %rdi
callq 0xfde0
leaq -0xb0(%rbp), %rdi
callq 0x13f10
leaq -0xa0(%rbp), %rdi
callq 0x13f10
movq -0x198(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
leaq -0xd0(%rbp), %rdi
callq 0xfde0
leaq -0xb0(%rbp), %rdi
callq 0x13f10
leaq -0xa0(%rbp), %rdi
callq 0x13f10
movq -0x88(%rbp), %rdi
callq 0x9dc0
nopw (%rax,%rax)