// File: /workspace/github_cpp_makefile_star2_O3/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
movl %ecx, %r14d
movq %rdx, 0x58(%rsp)
movq %rdi, 0x80(%rsp)
movl %ecx, %ebx
negl %ebx
cmovsl %ecx, %ebx
movl $0x1, %r12d
cmpl $0xa, %ebx
jb 0xbfd8
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebx, %ecx
cmpl $0x63, %ecx
jbe 0xbfcf
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xbfd5
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xbfd8
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xbf9c
addl $-0x3, %r12d
jmp 0xbfd8
addl $-0x2, %r12d
jmp 0xbfd8
decl %r12d
movq %rsi, (%rsp)
movl %r14d, %r13d
shrl $0x1f, %r13d
leal (%r12,%r13), %esi
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x60(%rsp), %rbp
movq %rbp, %rdi
movl $0x2d, %edx
callq 0x32f0
addq (%rbp), %r13
movq %r13, %rdi
movl %r12d, %esi
movl %ebx, %edx
callq 0xf9e9
leaq 0x1188c(%rip), %rcx     # 0x1d8a6
movl $0x14, %r8d
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32b0
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc054
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0xc05e
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
movq (%rsp), %r15
movl %r14d, %ebx
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x117a6(%rip), %rsi     # 0x1d82e
callq 0x34a0
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xc0bd
movq %rdx, 0xc8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd8(%rsp)
jmp 0xc0c6
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0xc8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x60be
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0xc107
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xc11e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc13a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32a0
testl %ebx, %ebx
js 0xc490
movslq %ebx, %r12
cmpq %r12, 0x208(%r15)
jle 0xc490
cmpq %r12, 0x218(%r15)
jle 0xc490
movq (%r15), %rax
movq 0x200(%r15), %rcx
movsd (%rcx,%r12,8), %xmm0
movq 0x210(%r15), %rcx
movsd (%rcx,%r12,8), %xmm1
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
movl $0x2, %edx
callq *0x20(%rax)
cmpq %r12, 0x1e8(%r15)
jle 0xc490
cmpq %r12, 0x1f8(%r15)
jle 0xc490
movq (%r15), %rax
movq 0x1e0(%r15), %rcx
movsd (%rcx,%r12,8), %xmm0
movq 0x1f0(%r15), %rcx
movsd (%rcx,%r12,8), %xmm1
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %edx
callq *0x20(%rax)
movl 0x1c(%r15), %eax
movslq 0x130(%r15), %rcx
decl %eax
cltd
movq %rcx, 0x10(%rsp)
idivl %ecx
cmpl $-0x2, %eax
jle 0xc4ed
movl %eax, %ebx
movl %eax, %r13d
incl %r13d
jne 0xc208
xorl %r14d, %r14d
xorl %eax, %eax
jmp 0xc3c5
leaq (,%r13,8), %rdi
callq 0x3360
testl %ebx, %ebx
je 0xc224
movl %eax, %ecx
andl $0xf, %ecx
jne 0xc523
movl %ebx, 0x1c(%rsp)
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xc542
movq 0x10(%rsp), %rax
shlq $0x4, %rax
movq %rax, 0x88(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x58(%rsp), %rsi
movq (%rsi), %rax
movq 0x10(%rsi), %rcx
leaq (%rax,%rbx), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, 0x30(%rsp)
testq %rax, %rax
sete %al
testq %rcx, %rcx
setns %cl
orb %al, %cl
je 0xc4af
movq %rsi, 0x38(%rsp)
movq %rbp, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
testq %rbp, %rbp
js 0xc4ce
cmpq %rbp, 0x8(%rsi)
jle 0xc4ce
leaq 0xa8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1b4b4
movq (%rsp), %rax
cmpq %r12, 0x1d8(%rax)
jle 0xc490
movq 0x1d0(%rax), %rax
movsd (%rax,%r12,8), %xmm0
movsd %xmm0, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x1b5d6
leaq 0xe8(%rsp), %r15
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
callq 0x1b5d6
movq (%rsp), %rdi
leaq 0xa8(%rsp), %rsi
movsd 0x90(%rsp), %xmm0
leaq 0x98(%rsp), %rdx
movq %r15, %rcx
callq 0xdc46
movq 0x8(%rsp), %rax
movsd %xmm0, (%rax,%r14,8)
movq 0xe8(%rsp), %rdi
callq 0x3310
movq 0x98(%rsp), %rdi
callq 0x3310
movq 0xa8(%rsp), %rdi
callq 0x3310
incq %r14
addq 0x10(%rsp), %rbp
addq 0x88(%rsp), %rbx
cmpq %r14, %r13
jne 0xc24e
cmpl $0x0, 0x1c(%rsp)
je 0xc3ba
movq 0x8(%rsp), %r14
movsd (%r14), %xmm0
movl $0x1, %ecx
xorl %eax, %eax
movq (%rsp), %r15
movsd (%r14,%rcx,8), %xmm1
ucomisd %xmm0, %xmm1
cmovaq %rcx, %rax
maxsd %xmm0, %xmm1
incq %rcx
movapd %xmm1, %xmm0
cmpq %rcx, %r13
jne 0xc39a
jmp 0xc3c5
xorl %eax, %eax
movq 0x8(%rsp), %r14
movq (%rsp), %r15
cmpq %r12, 0x1c8(%r15)
jle 0xc50c
movq 0x1c0(%r15), %rcx
movq 0x10(%rsp), %rdx
imull %eax, %edx
incl %edx
movl %edx, (%rcx,%r12,4)
cltq
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x58(%rsp), %rdi
movq (%rdi), %rdx
movq 0x10(%rdi), %rsi
addq %rdx, %rcx
movq %rcx, 0x20(%rsp)
movq %rsi, 0x30(%rsp)
testq %rdx, %rdx
sete %cl
testq %rsi, %rsi
setns %dl
orb %cl, %dl
je 0xc4af
movq %rdi, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
testl %eax, %eax
movq 0x80(%rsp), %rbx
js 0xc4ce
cmpq %rax, 0x8(%rdi)
jle 0xc4ce
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b4b4
movq %r14, %rdi
callq 0x3310
movq 0xb8(%rsp), %rdi
callq 0x3310
movq 0x60(%rsp), %rdi
callq 0x3310
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10e1f(%rip), %rdi     # 0x1d2b6
leaq 0x1059e(%rip), %rsi     # 0x1ca3c
leaq 0x10eaf(%rip), %rcx     # 0x1d354
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0x11c5c(%rip), %rdi     # 0x1e112
leaq 0x11cff(%rip), %rsi     # 0x1e1bc
leaq 0x11d13(%rip), %rcx     # 0x1e1d7
movl $0xaf, %edx
callq 0x31b0
leaq 0x11abc(%rip), %rdi     # 0x1df91
leaq 0x11b5c(%rip), %rsi     # 0x1e038
leaq 0x11b6e(%rip), %rcx     # 0x1e051
movl $0x7a, %edx
callq 0x31b0
leaq 0x11fdb(%rip), %rdi     # 0x1e4cf
leaq 0x10346(%rip), %rsi     # 0x1c841
leaq 0x12057(%rip), %rcx     # 0x1e559
movl $0x138, %edx            # imm = 0x138
callq 0x31b0
leaq 0x10da3(%rip), %rdi     # 0x1d2b6
leaq 0x10522(%rip), %rsi     # 0x1ca3c
leaq 0x10db2(%rip), %rcx     # 0x1d2d3
jmp 0xc4a5
leaq 0x103d1(%rip), %rdi     # 0x1c8fb
leaq 0x10484(%rip), %rsi     # 0x1c9b5
leaq 0x1049c(%rip), %rcx     # 0x1c9d4
movl $0xa1, %edx
callq 0x31b0
movl $0x8, %edi
callq 0x3130
movq 0x22a6d(%rip), %rcx     # 0x2efc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x22a6f(%rip), %rsi     # 0x2efd0
movq 0x22a40(%rip), %rdx     # 0x2efa8
movq %rax, %rdi
callq 0x3430
movq %rax, %rbx
jmp 0xc629
movq %r14, 0x8(%rsp)
jmp 0xc5e6
movq %rax, %rbx
jmp 0xc636
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0xc5ac
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xc5ac
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xc5c8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xc5c8
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xc640
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xc640
movq %rax, %rbx
jmp 0xc61f
movq %rax, %rbx
jmp 0xc612
movq %rax, %rbx
jmp 0xc605
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
callq 0x3310
movq 0x98(%rsp), %rdi
callq 0x3310
movq 0xa8(%rsp), %rdi
callq 0x3310
movq 0x8(%rsp), %rdi
callq 0x3310
movq 0xb8(%rsp), %rdi
callq 0x3310
movq 0x60(%rsp), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3450