// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::sunmoonpos(bamboo::gtime_t, double const*, double*, double*, double*)
extern void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
                       double *rmoon, double *gmst)
{
    gtime_t tut;
    double rs[3],rm[3],U[9],gmst_;
    
    trace(4,"sunmoonpos: tutc=%s\n",time_str(tutc,3));
    
    tut=timeadd(tutc,erpv[2]); /* utc -> ut1 */
    
    /* sun and moon position in eci */
    sunmoonpos_eci(tut,rsun?rs:NULL,rmoon?rm:NULL);
    
    /* eci to ecef transformation matrix */
    eci2ecef(tutc,erpv,U,&gmst_);
    
    /* sun and moon postion in ecef */
    if (rsun ) matmul("NN",3,1,3,1.0,U,rs,0.0,rsun );
    if (rmoon) matmul("NN",3,1,3,1.0,U,rm,0.0,rmoon);
    if (gmst ) *gmst=gmst_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %r8, -0xa0(%rbp)
movq %rcx, -0x88(%rbp)
movq %rdx, %r13
movq %rsi, %r14
movsd %xmm0, -0x70(%rbp)
movq %rdi, %r15
leaq 0x3cd69(%rip), %rbx     # 0x91ff0
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4fcf1
movq %r14, -0x98(%rbp)
movsd 0x10(%r14), %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x8ac0
cvttsd2si %xmm0, %eax
movslq %eax, %r12
movq %r15, -0x90(%rbp)
addq %r15, %r12
movsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
xorpd %xmm0, %xmm0
leaq -0x160(%rbp), %r14
movapd %xmm0, 0x20(%r14)
movabsq $0x409f400000000000, %rax # imm = 0x409F400000000000
movq %rax, (%r14)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x8(%r14)
movq %rax, 0x10(%r14)
movabsq $0x4028000000000000, %rax # imm = 0x4028000000000000
movq %rax, 0x18(%r14)
movq %r12, %rdi
movapd %xmm1, %xmm0
movq %rbx, %rsi
movl $0x3, %edx
callq 0x4fcf1
movq %r14, %rdi
callq 0x4f027
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %rax, %rsi
callq 0x8330
addsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
divsd 0x15585(%rip), %xmm0    # 0x6a8d0
divsd 0x1f84d(%rip), %xmm0    # 0x74ba0
movsd %xmm0, -0x30(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x511f9
movsd 0x1faac(%rip), %xmm0    # 0x74e18
mulsd -0x30(%rbp), %xmm0
addsd 0x1faa7(%rip), %xmm0    # 0x74e20
mulsd 0x1f8ff(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x38(%rbp)
callq 0x8150
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8bf0
testq %r13, %r13
movsd %xmm0, -0x60(%rbp)
je 0x554dd
movsd 0x1fa78(%rip), %xmm2    # 0x74e28
movsd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm2
addsd 0x1fa6f(%rip), %xmm2    # 0x74e30
movsd %xmm2, -0x48(%rbp)
movsd 0x1fa6a(%rip), %xmm3    # 0x74e38
mulsd %xmm0, %xmm3
addsd 0x1fa66(%rip), %xmm3    # 0x74e40
movsd %xmm3, -0x38(%rbp)
movapd %xmm2, %xmm0
mulsd 0x1f895(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x40(%rbp)
callq 0x8150
mulsd 0x1fa4b(%rip), %xmm0    # 0x74e48
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
mulsd 0x1f868(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x48(%rbp)
callq 0x8150
mulsd 0x1fa26(%rip), %xmm0    # 0x74e50
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1fa12(%rip), %xmm0    # 0x74e58
addsd 0x1fa12(%rip), %xmm0    # 0x74e60
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1fa03(%rip), %xmm0    # 0x74e68
addsd -0x40(%rbp), %xmm0
mulsd 0x1f9fe(%rip), %xmm0    # 0x74e70
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd 0x1f7fc(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x38(%rbp)
callq 0x8150
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8bf0
movsd -0x60(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
mulsd %xmm2, %xmm0
movsd %xmm0, -0x110(%rbp)
movapd %xmm1, %xmm0
mulsd %xmm2, %xmm0
movsd -0x40(%rbp), %xmm3
mulsd %xmm3, %xmm0
movsd %xmm0, -0x108(%rbp)
mulsd -0x68(%rbp), %xmm2
mulsd %xmm3, %xmm2
movsd %xmm2, -0x100(%rbp)
movsd -0x30(%rbp), %xmm0
movq -0x88(%rbp), %r15
testq %r15, %r15
je 0x557c8
mulsd 0x1f97e(%rip), %xmm0    # 0x74e78
addsd 0x1f97e(%rip), %xmm0    # 0x74e80
movsd %xmm0, -0x30(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x8150
mulsd 0x1f967(%rip), %xmm0    # 0x74e88
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xb8(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movsd 0x168c8(%rip), %xmm0    # 0x6be08
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x8150
mulsd 0x1f930(%rip), %xmm0    # 0x74e90
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x8150
mulsd 0x1f913(%rip), %xmm0    # 0x74e98
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
callq 0x8150
mulsd 0x1f8f6(%rip), %xmm0    # 0x74ea0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xc8(%rbp), %xmm0
callq 0x8150
mulsd 0x1f8df(%rip), %xmm0    # 0x74ea8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
addsd %xmm0, %xmm0
callq 0x8150
mulsd 0x1f8bf(%rip), %xmm0    # 0x74eb0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x8150
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x8150
mulsd 0x1f897(%rip), %xmm0    # 0x74eb8
movsd -0x50(%rbp), %xmm1
mulsd 0x1f892(%rip), %xmm1    # 0x74ec0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
callq 0x8150
mulsd 0x1f87a(%rip), %xmm0    # 0x74ec8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x78(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x8150
mulsd 0x1f861(%rip), %xmm0    # 0x74ed0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1f84d(%rip), %xmm0    # 0x74ed8
addsd 0x1f84d(%rip), %xmm0    # 0x74ee0
movsd %xmm0, -0x38(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1f83e(%rip), %xmm0    # 0x74ee8
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1f82a(%rip), %xmm0    # 0x74ef0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1f816(%rip), %xmm0    # 0x74ef8
addsd -0x38(%rbp), %xmm0
mulsd 0x1f591(%rip), %xmm0    # 0x74c80
callq 0x8150
movsd 0x151fc(%rip), %xmm1    # 0x6a8f8
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd 0x1f56e(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x40(%rbp)
callq 0x8150
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8bf0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd 0x1f543(%rip), %xmm0    # 0x74c80
movsd %xmm0, -0x30(%rbp)
callq 0x8150
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x8bf0
movsd -0x48(%rbp), %xmm4
movapd %xmm4, %xmm1
mulsd %xmm0, %xmm1
mulsd -0x40(%rbp), %xmm1
movsd %xmm1, -0xf0(%rbp)
movsd -0x60(%rbp), %xmm2
movapd %xmm2, %xmm1
mulsd %xmm0, %xmm1
movsd -0x58(%rbp), %xmm5
mulsd %xmm5, %xmm2
movapd %xmm2, %xmm3
movsd -0x68(%rbp), %xmm2
mulsd %xmm2, %xmm5
movapd %xmm5, %xmm6
movsd -0x38(%rbp), %xmm5
mulsd %xmm5, %xmm1
subsd %xmm6, %xmm1
mulsd %xmm4, %xmm1
movsd %xmm1, -0xe8(%rbp)
mulsd %xmm0, %xmm2
mulsd %xmm5, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm4, %xmm2
movsd %xmm2, -0xe0(%rbp)
leaq -0x160(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
movq -0x90(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
movq -0x98(%rbp), %rsi
callq 0x508ed
testq %r13, %r13
je 0x5582c
movq %r13, (%rsp)
leaq 0x1f869(%rip), %rdi     # 0x75067
movsd 0x1411a(%rip), %xmm0    # 0x69920
leaq -0x160(%rbp), %r8
leaq -0x110(%rbp), %r9
xorpd %xmm1, %xmm1
movl $0x3, %esi
movl $0x1, %edx
movl $0x3, %ecx
callq 0x4dfb0
testq %r15, %r15
je 0x5586a
movq %r15, (%rsp)
leaq 0x1f82b(%rip), %rdi     # 0x75067
movsd 0x140dc(%rip), %xmm0    # 0x69920
leaq -0x160(%rbp), %r8
leaq -0xf0(%rbp), %r9
xorpd %xmm1, %xmm1
movl $0x3, %esi
movl $0x1, %edx
movl $0x3, %ecx
callq 0x4dfb0
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x55882
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, (%rax)
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq