// File: istellartech[P]OpenTsiolkovsky/src/coordinate_transform.cpp
// Function: dcmECEF2NED(Eigen::Matrix<double, 3, 1, 0, 3, 1>)
Matrix3d dcmECEF2NED(Vector3d posLLH_){
    Matrix3d dcm;
    double lat = deg2rad(posLLH_[0]);
    double lon = deg2rad(posLLH_[1]);
    dcm << -sin(lat)*cos(lon), -sin(lat)*sin(lon), cos(lat),
           -sin(lon),           cos(lon),          0,
           -cos(lat)*cos(lon), -cos(lat)*sin(lon), -sin(lat);
    return dcm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rsi, -0xd8(%rbp)
movq %rdi, -0xd0(%rbp)
movq %rdi, %rax
movq %rax, -0xe0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x1dbe0
movq -0xd8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1de40
movsd (%rax), %xmm0
callq 0x1e000
movq -0xd8(%rbp), %rdi
movsd %xmm0, -0x18(%rbp)
movl $0x1, %esi
callq 0x1de40
movsd (%rax), %xmm0
callq 0x1e000
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x6120
movapd 0x7e41(%rip), %xmm1     # 0x53040
movaps %xmm1, -0xc0(%rbp)
pxor %xmm1, %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x6810
movq -0xd0(%rbp), %rsi
movaps %xmm0, %xmm1
movsd -0xc8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
leaq -0x48(%rbp), %rdx
callq 0x49f30
movsd -0x18(%rbp), %xmm0
callq 0x6120
movaps -0xc0(%rbp), %xmm1
pxor %xmm1, %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x6120
movq -0xb0(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x49f70
movq %rax, -0xa0(%rbp)
jmp 0x4b29f
movsd -0x18(%rbp), %xmm0
callq 0x6810
movq -0xa0(%rbp), %rdi
movsd %xmm0, -0x68(%rbp)
leaq -0x68(%rbp), %rsi
callq 0x49f70
movq %rax, -0xe8(%rbp)
jmp 0x4b2c7
movsd -0x20(%rbp), %xmm0
callq 0x6120
movq -0xe8(%rbp), %rdi
movaps 0x7d61(%rip), %xmm1     # 0x53040
pxor %xmm1, %xmm0
movlpd %xmm0, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x49f70
movq %rax, -0xf0(%rbp)
jmp 0x4b2fa
movsd -0x20(%rbp), %xmm0
callq 0x6810
movq -0xf0(%rbp), %rdi
movsd %xmm0, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
callq 0x49f70
movq %rax, -0xf8(%rbp)
jmp 0x4b322
movq -0xf8(%rbp), %rdi
movq $0x0, -0x80(%rbp)
leaq -0x80(%rbp), %rsi
callq 0x49f70
movq %rax, -0x100(%rbp)
jmp 0x4b343
movsd -0x18(%rbp), %xmm0
callq 0x6810
movaps 0x7cec(%rip), %xmm1     # 0x53040
pxor %xmm1, %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x6810
movq -0x100(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x110(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x49f70
movq %rax, -0x108(%rbp)
jmp 0x4b39d
movsd -0x18(%rbp), %xmm0
callq 0x6810
movaps 0x7c92(%rip), %xmm1     # 0x53040
pxor %xmm1, %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x6120
movq -0x108(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x120(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x49f70
movq %rax, -0x118(%rbp)
jmp 0x4b3f7
movsd -0x18(%rbp), %xmm0
callq 0x6120
movq -0x118(%rbp), %rdi
movaps 0x7c31(%rip), %xmm1     # 0x53040
pxor %xmm1, %xmm0
movlpd %xmm0, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x49f70
jmp 0x4b429
leaq -0x40(%rbp), %rdi
callq 0x4a0e0
movq -0xe0(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4a0e0
movq -0x58(%rbp), %rdi
callq 0x67a0