// File: /workspace/github_cpp_makefile_star2_O1/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, 0x90(%rsp)
movq %rdi, 0x18(%rsp)
movl %edx, %r15d
negl %r15d
cmovsl %edx, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0xd6c0
movl $0x4, %ebx
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0xd6b9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xd6be
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xd6c0
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %ebx
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xd688
addl $-0x3, %ebx
jmp 0xd6c0
addl $-0x2, %ebx
jmp 0xd6c0
decl %ebx
movl %ebp, %r14d
shrl $0x1f, %r14d
leal (%rbx,%r14), %esi
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x3300
addq (%r12), %r14
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xf91b
leaq 0x10157(%rip), %rcx     # 0x1d855
movl $0x18, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32c0
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd737
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0xd740
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1003b(%rip), %rsi     # 0x1d79e
callq 0x34b0
leaq 0xa8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd798
movq %rdx, 0x98(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa8(%rsp)
jmp 0xd7a1
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x98(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x60e8
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0xd7e2
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
movq 0x18(%rsp), %rbx
je 0xd7fe
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xd815
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32b0
testl %ebp, %ebp
js 0xdaf5
movslq %ebp, %r14
cmpq %r14, 0x1e8(%rbx)
jle 0xdaf5
cmpq %r14, 0x1f8(%rbx)
jle 0xdaf5
movq (%rbx), %rax
movq 0x1e0(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
movq 0x1f0(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm1
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *0x20(%rax)
cmpq %r14, 0x208(%rbx)
jle 0xdaf5
cmpq %r14, 0x218(%rbx)
jle 0xdaf5
movq (%rbx), %rax
movq 0x200(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
movq 0x210(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm1
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq *0x20(%rax)
movq %r14, 0x78(%rsp)
movsd 0xd8(%rbx), %xmm0
movapd %xmm0, 0x40(%rsp)
addsd %xmm0, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x120(%rbx), %xmm1
movsd %xmm1, 0x88(%rsp)
divsd %xmm1, %xmm0
addsd 0xfae6(%rip), %xmm0     # 0x1d3d0
cvttsd2si %xmm0, %ebx
testl %ebx, %ebx
js 0xdb14
movl %ebx, %ebp
je 0xd94e
leaq (,%rbp,8), %rdi
callq 0x3370
movq %rax, %r15
cmpl $0x1, %ebx
je 0xd91b
movl %r15d, %eax
andl $0xf, %eax
jne 0xdb33
testq %r15, %r15
jne 0xd951
movl $0x8, %edi
callq 0x3130
movq 0x2168f(%rip), %rcx     # 0x2efc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x21691(%rip), %rsi     # 0x2efd0
movq 0x21662(%rip), %rdx     # 0x2efa8
movq %rax, %rdi
callq 0x3440
xorl %r15d, %r15d
movapd 0x40(%rsp), %xmm0
xorpd 0xfab1(%rip), %xmm0     # 0x1d410
movapd %xmm0, 0x40(%rsp)
movl %ebx, 0xc(%rsp)
testl %ebx, %ebx
je 0xda5e
xorps %xmm0, %xmm0
cvtsi2sdl 0xc(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xd8(%rsp), %r12
leaq 0xc8(%rsp), %r13
leaq 0xb8(%rsp), %r14
leaq 0x58(%rsp), %rbx
movq %r12, %rdi
movq 0x90(%rsp), %rsi
callq 0xfbc4
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0x1bd16
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1bd16
movsd 0x10(%rsp), %xmm0
mulsd 0x88(%rsp), %xmm0
addsd 0x40(%rsp), %xmm0
movq 0x18(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0xdc1a
cvttsd2si 0x10(%rsp), %rax
cmpq %rbp, %rax
jae 0xdaf5
movsd %xmm0, (%r15,%rax,8)
movq 0xb8(%rsp), %rdi
callq 0x3320
movq 0xc8(%rsp), %rdi
callq 0x3320
movq 0xd8(%rsp), %rdi
callq 0x3320
movsd 0x10(%rsp), %xmm1
addsd 0xf98b(%rip), %xmm1     # 0x1d3d0
movsd 0x80(%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
ucomisd %xmm1, %xmm0
ja 0xd9aa
xorpd %xmm0, %xmm0
cmpl $0x2, 0xc(%rsp)
jb 0xda9a
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, %rbp
jne 0xda75
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x18(%rsp), %rcx
movq 0x78(%rsp), %rdx
cmpq %rdx, 0x1d8(%rcx)
jle 0xdaf5
movq 0x1d0(%rcx), %rax
mulsd 0x120(%rcx), %xmm0
addsd 0x40(%rsp), %xmm0
movsd %xmm0, (%rax,%rdx,8)
movq %r15, %rdi
callq 0x3320
movq 0x58(%rsp), %rdi
callq 0x3320
movq 0x20(%rsp), %rdi
callq 0x3320
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf79a(%rip), %rdi      # 0x1d296
leaq 0xef19(%rip), %rsi      # 0x1ca1c
leaq 0xf82a(%rip), %rcx      # 0x1d334
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0x10924(%rip), %rdi     # 0x1e43f
leaq 0xecff(%rip), %rsi      # 0x1c821
leaq 0x109a0(%rip), %rcx     # 0x1e4c9
movl $0x138, %edx            # imm = 0x138
callq 0x31b0
leaq 0xeda1(%rip), %rdi      # 0x1c8db
leaq 0xee54(%rip), %rsi      # 0x1c995
leaq 0xee6c(%rip), %rcx      # 0x1c9b4
movl $0xa1, %edx
callq 0x31b0
movq %rax, %rbx
jmp 0xdbfd
movq %rax, %rbx
jmp 0xdc07
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0xdb87
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xdb87
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xdba3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xdba3
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0xdc11
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0xdc11
movq %rax, %rbx
jmp 0xdbf5
movq %rax, %rbx
jmp 0xdbe8
movq %rax, %rbx
jmp 0xdbdb
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
callq 0x3320
movq 0xc8(%rsp), %rdi
callq 0x3320
movq 0xd8(%rsp), %rdi
callq 0x3320
movq %r15, %rdi
callq 0x3320
movq 0x58(%rsp), %rdi
callq 0x3320
movq 0x20(%rsp), %rdi
callq 0x3320
movq %rbx, %rdi
callq 0x3460
nop