// File: /workspace/github_cpp_makefile_star2_O3/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, 0x78(%rsp)
movq %rdi, 0x8(%rsp)
movl %edx, %r15d
negl %r15d
cmovsl %edx, %r15d
movl $0x1, %ebx
cmpl $0xa, %r15d
jb 0xd6ef
movl $0x4, %ebx
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r15d, %ecx
cmpl $0x63, %ecx
jbe 0xd6e8
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0xd6ed
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0xd6ef
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %ebx
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0xd6b7
addl $-0x3, %ebx
jmp 0xd6ef
addl $-0x2, %ebx
jmp 0xd6ef
decl %ebx
movl %ebp, %r14d
shrl $0x1f, %r14d
leal (%rbx,%r14), %esi
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x32f0
addq (%r12), %r14
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0xf9e9
leaq 0x101b8(%rip), %rcx     # 0x1d8e5
movl $0x18, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32b0
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd766
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0xd76f
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1009c(%rip), %rsi     # 0x1d82e
callq 0x34a0
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xd7c7
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0xd7d0
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x80(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x60be
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0xd811
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xd828
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32a0
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xd83f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32a0
testl %ebp, %ebp
movq 0x8(%rsp), %rbx
js 0xdaf3
movslq %ebp, %r14
cmpq %r14, 0x1e8(%rbx)
jle 0xdaf3
cmpq %r14, 0x1f8(%rbx)
jle 0xdaf3
movq (%rbx), %rax
movq 0x1e0(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
movq 0x1f0(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm1
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq *0x20(%rax)
cmpq %r14, 0x208(%rbx)
jle 0xdaf3
cmpq %r14, 0x218(%rbx)
jle 0xdaf3
movq (%rbx), %rax
movq 0x200(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm0
movq 0x210(%rbx), %rcx
movsd (%rcx,%r14,8), %xmm1
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movl $0x2, %edx
callq *0x20(%rax)
movsd 0xd8(%rbx), %xmm1
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movsd 0x120(%rbx), %xmm2
movsd %xmm2, 0x70(%rsp)
divsd %xmm2, %xmm0
addsd 0xfae1(%rip), %xmm0     # 0x1d3f0
cvttsd2si %xmm0, %r12d
testl %r12d, %r12d
js 0xdb12
xorpd 0xfb2b(%rip), %xmm1     # 0x1d450
movapd %xmm1, 0xa0(%rsp)
je 0xda97
movq %r14, 0x20(%rsp)
movl %r12d, %ebp
leaq (,%rbp,8), %rdi
callq 0x3360
movq %rax, %r15
cmpl $0x1, %r12d
je 0xd95e
movl %r15d, %eax
andl $0xf, %eax
jne 0xdb31
testq %r15, %r15
je 0xdb50
movl %r12d, 0x1c(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
movsd %xmm0, 0x68(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xd8(%rsp), %r12
leaq 0xc8(%rsp), %r13
leaq 0xb8(%rsp), %r14
leaq 0x48(%rsp), %rbx
movq %r12, %rdi
movq 0x78(%rsp), %rsi
callq 0xfc92
movq %r13, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1b5d6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b5d6
movsd 0x10(%rsp), %xmm0
mulsd 0x70(%rsp), %xmm0
addsd 0xa0(%rsp), %xmm0
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0xdc46
cvttsd2si 0x10(%rsp), %rax
cmpq %rbp, %rax
jae 0xdaf3
movsd %xmm0, (%r15,%rax,8)
movq 0xb8(%rsp), %rdi
callq 0x3310
movq 0xc8(%rsp), %rdi
callq 0x3310
movq 0xd8(%rsp), %rdi
callq 0x3310
movsd 0x10(%rsp), %xmm1
addsd 0xf9b7(%rip), %xmm1     # 0x1d3f0
movsd 0x68(%rsp), %xmm0
movsd %xmm1, 0x10(%rsp)
ucomisd %xmm1, %xmm0
ja 0xd9a1
xorpd %xmm0, %xmm0
cmpl $0x1, 0x1c(%rsp)
je 0xda8b
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 0xda66
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0x8(%rsp), %rbx
movq 0x20(%rsp), %r14
jmp 0xda9e
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
cmpq %r14, 0x1d8(%rbx)
jle 0xdaf3
movq 0x1d0(%rbx), %rax
mulsd 0x120(%rbx), %xmm0
addsd 0xa0(%rsp), %xmm0
movsd %xmm0, (%rax,%r14,8)
movq %r15, %rdi
callq 0x3310
movq 0x48(%rsp), %rdi
callq 0x3310
movq 0x28(%rsp), %rdi
callq 0x3310
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf7bc(%rip), %rdi      # 0x1d2b6
leaq 0xef3b(%rip), %rsi      # 0x1ca3c
leaq 0xf84c(%rip), %rcx      # 0x1d354
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0x109b6(%rip), %rdi     # 0x1e4cf
leaq 0xed21(%rip), %rsi      # 0x1c841
leaq 0x10a32(%rip), %rcx     # 0x1e559
movl $0x138, %edx            # imm = 0x138
callq 0x31b0
leaq 0xedc3(%rip), %rdi      # 0x1c8fb
leaq 0xee76(%rip), %rsi      # 0x1c9b5
leaq 0xee8e(%rip), %rcx      # 0x1c9d4
movl $0xa1, %edx
callq 0x31b0
movl $0x8, %edi
callq 0x3130
movq 0x2145f(%rip), %rcx     # 0x2efc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x21461(%rip), %rsi     # 0x2efd0
movq 0x21432(%rip), %rdx     # 0x2efa8
movq %rax, %rdi
callq 0x3430
movq %rax, %rbx
jmp 0xdc29
movq %rax, %rbx
jmp 0xdc33
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0xdbb3
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xdbb3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0xdbcf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xdbcf
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0xdc3d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x32a0
jmp 0xdc3d
movq %rax, %rbx
jmp 0xdc21
movq %rax, %rbx
jmp 0xdc14
movq %rax, %rbx
jmp 0xdc07
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
callq 0x3310
movq 0xc8(%rsp), %rdi
callq 0x3310
movq 0xd8(%rsp), %rdi
callq 0x3310
movq %r15, %rdi
callq 0x3310
movq 0x48(%rsp), %rdi
callq 0x3310
movq 0x28(%rsp), %rdi
callq 0x3310
movq %rbx, %rdi
callq 0x3450
nop