// File: /workspace/github_cpp_makefile_star2_O2/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 $0x10b8, %rsp           # imm = 0x10B8
movq %rdi, %r15
leaq 0x20(%rdi), %rsi
leaq 0x30(%rsp), %rdi
callq 0x3330
leaq 0x160(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x178(%r15), %r13
xorl %ebp, %ebp
leaq 0xeb0(%rsp), %rbx
pushq $0x5b
popq %r14
cmpl 0xc(%r15), %ebp
jge 0x4857
movl $0xb5, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5440
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x5526
movl $0xb5, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5440
movq %r13, %rdi
movq %rbx, %rsi
callq 0x5526
incl %ebp
jmp 0x4815
leaq 0x190(%r15), %rax
movq %rax, 0x20(%rsp)
leaq 0x1a8(%r15), %rax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0xeb0(%rsp), %rbx
pushq $0x5b
popq %r14
cmpl 0x8(%r15), %ebp
jge 0x48c1
movl $0xb5, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5440
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x5526
movl $0xb5, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x5440
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x5526
incl %ebp
jmp 0x487d
andq $0x0, 0x8(%rsp)
leaq 0x17957(%rip), %rdx     # 0x1c225
leaq 0xca8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0xeb0(%rsp), %rdi
leaq 0xca8(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0xca8(%rsp), %rdi
callq 0x3100
leaq 0x17923(%rip), %rdx     # 0x1c22f
leaq 0xaa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0xca8(%rsp), %rdi
leaq 0xaa0(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0xaa0(%rsp), %rdi
callq 0x3100
leaq 0x178ef(%rip), %rdx     # 0x1c239
leaq 0x898(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0xaa0(%rsp), %rdi
leaq 0x898(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x898(%rsp), %rdi
callq 0x3100
leaq 0x178bd(%rip), %rdx     # 0x1c245
leaq 0x690(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0x898(%rsp), %rdi
leaq 0x690(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x690(%rsp), %rdi
callq 0x3100
movq 0xeb0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xed0(%rsp,%rax)
jne 0x4e47
movq 0xca8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xcc8(%rsp,%rax)
jne 0x4e47
movq 0xaa0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xac0(%rsp,%rax)
jne 0x4e47
movq 0x898(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x8b8(%rsp,%rax)
jne 0x4e47
xorl %ecx, %ecx
leaq 0x8(%rsp), %rbx
pushq $0x8
popq %r14
movq %r15, 0x28(%rsp)
movslq 0xc(%r15), %rax
cmpq %rax, %rcx
jge 0x4b51
movq %rcx, 0x50(%rsp)
imulq $0x18, %rcx, %r12
xorl %ebp, %ebp
cmpq $0x5b, %rbp
je 0x4b3f
xorl %r15d, %r15d
cmpq $0xb5, %r15
je 0x4b37
leaq 0xeb0(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x32e0
movq 0x10(%rsp), %rax
movq (%rax), %rdi
addq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0xca8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x32e0
movq 0x10(%rsp), %rax
movq (%rax), %rdi
addq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
leaq 0xaa0(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x32e0
movq (%r13), %rdi
addq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x898(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x32e0
movq (%r13), %rdi
addq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
incq %r15
jmp 0x4a5c
incq %rbp
jmp 0x4a4f
movq 0x50(%rsp), %rcx
incq %rcx
movq 0x28(%rsp), %r15
jmp 0x4a37
leaq 0x1771a(%rip), %rdx     # 0x1c272
leaq 0x488(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0x690(%rsp), %rdi
leaq 0x488(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x488(%rsp), %rdi
callq 0x3100
leaq 0x176e6(%rip), %rdx     # 0x1c27c
leaq 0x280(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0x488(%rsp), %rdi
leaq 0x280(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x280(%rsp), %rdi
callq 0x3100
leaq 0x176b2(%rip), %rdx     # 0x1c286
leaq 0x78(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0x280(%rsp), %rdi
leaq 0x78(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x78(%rsp), %rdi
callq 0x3100
leaq 0x17689(%rip), %rdx     # 0x1c292
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3b99
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x33d0
leaq 0x58(%rsp), %rdi
callq 0x3100
movq 0x690(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x6b0(%rsp,%rax)
jne 0x4e64
movq 0x488(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x4a8(%rsp,%rax)
jne 0x4e64
movq 0x280(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x2a0(%rsp,%rax)
jne 0x4e64
movq 0x78(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x98(%rsp,%rax)
jne 0x4e64
xorl %ecx, %ecx
leaq 0x8(%rsp), %r13
pushq $0x8
popq %rbx
leaq 0x78(%rsp), %rbp
movslq 0x8(%r15), %rax
cmpq %rax, %rcx
jge 0x4dc6
movq %rcx, 0x10(%rsp)
imulq $0x18, %rcx, %r15
xorl %r12d, %r12d
cmpq $0x5b, %r12
je 0x4db4
xorl %r14d, %r14d
cmpq $0xb5, %r14
je 0x4dac
leaq 0x690(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x32e0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
leaq 0x488(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x32e0
movq 0x20(%rsp), %rax
movq (%rax), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
leaq 0x280(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x32e0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x32e0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x54d6
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
incq %r14
jmp 0x4cce
incq %r12
jmp 0x4cc1
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x28(%rsp), %r15
jmp 0x4ca8
leaq 0x78(%rsp), %rdi
callq 0x30a0
leaq 0x280(%rsp), %rdi
callq 0x30a0
leaq 0x488(%rsp), %rdi
callq 0x30a0
leaq 0x690(%rsp), %rdi
callq 0x30a0
leaq 0x898(%rsp), %rdi
callq 0x30a0
leaq 0xaa0(%rsp), %rdi
callq 0x30a0
leaq 0xca8(%rsp), %rdi
callq 0x30a0
leaq 0xeb0(%rsp), %rdi
callq 0x30a0
leaq 0x30(%rsp), %rdi
callq 0x3100
addq $0x10b8, %rsp           # imm = 0x10B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x351a2(%rip), %rdi     # 0x39ff0
leaq 0x173fc(%rip), %rsi     # 0x1c251
callq 0x3250
movq %rax, %rdi
callq 0x3110
jmp 0x4e7f
movq 0x35185(%rip), %rdi     # 0x39ff0
leaq 0x1742c(%rip), %rsi     # 0x1c29e
callq 0x3250
movq %rax, %rdi
callq 0x3110
callq 0x3160
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3100
jmp 0x4f76
movq %rax, %rbx
jmp 0x4f76
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3100
jmp 0x4f83
movq %rax, %rbx
jmp 0x4f83
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
callq 0x3100
jmp 0x4f90
movq %rax, %rbx
jmp 0x4f90
movq %rax, %rbx
leaq 0x488(%rsp), %rdi
callq 0x3100
jmp 0x4fa2
jmp 0x4f9f
movq %rax, %rbx
leaq 0x690(%rsp), %rdi
callq 0x3100
jmp 0x4faf
movq %rax, %rbx
jmp 0x4faf
movq %rax, %rbx
leaq 0x898(%rsp), %rdi
callq 0x3100
jmp 0x4fbc
movq %rax, %rbx
jmp 0x4fbc
movq %rax, %rbx
leaq 0xaa0(%rsp), %rdi
callq 0x3100
jmp 0x4fc9
movq %rax, %rbx
jmp 0x4fc9
movq %rax, %rbx
leaq 0xca8(%rsp), %rdi
callq 0x3100
jmp 0x4fd6
jmp 0x4f64
jmp 0x4f69
jmp 0x4f9f
jmp 0x4f64
jmp 0x4f64
jmp 0x4f64
movq %rax, %rbx
jmp 0x4fd6
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x30a0
leaq 0x280(%rsp), %rdi
callq 0x30a0
leaq 0x488(%rsp), %rdi
callq 0x30a0
leaq 0x690(%rsp), %rdi
callq 0x30a0
jmp 0x4fa2
movq %rax, %rbx
leaq 0x898(%rsp), %rdi
callq 0x30a0
leaq 0xaa0(%rsp), %rdi
callq 0x30a0
leaq 0xca8(%rsp), %rdi
callq 0x30a0
leaq 0xeb0(%rsp), %rdi
callq 0x30a0
leaq 0x30(%rsp), %rdi
callq 0x3100
movq %rbx, %rdi
callq 0x3430