// File: /workspace/github_cpp_makefile_star2_O2/Pyboon[P]sage/isi_sage.cpp
// Function: IsiSage::UpdateDoppler(Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1>, int)
void IsiSage::UpdateDoppler(RowVectorXcd tau_data, const int iL){
    Util::log("updating Doppler of the " + to_string(iL) + "th path");
    MatrixX2cd C1 = getAntennaResponse(result.theta_tx(iL), result.phi_tx(iL), 1);
    MatrixX2cd C2 = getAntennaResponse(result.theta_rx(iL), result.phi_rx(iL), 2);
    // go through doppler frequecy bound to find index with max value
    double min_doppler = -config.max_doppler;
    double max_doppler = config.max_doppler;
    double step = config.doppler_step; // step of doppler is 0.1 hz
    int doppler_size = (int)(max_doppler-min_doppler)/step+1;
    VectorXd doppler_data(doppler_size);
    for(double i_step = 0; i_step < doppler_size; ++i_step){
        doppler_data(i_step) = ObjectiveFunction(tau_data, min_doppler+i_step * step, C1, C2, iL);
    }
    int max_index = 0;
    doppler_data.maxCoeff(&max_index);
    result.doppler(iL) = min_doppler+max_index * config.doppler_step;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edx, %ebp
movq %rsi, 0x48(%rsp)
movq %rdi, %rbx
leaq 0x78(%rsp), %r14
movq %r14, %rdi
movl %edx, %esi
callq 0xaa69
leaq 0x13c5a(%rip), %rsi     # 0x1d895
leaq 0x58(%rsp), %rdi
movq %r14, %rdx
callq 0xaa45
leaq 0x13b8f(%rip), %rdx     # 0x1d7de
leaq 0xc8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x545f
leaq 0xc8(%rsp), %rdi
callq 0x547e
leaq 0xc8(%rsp), %rdi
callq 0x3100
leaq 0x58(%rsp), %rdi
callq 0x3100
leaq 0x78(%rsp), %rdi
callq 0x3100
leaq 0x1e0(%rbx), %rdi
movslq %ebp, %r14
movq %r14, %rsi
callq 0x564e
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
leaq 0x1f0(%rbx), %rdi
movq %r14, %rsi
callq 0x564e
movsd (%rax), %xmm1
movq (%rbx), %rax
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
movsd (%rsp), %xmm0
callq *0x20(%rax)
leaq 0x200(%rbx), %rdi
movq %r14, %rsi
callq 0x564e
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
leaq 0x210(%rbx), %rdi
movq %r14, %rsi
callq 0x564e
movsd (%rax), %xmm1
movq (%rbx), %rax
leaq 0x78(%rsp), %rdi
pushq $0x2
popq %rdx
movq %rbx, %rsi
movsd (%rsp), %xmm0
callq *0x20(%rax)
movq %r14, 0x38(%rsp)
movsd 0xd8(%rbx), %xmm0
movapd %xmm0, 0x10(%rsp)
addsd %xmm0, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x120(%rbx), %xmm1
movsd %xmm1, 0x40(%rsp)
divsd %xmm1, %xmm0
addsd 0x1368b(%rip), %xmm0    # 0x1d3d8
cvttsd2si %xmm0, %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xaade
movapd 0x10(%rsp), %xmm0
xorpd 0x136c0(%rip), %xmm0    # 0x1d430
movapd %xmm0, 0x10(%rsp)
xorpd %xmm1, %xmm1
leaq 0xb8(%rsp), %r12
leaq 0xa8(%rsp), %r13
leaq 0x98(%rsp), %r15
leaq 0x78(%rsp), %r14
leaq 0x28(%rsp), %rbp
cvtsi2sdl 0xc(%rsp), %xmm0
movsd %xmm1, (%rsp)
ucomisd %xmm1, %xmm0
jbe 0x9e4f
movq %r12, %rdi
movq 0x48(%rsp), %rsi
callq 0xb9b4
movq %r13, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b0e6
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b0e6
movsd (%rsp), %xmm0
mulsd 0x40(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x9f64
movsd %xmm0, 0x50(%rsp)
cvttsd2si (%rsp), %rsi
movq %rbp, %rdi
callq 0x564e
movsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x98(%rsp), %rdi
callq 0x32c0
movq 0xa8(%rsp), %rdi
callq 0x32c0
movq 0xb8(%rsp), %rdi
callq 0x32c0
movsd (%rsp), %xmm1
addsd 0x1358e(%rip), %xmm1    # 0x1d3d8
jmp 0x9d9c
leaq 0x8(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x28(%rsp), %rdi
callq 0xab3e
movl 0x8(%rsp), %ebp
movsd 0x120(%rbx), %xmm0
movsd %xmm0, (%rsp)
addq $0x1d0, %rbx            # imm = 0x1D0
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
callq 0x564e
cvtsi2sd %ebp, %xmm0
mulsd (%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x28(%rsp), %rdi
callq 0x32c0
movq 0x78(%rsp), %rdi
callq 0x32c0
movq 0x58(%rsp), %rdi
callq 0x32c0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x9f48
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x3100
jmp 0x9ee3
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
jmp 0x9ef2
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3100
jmp 0x9f5c
jmp 0x9f0f
movq %rax, %rbx
jmp 0x9f52
movq %rax, %rbx
jmp 0x9f31
movq %rax, %rbx
jmp 0x9f24
movq %rax, %rbx
jmp 0x9f3e
movq %rax, %rbx
movq 0x98(%rsp), %rdi
callq 0x32c0
movq 0xa8(%rsp), %rdi
callq 0x32c0
movq 0xb8(%rsp), %rdi
callq 0x32c0
movq 0x28(%rsp), %rdi
callq 0x32c0
movq 0x78(%rsp), %rdi
callq 0x32c0
movq 0x58(%rsp), %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x3430