// File: /workspace/github_cpp_makefile_star2_O1/Pyboon[P]sage/isi_sage.cpp
// Function: IsiSage::ObjectiveFunction(Eigen::Matrix<std::complex<double>, 1, -1, 1, 1, -1>, double, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2>, Eigen::Matrix<std::complex<double>, -1, 2, 0, -1, 2>, int)
double IsiSage::ObjectiveFunction(RowVectorXcd tau_data, double doppler, MatrixX2cd C1, MatrixX2cd C2, const int iL){
    // X 
    MatrixXcd X(config.Rx, config.Tx);
    complex<double> cycle_data = 0;
    complex<double> temp = 0;
    for(int i_tx = 0; i_tx < config.Tx; ++i_tx){
        for(int i_rx = 0; i_rx < config.Rx; ++i_rx){
            cycle_data = 0;
            temp = 0;
            for(int i_cyc = 0; i_cyc < config.cycle_num; ++i_cyc){
                double t = (i_cyc * config.Tcy + i_tx * config.Tt + i_rx * config.Tr) * config.T; 
                temp.real(cos(2*PI* doppler *t));
                temp.imag(-sin(2*PI* doppler *t));
                cycle_data += temp * tau_data(i_cyc * config.subchannel_num + i_tx * config.Rx + i_rx);
            }
            X(i_rx, i_tx) = cycle_data;
        }
    }
    // f 
    RowVectorXcd c_2_1_H = C2.col(0).adjoint();
    RowVectorXcd c_2_2_H = C2.col(1).adjoint();
    VectorXcd c_1_1_conj = C1.col(0).conjugate();
    VectorXcd c_1_2_conj = C1.col(1).conjugate();
    Vector4cd f;
    f(0) = c_2_1_H * X * c_1_1_conj;
    f(1) = c_2_1_H * X * c_1_2_conj;
    f(2) = c_2_2_H * X * c_1_1_conj;
    f(3) = c_2_2_H * X * c_1_2_conj;
    // D
    Matrix2cd part1 = C2.adjoint() * C2;
    Matrix2cd part2 = C1.adjoint() * C1;
    MatrixXcd D = kroneckerProduct(part1, part2);
    complex<double> z = f.adjoint() * D.inverse() * f;
    return sqrt(norm(z));

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rcx, %r10
movsd %xmm0, 0x50(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movslq 0x8(%rdi), %r8
movslq 0xc(%rdi), %rcx
movq %rcx, %rax
orq %r8, %rax
js 0xe5ec
movq %rdx, %r9
movq %rsi, %r15
movq %rdi, %r12
testl %r8d, %r8d
sete %al
testl %ecx, %ecx
sete %dl
orb %al, %dl
jne 0xdc8b
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
xorl %edx, %edx
idivq %rcx
cmpq %r8, %rax
jl 0xe65b
movq %r10, 0x78(%rsp)
movq %r9, 0x148(%rsp)
movq %rcx, %rsi
imulq %r8, %rsi
leaq 0x30(%rsp), %rdi
movq %r8, %rdx
callq 0x630a
cmpl $0x0, 0xc(%r12)
jle 0xde52
movsd 0x50(%rsp), %xmm0
mulsd 0xf71a(%rip), %xmm0     # 0x1d3e0
movsd %xmm0, 0x50(%rsp)
xorl %ebp, %ebp
leaq 0x80(%rsp), %r13
cmpl $0x0, 0x8(%r12)
jle 0xde41
xorl %ebx, %ebx
cmpl $0x0, 0x10(%r12)
jle 0xddf0
xorpd %xmm0, %xmm0
xorl %r14d, %r14d
xorps %xmm1, %xmm1
movsd %xmm1, 0x158(%rsp)
movsd %xmm0, 0x8(%rsp)
movl 0xbc(%r12), %eax
imull %r14d, %eax
movl 0xb4(%r12), %ecx
imull %ebp, %ecx
addl %eax, %ecx
movl 0xb8(%r12), %eax
imull %ebx, %eax
addl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0xa8(%r12), %xmm0
mulsd 0x50(%rsp), %xmm0
movsd %xmm0, (%rsp)
callq 0x34a0
movsd %xmm0, 0x150(%rsp)
movsd (%rsp), %xmm0
callq 0x3090
movl 0xa0(%r12), %eax
imull %r14d, %eax
movl 0x8(%r12), %ecx
imull %ebp, %ecx
addl %ebx, %eax
addl %ecx, %eax
js 0xe53a
movslq %eax, %rsi
cmpq %rsi, 0x8(%r15)
jle 0xe53a
xorps 0xf67b(%rip), %xmm0     # 0x1d410
shlq $0x4, %rsi
addq (%r15), %rsi
movsd 0x150(%rsp), %xmm1
movsd %xmm1, 0x80(%rsp)
movsd %xmm0, 0x88(%rsp)
movq %r13, %rdi
callq 0xfe6c
movsd 0x158(%rsp), %xmm1
addsd 0x80(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
incl %r14d
cmpl 0x10(%r12), %r14d
jl 0xdcfa
jmp 0xddf8
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
movq 0x38(%rsp), %rax
cmpq %rbx, %rax
jle 0xe559
cmpq %rbp, 0x40(%rsp)
jle 0xe559
imulq %rbp, %rax
shlq $0x4, %rax
addq 0x30(%rsp), %rax
movq %rbx, %rcx
shlq $0x4, %rcx
movsd %xmm1, (%rcx,%rax)
movsd %xmm0, 0x8(%rcx,%rax)
incq %rbx
movslq 0x8(%r12), %rax
cmpq %rax, %rbx
jl 0xdce4
incq %rbp
movslq 0xc(%r12), %rax
cmpq %rax, %rbp
jl 0xdcd6
movq 0x78(%rsp), %r14
movq (%r14), %rcx
movq 0x8(%r14), %rax
testq %rcx, %rcx
sete %dl
testq %rax, %rax
setns %sil
orb %dl, %sil
je 0xe578
leaq 0x80(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %r14, 0x18(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rsi)
movq %rax, 0x30(%rsi)
leaq 0x120(%rsp), %r13
movq %r13, %rdi
callq 0x1a9ea
movq 0x148(%rsp), %rbx
movq (%r14), %rcx
movq 0x8(%r14), %rax
testq %rcx, %rcx
sete %dl
testq %rax, %rax
setns %sil
orb %dl, %sil
je 0xe578
movq %rax, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
leaq 0x80(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %r14, 0x18(%rsi)
movq $0x0, 0x20(%rsi)
movq $0x1, 0x28(%rsi)
movq %rax, 0x30(%rsi)
leaq 0x68(%rsp), %rdi
callq 0x1a9ea
leaq 0x30(%rsp), %rbp
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
testq %rcx, %rcx
sete %dl
testq %rax, %rax
setns %sil
orb %dl, %sil
je 0xe578
leaq 0x80(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, 0x18(%rsi)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%rsi)
movq %rax, 0x30(%rsi)
leaq 0x110(%rsp), %r15
movq %r15, %rdi
callq 0x118ea
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
testq %rcx, %rcx
sete %dl
testq %rax, %rax
setns %sil
orb %dl, %sil
je 0xe578
movq %rax, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
leaq 0x80(%rsp), %rsi
movq %rcx, (%rsi)
movq %rax, 0x8(%rsi)
movq %rbx, 0x18(%rsi)
movq $0x0, 0x20(%rsi)
movq $0x1, 0x28(%rsi)
movq %rax, 0x30(%rsi)
leaq 0x58(%rsp), %rdi
callq 0x118ea
xorpd %xmm0, %xmm0
movapd %xmm0, 0x1b0(%rsp)
movapd %xmm0, 0x1a0(%rsp)
movapd %xmm0, 0x190(%rsp)
movapd %xmm0, 0x180(%rsp)
movq 0x128(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0xe597
movq 0x118(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0xe5ae
leaq 0x20(%rsp), %r12
movapd %xmm0, (%r12)
movq %r12, -0x10(%r12)
movq %r13, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
movq %r15, 0xe0(%rsp)
testq %rax, %rax
je 0xe09e
jle 0xe5cd
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rbp
movq %rbp, %rsi
callq 0x1acd8
movq 0xe0(%rsp), %rax
movq (%rax), %rax
leaq 0x80(%rsp), %rdi
movq %rax, 0x30(%rdi)
movq %rbp, 0x40(%rdi)
leaq 0x160(%rsp), %rsi
callq 0x1ab3e
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3320
movq 0x78(%rsp), %r14
leaq 0x30(%rsp), %rbp
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
jmp 0xe0a6
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x180(%rsp)
movq 0x128(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0xe597
movq 0x60(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0xe5ae
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %r12, 0x10(%rsp)
movq %r13, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
leaq 0x58(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
testq %rax, %rax
je 0xe188
jle 0xe5cd
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %r13
movq %r13, %rsi
callq 0x1acd8
movq 0xe0(%rsp), %rax
movq (%rax), %rax
leaq 0x80(%rsp), %rdi
movq %rax, 0x30(%rdi)
movq %r13, 0x40(%rdi)
leaq 0x160(%rsp), %rsi
callq 0x1ab3e
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3320
leaq 0x68(%rsp), %r13
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
jmp 0xe195
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
leaq 0x68(%rsp), %r13
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x190(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0xe597
movq 0x118(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0xe5ae
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %r12, 0x10(%rsp)
movq %r13, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
movq %r15, 0xe0(%rsp)
testq %rax, %rax
je 0xe26d
jle 0xe5cd
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %r15
movq %r15, %rsi
callq 0x1acd8
movq 0xe0(%rsp), %rax
movq (%rax), %rax
leaq 0x80(%rsp), %rdi
movq %rax, 0x30(%rdi)
movq %r15, 0x40(%rdi)
leaq 0x160(%rsp), %rsi
callq 0x1ab3e
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3320
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
jmp 0xe275
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x1a0(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x38(%rsp), %rax
jne 0xe597
movq 0x60(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0xe5ae
xorpd %xmm1, %xmm1
movapd %xmm1, 0x20(%rsp)
movq %r12, 0x10(%rsp)
movq %r13, 0xd0(%rsp)
movq %rbp, 0xd8(%rsp)
leaq 0x58(%rsp), %rcx
movq %rcx, 0xe0(%rsp)
testq %rax, %rax
je 0xe353
jle 0xe5cd
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %r15
movq %r15, %rsi
callq 0x1acd8
movq 0xe0(%rsp), %rax
movq (%rax), %rax
leaq 0x80(%rsp), %rdi
movq %rax, 0x30(%rdi)
movq %r15, 0x40(%rdi)
leaq 0x160(%rsp), %rsi
callq 0x1ab3e
movsd %xmm0, 0x8(%rsp)
movsd %xmm1, (%rsp)
movq 0xa0(%rsp), %rdi
callq 0x3320
xorpd %xmm1, %xmm1
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm2
jmp 0xe35a
xorpd %xmm0, %xmm0
xorps %xmm2, %xmm2
movsd %xmm2, 0x20(%rsp)
movsd %xmm0, 0x28(%rsp)
movq 0x10(%rsp), %rax
movupd (%rax), %xmm0
movapd %xmm0, 0x1b0(%rsp)
leaq 0xd0(%rsp), %rsi
movq %r14, (%rsi)
movq %r14, 0x10(%rsi)
leaq 0x80(%rsp), %r15
movapd %xmm1, (%r15)
movapd %xmm1, 0x10(%r15)
movapd %xmm1, 0x20(%r15)
movapd %xmm1, 0x30(%r15)
movq %r15, %rdi
movq %r14, %rdx
callq 0x11b00
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
movq %rbx, 0x10(%rsi)
xorpd %xmm0, %xmm0
leaq 0xd0(%rsp), %r14
movapd %xmm0, (%r14)
movapd %xmm0, 0x10(%r14)
movapd %xmm0, 0x20(%r14)
movapd %xmm0, 0x30(%r14)
movq %r14, %rdi
movq %rbx, %rdx
callq 0x11b00
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
leaq 0x130(%rsp), %rdi
xorpd %xmm0, %xmm0
movapd %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x10, %esi
movl $0x4, %edx
movl $0x4, %ecx
callq 0x630a
leaq 0x10(%rsp), %rdi
leaq 0x130(%rsp), %rbx
movq %rbx, %rsi
callq 0x13caa
movq 0x138(%rsp), %rcx
movq 0x140(%rsp), %rax
cmpq %rax, %rcx
jne 0xe60b
cmpq $0x4, %rcx
jne 0xe62a
leaq 0x180(%rsp), %rcx
movq %rcx, 0x160(%rsp)
movq %rbx, 0x170(%rsp)
movq %rcx, 0x178(%rsp)
cmpq $0x4, %rax
jne 0xe641
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %r12, 0x10(%rsp)
leaq 0x160(%rsp), %rsi
leaq 0x180(%rsp), %rdx
movq %r12, %rdi
callq 0x13dd6
movq 0x10(%rsp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xe4d4
sqrtsd %xmm0, %xmm0
jmp 0xe4d9
callq 0x3210
movsd %xmm0, (%rsp)
movq 0x130(%rsp), %rdi
callq 0x3320
movq 0x58(%rsp), %rdi
callq 0x3320
movq 0x110(%rsp), %rdi
callq 0x3320
movq 0x68(%rsp), %rdi
callq 0x3320
movq 0x120(%rsp), %rdi
callq 0x3320
movq 0x30(%rsp), %rdi
callq 0x3320
movsd (%rsp), %xmm0
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed55(%rip), %rdi      # 0x1d296
leaq 0xe4d4(%rip), %rsi      # 0x1ca1c
leaq 0x1b31a(%rip), %rcx     # 0x29869
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x31b0
leaq 0xe487(%rip), %rdi      # 0x1c9e7
leaq 0xe4b5(%rip), %rsi      # 0x1ca1c
leaq 0xe4d1(%rip), %rcx      # 0x1ca3f
movl $0x16d, %edx            # imm = 0x16D
callq 0x31b0
leaq 0xfb03(%rip), %rdi      # 0x1e082
leaq 0xfba6(%rip), %rsi      # 0x1e12c
leaq 0x1087a(%rip), %rcx     # 0x1ee07
movl $0xaf, %edx
callq 0x31b0
leaq 0x11663(%rip), %rdi     # 0x1fc01
leaq 0x116e8(%rip), %rsi     # 0x1fc8d
leaq 0x1b882(%rip), %rcx     # 0x29e2e
jmp 0xe5c3
leaq 0x1164c(%rip), %rdi     # 0x1fc01
leaq 0x116d1(%rip), %rsi     # 0x1fc8d
leaq 0x1b968(%rip), %rcx     # 0x29f2b
movl $0x61, %edx
callq 0x31b0
leaq 0x10105(%rip), %rdi     # 0x1e6d9
leaq 0x10142(%rip), %rsi     # 0x1e71d
leaq 0x1babe(%rip), %rcx     # 0x2a0a0
movl $0x19d, %edx            # imm = 0x19D
callq 0x31b0
leaq 0xe09f(%rip), %rdi      # 0x1c692
leaq 0xe227(%rip), %rsi      # 0x1c821
leaq 0xe243(%rip), %rcx      # 0x1c844
movl $0x11d, %edx            # imm = 0x11D
callq 0x31b0
leaq 0x14a82(%rip), %rdi     # 0x23094
leaq 0x14a8c(%rip), %rsi     # 0x230a5
leaq 0x14aa2(%rip), %rcx     # 0x230c2
movl $0x152, %edx            # imm = 0x152
callq 0x31b0
leaq 0x115d0(%rip), %rdi     # 0x1fc01
leaq 0x11655(%rip), %rsi     # 0x1fc8d
leaq 0x14b22(%rip), %rcx     # 0x23161
jmp 0xe5c3
leaq 0x115b9(%rip), %rdi     # 0x1fc01
leaq 0x1163e(%rip), %rsi     # 0x1fc8d
leaq 0x14d04(%rip), %rcx     # 0x2335a
jmp 0xe5c3
movl $0x8, %edi
callq 0x3130
movq 0x20954(%rip), %rcx     # 0x2efc0
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x20956(%rip), %rsi     # 0x2efd0
movq 0x20927(%rip), %rdx     # 0x2efa8
movq %rax, %rdi
callq 0x3440
jmp 0xe695
jmp 0xe6a8
jmp 0xe695
jmp 0xe6a8
jmp 0xe695
jmp 0xe6a8
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
jmp 0xe6ce
jmp 0xe6a8
jmp 0xe6c3
jmp 0xe6a8
movq %rax, %rbx
jmp 0xe6d3
movq %rax, %rbx
jmp 0xe6dd
movq %rax, %rbx
jmp 0xe6ea
movq %rax, %rbx
jmp 0xe6f4
jmp 0xe6be
movq %rax, %rbx
jmp 0xe701
movq %rax, %rbx
movq 0x130(%rsp), %rdi
callq 0x3320
movq 0x58(%rsp), %rdi
callq 0x3320
movq 0x110(%rsp), %rdi
callq 0x3320
movq 0x68(%rsp), %rdi
callq 0x3320
movq 0x120(%rsp), %rdi
callq 0x3320
movq 0x30(%rsp), %rdi
callq 0x3320
movq %rbx, %rdi
callq 0x3460
nop