// File: /workspace/github_cpp_makefile_star2_O1/Pyboon[P]sage/sage.cpp
// Function: Sage::ReadAntennaResponse()
void Sage::ReadAntennaResponse(){
    // init Antenna array 
    string path = config.path_antenna;    
    for(int i = 0; i < config.Tx; ++i){
        TxArrayEphi.emplace_back(MatrixXcd::Zero(181,91));
        TxArrayEtheta.emplace_back(MatrixXcd::Zero(181,91));
    }
    for(int i = 0; i < config.Rx; ++i){
        RxArrayEphi.emplace_back(MatrixXcd::Zero(181,91));
        RxArrayEtheta.emplace_back(MatrixXcd::Zero(181,91));
    }
    // read antenna response
    double temp_response = 0.0;
    ifstream fTxReEphi(path+"/TxReEphi", ios::binary);
    ifstream fTxImEphi(path+"/TxImEphi", ios::binary);
    ifstream fTxReEtheta(path+"/TxReEtheta", ios::binary);
    ifstream fTxImEtheta(path+"/TxImEtheta", ios::binary);
    if(!fTxReEphi|| !fTxImEphi || !fTxReEtheta || !fTxImEtheta){
        cerr<<"TxEphi or TxEtheta is not exist!"<<endl;
        abort();
    }
    for(int k = 0; k< config.Tx; ++k){
        for(int j = 0; j< 91; ++j){
            for(int i = 0; i< 181; ++i){
                fTxReEphi.read((char*)&temp_response, sizeof(double));
                TxArrayEphi[k](i,j).real(temp_response);
                fTxImEphi.read((char*)&temp_response, sizeof(double));
                TxArrayEphi[k](i,j).imag(temp_response);
                fTxReEtheta.read((char*)&temp_response, sizeof(double));
                TxArrayEtheta[k](i,j).real(temp_response);
                fTxImEtheta.read((char*)&temp_response, sizeof(double));
                TxArrayEtheta[k](i,j).imag(temp_response);
            }
        }
    }

    ifstream fRxReEphi(path+"/RxReEphi", ios::binary);
    ifstream fRxImEphi(path+"/RxImEphi", ios::binary);
    ifstream fRxReEtheta(path+"/RxReEtheta", ios::binary);
    ifstream fRxImEtheta(path+"/RxImEtheta", ios::binary);
    if(!fRxReEphi|| !fRxImEphi || !fRxReEtheta || !fRxImEtheta){
        cerr<<"RxEphi or RxEtheta is not exist!"<<endl;
        abort();
    }
    for(int k = 0; k< config.Rx; ++k){
        for(int j = 0; j< 91; ++j){
            for(int i = 0; i< 181; ++i){
                fRxReEphi.read((char*)&temp_response, sizeof(double));
                RxArrayEphi[k](i,j).real(temp_response);
                fRxImEphi.read((char*)&temp_response, sizeof(double));
                RxArrayEphi[k](i,j).imag(temp_response);
                fRxReEtheta.read((char*)&temp_response, sizeof(double));
                RxArrayEtheta[k](i,j).real(temp_response);
                fRxImEtheta.read((char*)&temp_response, sizeof(double));
                RxArrayEtheta[k](i,j).imag(temp_response);
            }
        }
    }
    // for(int i = 0;i<181; ++i){
    //     cout<<RxArrayEphi[1](i,0)<<endl;
    // }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x20(%rdi), %rsi
movq 0x28(%rdi), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x434a
movq %rbx, (%rsp)
cmpl $0x0, 0xc(%rbx)
leaq 0x68(%rsp), %rbx
jle 0x4edc
movq (%rsp), %rax
leaq 0x160(%rax), %r14
leaq 0x178(%rax), %r15
xorl %ebp, %ebp
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %r12
movups %xmm0, (%rbx)
movq $0xb5, 0x58(%rsp)
movq $0x5b, 0x60(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x6152
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0xb5, 0x58(%rsp)
movq $0x5b, 0x60(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6152
incl %ebp
movq (%rsp), %rax
cmpl 0xc(%rax), %ebp
xorps %xmm0, %xmm0
jl 0x4e8b
movq (%rsp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x4f53
movq (%rsp), %rax
leaq 0x190(%rax), %r14
leaq 0x1a8(%rax), %r15
xorl %ebp, %ebp
xorps %xmm0, %xmm0
leaq 0x58(%rsp), %r12
movups %xmm0, (%rbx)
movq $0xb5, 0x58(%rsp)
movq $0x5b, 0x60(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x6152
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0xb5, 0x58(%rsp)
movq $0x5b, 0x60(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x6152
incl %ebp
movq (%rsp), %rax
cmpl 0x8(%rax), %ebp
xorps %xmm0, %xmm0
jl 0x4f02
movq $0x0, 0x8(%rsp)
leaq 0xea0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe90(%rsp), %rdi
callq 0x434a
leaq 0x17294(%rip), %rsi     # 0x1c21d
leaq 0xe90(%rsp), %rdi
callq 0x34b0
leaq 0x58(%rsp), %rdi
leaq 0xe90(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0xe90(%rsp), %rdi
cmpq %r14, %rdi
je 0x4fca
movq 0xea0(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0xc98(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc88(%rsp), %rdi
callq 0x434a
leaq 0x17230(%rip), %rsi     # 0x1c227
leaq 0xc88(%rsp), %rdi
callq 0x34b0
leaq 0xe90(%rsp), %rdi
leaq 0xc88(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0xc88(%rsp), %rdi
cmpq %r14, %rdi
je 0x503b
movq 0xc98(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0xa90(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa80(%rsp), %rdi
callq 0x434a
leaq 0x171c9(%rip), %rsi     # 0x1c231
leaq 0xa80(%rsp), %rdi
callq 0x34b0
leaq 0xc88(%rsp), %rdi
leaq 0xa80(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0xa80(%rsp), %rdi
cmpq %r14, %rdi
je 0x50ac
movq 0xa90(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x888(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x878(%rsp), %rdi
callq 0x434a
leaq 0x17164(%rip), %rsi     # 0x1c23d
leaq 0x878(%rsp), %rdi
callq 0x34b0
leaq 0xa80(%rsp), %rdi
leaq 0x878(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0x878(%rsp), %rdi
cmpq %r14, %rdi
je 0x511d
movq 0x888(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x58(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x78(%rsp,%rax)
jne 0x5792
movq 0xe90(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xeb0(%rsp,%rax)
jne 0x5792
movq 0xc88(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xca8(%rsp,%rax)
jne 0x5792
movq 0xa80(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xaa0(%rsp,%rax)
jne 0x5792
movq (%rsp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x5321
xorl %ecx, %ecx
leaq 0x8(%rsp), %r15
movq %rcx, 0x30(%rsp)
leaq (%rcx,%rcx,2), %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x8, %ebp
xorl %ebx, %ebx
movl $0x8, %edx
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x160(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
imulq %r12, %rax
addq (%rcx), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rbp,%rax)
movl $0x8, %edx
leaq 0xe90(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x160(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
movsd 0x8(%rsp), %xmm0
imulq %r12, %rax
addq (%rcx), %rax
movsd %xmm0, (%rbp,%rax)
movl $0x8, %edx
leaq 0xc88(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x178(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
imulq %r12, %rax
addq (%rcx), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rbp,%rax)
movl $0x8, %edx
leaq 0xa80(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x178(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
movsd 0x8(%rsp), %xmm0
imulq %r12, %rax
addq (%rcx), %rax
movsd %xmm0, (%rbp,%rax)
incq %rbx
addq $0x10, %rbp
cmpq $0xb5, %rbx
jne 0x51aa
incq %r13
addq $0x10, %r12
cmpq $0x5b, %r13
jne 0x51a3
movq 0x30(%rsp), %rcx
incq %rcx
movq (%rsp), %rax
movslq 0xc(%rax), %rax
cmpq %rax, %rcx
jl 0x5194
leaq 0x680(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x670(%rsp), %rdi
callq 0x434a
leaq 0x16f1c(%rip), %rsi     # 0x1c26a
leaq 0x670(%rsp), %rdi
callq 0x34b0
leaq 0x878(%rsp), %rdi
leaq 0x670(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0x670(%rsp), %rdi
cmpq %r14, %rdi
je 0x5392
movq 0x680(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x478(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x468(%rsp), %rdi
callq 0x434a
leaq 0x16eb5(%rip), %rsi     # 0x1c274
leaq 0x468(%rsp), %rdi
callq 0x34b0
leaq 0x670(%rsp), %rdi
leaq 0x468(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0x468(%rsp), %rdi
cmpq %r14, %rdi
je 0x5403
movq 0x478(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x270(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x260(%rsp), %rdi
callq 0x434a
leaq 0x16e4e(%rip), %rsi     # 0x1c27e
leaq 0x260(%rsp), %rdi
callq 0x34b0
leaq 0x468(%rsp), %rdi
leaq 0x260(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0x260(%rsp), %rdi
cmpq %r14, %rdi
je 0x5474
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x434a
leaq 0x16def(%rip), %rsi     # 0x1c28a
leaq 0x38(%rsp), %rdi
callq 0x34b0
leaq 0x260(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movl $0x4, %edx
callq 0x3400
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x54d3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x878(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x898(%rsp,%rax)
jne 0x57b8
movq 0x670(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x690(%rsp,%rax)
jne 0x57b8
movq 0x468(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x488(%rsp,%rax)
jne 0x57b8
movq 0x260(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x280(%rsp,%rax)
jne 0x57b8
movq (%rsp), %rax
cmpl $0x0, 0x8(%rax)
jle 0x56e0
xorl %ecx, %ecx
leaq 0x8(%rsp), %r15
movq %rcx, 0x30(%rsp)
leaq (%rcx,%rcx,2), %r14
xorl %r12d, %r12d
xorl %r13d, %r13d
movl $0x8, %ebp
xorl %ebx, %ebx
movl $0x8, %edx
leaq 0x878(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x190(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
imulq %r12, %rax
addq (%rcx), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rbp,%rax)
movl $0x8, %edx
leaq 0x670(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x190(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
movsd 0x8(%rsp), %xmm0
imulq %r12, %rax
addq (%rcx), %rax
movsd %xmm0, (%rbp,%rax)
movl $0x8, %edx
leaq 0x468(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x1a8(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
imulq %r12, %rax
addq (%rcx), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rbp,%rax)
movl $0x8, %edx
leaq 0x260(%rsp), %rdi
movq %r15, %rsi
callq 0x3340
movq (%rsp), %rax
movq 0x1a8(%rax), %rcx
movq 0x8(%rcx,%r14,8), %rax
cmpq %rbx, %rax
jle 0x5773
leaq (%rcx,%r14,8), %rcx
cmpq %r13, 0x10(%rcx)
jle 0x5773
movsd 0x8(%rsp), %xmm0
imulq %r12, %rax
addq (%rcx), %rax
movsd %xmm0, (%rbp,%rax)
incq %rbx
addq $0x10, %rbp
cmpq $0xb5, %rbx
jne 0x5566
incq %r13
addq $0x10, %r12
cmpq $0x5b, %r13
jne 0x555f
movq 0x30(%rsp), %rcx
incq %rcx
movq (%rsp), %rax
movslq 0x8(%rax), %rax
cmpq %rax, %rcx
jl 0x5550
leaq 0x260(%rsp), %rdi
callq 0x30a0
leaq 0x468(%rsp), %rdi
callq 0x30a0
leaq 0x670(%rsp), %rdi
callq 0x30a0
leaq 0x878(%rsp), %rdi
callq 0x30a0
leaq 0xa80(%rsp), %rdi
callq 0x30a0
leaq 0xc88(%rsp), %rdi
callq 0x30a0
leaq 0xe90(%rsp), %rdi
callq 0x30a0
leaq 0x58(%rsp), %rdi
callq 0x30a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5761
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1726d(%rip), %rdi     # 0x1c9e7
leaq 0x1729b(%rip), %rsi     # 0x1ca1c
leaq 0x172b7(%rip), %rcx     # 0x1ca3f
movl $0x16d, %edx            # imm = 0x16D
callq 0x31b0
movq 0x29857(%rip), %rdi     # 0x2eff0
leaq 0x16aa9(%rip), %rsi     # 0x1c249
movl $0x20, %edx
callq 0x32e0
movq 0x2983f(%rip), %rdi     # 0x2eff0
callq 0x3120
jmp 0x57dc
movq 0x29831(%rip), %rdi     # 0x2eff0
leaq 0x16ad0(%rip), %rsi     # 0x1c296
movl $0x20, %edx
callq 0x32e0
movq 0x29819(%rip), %rdi     # 0x2eff0
callq 0x3120
callq 0x3170
jmp 0x57e3
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x5986
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x5986
movq %rax, %rbx
jmp 0x5986
jmp 0x5810
movq %rax, %rbx
movq 0x260(%rsp), %rdi
cmpq %r14, %rdi
je 0x5993
movq 0x270(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x5993
movq %rax, %rbx
jmp 0x5993
jmp 0x5843
movq %rax, %rbx
movq 0x468(%rsp), %rdi
cmpq %r14, %rdi
je 0x59a0
movq 0x478(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59a0
movq %rax, %rbx
jmp 0x59a0
jmp 0x5876
movq %rax, %rbx
movq 0x670(%rsp), %rdi
cmpq %r14, %rdi
je 0x59b2
movq 0x680(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59b2
jmp 0x59af
jmp 0x58a6
movq %rax, %rbx
movq 0x878(%rsp), %rdi
cmpq %r14, %rdi
je 0x59bf
movq 0x888(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59bf
movq %rax, %rbx
jmp 0x59bf
jmp 0x58d9
movq %rax, %rbx
movq 0xa80(%rsp), %rdi
cmpq %r14, %rdi
je 0x59cc
movq 0xa90(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59cc
movq %rax, %rbx
jmp 0x59cc
jmp 0x590c
movq %rax, %rbx
movq 0xc88(%rsp), %rdi
cmpq %r14, %rdi
je 0x59d9
movq 0xc98(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59d9
movq %rax, %rbx
jmp 0x59d9
jmp 0x593f
movq %rax, %rbx
movq 0xe90(%rsp), %rdi
cmpq %r14, %rdi
je 0x59e3
movq 0xea0(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x59e3
jmp 0x5971
jmp 0x5976
jmp 0x59af
jmp 0x5971
jmp 0x5971
jmp 0x5971
movq %rax, %rbx
jmp 0x59e3
movq %rax, %rbx
leaq 0x260(%rsp), %rdi
callq 0x30a0
leaq 0x468(%rsp), %rdi
callq 0x30a0
leaq 0x670(%rsp), %rdi
callq 0x30a0
leaq 0x878(%rsp), %rdi
callq 0x30a0
jmp 0x59b2
movq %rax, %rbx
leaq 0xa80(%rsp), %rdi
callq 0x30a0
leaq 0xc88(%rsp), %rdi
callq 0x30a0
leaq 0xe90(%rsp), %rdi
callq 0x30a0
leaq 0x58(%rsp), %rdi
callq 0x30a0
leaq 0x20(%rsp), %rax
movq 0x10(%rsp), %rdi
cmpq %rax, %rdi
je 0x59ff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x3460
nop