// File: /workspace/github_cpp_makefile_star2_O1/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 $0x138, %rsp            # imm = 0x138
movq %r8, -0x98(%rbp)
movq %rcx, %rbx
movq %rdx, %r13
movq %rsi, %r15
movsd %xmm0, -0x70(%rbp)
movq %rdi, %r14
leaq 0x3c2c9(%rip), %rsi     # 0x91ff0
movl $0x3, %edx
callq 0x50696
movq %r15, -0x90(%rbp)
movsd 0x10(%r15), %xmm0
addsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x8ad0
cvttsd2si %xmm0, %eax
movslq %eax, %r12
movq %r14, -0x88(%rbp)
addq %r14, %r12
movsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
testq %rbx, %rbx
leaq -0xe0(%rbp), %r14
cmoveq %rbx, %r14
xorpd %xmm0, %xmm0
leaq -0x150(%rbp), %r15
movapd %xmm0, (%r15)
movapd %xmm0, 0x10(%r15)
movapd %xmm0, 0x20(%r15)
movabsq $0x409f400000000000, %rax # imm = 0x409F400000000000
movq %rax, (%r15)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x8(%r15)
movq %rax, 0x10(%r15)
movabsq $0x4028000000000000, %rax # imm = 0x4028000000000000
movq %rax, 0x18(%r15)
movq %r12, %rdi
movapd %xmm1, %xmm0
leaq 0x3c21f(%rip), %rsi     # 0x91ff0
movl $0x3, %edx
callq 0x50696
movq %r15, %rdi
callq 0x4f9a4
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %rax, %rsi
callq 0x8330
addsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
divsd 0x14acb(%rip), %xmm0    # 0x6a8d0
divsd 0x1edb3(%rip), %xmm0    # 0x74bc0
movsd %xmm0, -0x30(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x51be9
movsd 0x1f012(%rip), %xmm0    # 0x74e38
mulsd -0x30(%rbp), %xmm0
addsd 0x1f00d(%rip), %xmm0    # 0x74e40
mulsd 0x1ee65(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x38(%rbp)
callq 0x8150
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8c00
testq %r13, %r13
movsd %xmm0, -0x60(%rbp)
je 0x55f97
movsd 0x1efde(%rip), %xmm2    # 0x74e48
movsd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm2
addsd 0x1efd5(%rip), %xmm2    # 0x74e50
movsd %xmm2, -0x48(%rbp)
movsd 0x1efd0(%rip), %xmm3    # 0x74e58
mulsd %xmm0, %xmm3
addsd 0x1efcc(%rip), %xmm3    # 0x74e60
movsd %xmm3, -0x38(%rbp)
movapd %xmm2, %xmm0
mulsd 0x1edfb(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x40(%rbp)
callq 0x8150
mulsd 0x1efb1(%rip), %xmm0    # 0x74e68
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
mulsd 0x1edce(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x48(%rbp)
callq 0x8150
mulsd 0x1ef8c(%rip), %xmm0    # 0x74e70
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8c00
mulsd 0x1ef78(%rip), %xmm0    # 0x74e78
addsd 0x1ef78(%rip), %xmm0    # 0x74e80
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8c00
mulsd 0x1ef69(%rip), %xmm0    # 0x74e88
addsd -0x40(%rbp), %xmm0
mulsd 0x1ef64(%rip), %xmm0    # 0x74e90
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd 0x1ed62(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x38(%rbp)
callq 0x8150
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8c00
movsd -0x60(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
mulsd %xmm2, %xmm0
movsd %xmm0, -0x100(%rbp)
movapd %xmm1, %xmm0
mulsd %xmm2, %xmm0
movsd -0x40(%rbp), %xmm3
mulsd %xmm3, %xmm0
movsd %xmm0, -0xf8(%rbp)
mulsd -0x68(%rbp), %xmm2
mulsd %xmm3, %xmm2
movsd %xmm2, -0xf0(%rbp)
movsd -0x30(%rbp), %xmm0
testq %rbx, %rbx
je 0x56278
mulsd 0x1eeeb(%rip), %xmm0    # 0x74e98
addsd 0x1eeeb(%rip), %xmm0    # 0x74ea0
movsd %xmm0, -0x30(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x8150
mulsd 0x1eed4(%rip), %xmm0    # 0x74ea8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xa8(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movsd 0x15e15(%rip), %xmm0    # 0x6be08
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x8150
mulsd 0x1ee9d(%rip), %xmm0    # 0x74eb0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x8150
mulsd 0x1ee80(%rip), %xmm0    # 0x74eb8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
callq 0x8150
mulsd 0x1ee63(%rip), %xmm0    # 0x74ec0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xb8(%rbp), %xmm0
callq 0x8150
mulsd 0x1ee4c(%rip), %xmm0    # 0x74ec8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
addsd %xmm0, %xmm0
callq 0x8150
mulsd 0x1ee2c(%rip), %xmm0    # 0x74ed0
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 0x1ee04(%rip), %xmm0    # 0x74ed8
movsd -0x50(%rbp), %xmm1
mulsd 0x1edff(%rip), %xmm1    # 0x74ee0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
callq 0x8150
mulsd 0x1ede7(%rip), %xmm0    # 0x74ee8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x78(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x8150
mulsd 0x1edce(%rip), %xmm0    # 0x74ef0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8c00
mulsd 0x1edba(%rip), %xmm0    # 0x74ef8
addsd 0x1edba(%rip), %xmm0    # 0x74f00
movsd %xmm0, -0x38(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0x8c00
mulsd 0x1edab(%rip), %xmm0    # 0x74f08
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8c00
mulsd 0x1ed97(%rip), %xmm0    # 0x74f10
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0x8c00
mulsd 0x1ed83(%rip), %xmm0    # 0x74f18
addsd -0x38(%rbp), %xmm0
mulsd 0x1eafe(%rip), %xmm0    # 0x74ca0
callq 0x8150
movsd 0x14749(%rip), %xmm1    # 0x6a8f8
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd 0x1eadb(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x40(%rbp)
callq 0x8150
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8c00
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd 0x1eab0(%rip), %xmm0    # 0x74ca0
movsd %xmm0, -0x30(%rbp)
callq 0x8150
movsd %xmm0, -0x58(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x8c00
movsd -0x48(%rbp), %xmm4
movapd %xmm4, %xmm1
mulsd %xmm0, %xmm1
mulsd -0x40(%rbp), %xmm1
movsd %xmm1, (%r14)
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, -0xd8(%rbp)
mulsd %xmm0, %xmm2
mulsd %xmm5, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm4, %xmm2
movsd %xmm2, -0xd0(%rbp)
leaq -0x150(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movq -0x88(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
movq -0x90(%rbp), %rsi
callq 0x512cf
testq %r13, %r13
je 0x562dc
movq %r13, (%rsp)
leaq 0x1edd9(%rip), %rdi     # 0x75087
movsd 0x1366a(%rip), %xmm0    # 0x69920
leaq -0x150(%rbp), %r8
leaq -0x100(%rbp), %r9
xorpd %xmm1, %xmm1
movl $0x3, %esi
movl $0x1, %edx
movl $0x3, %ecx
callq 0x4e91f
testq %rbx, %rbx
je 0x5631a
movq %rbx, (%rsp)
leaq 0x1ed9b(%rip), %rdi     # 0x75087
movsd 0x1362c(%rip), %xmm0    # 0x69920
leaq -0x150(%rbp), %r8
leaq -0xe0(%rbp), %r9
xorpd %xmm1, %xmm1
movl $0x3, %esi
movl $0x1, %edx
movl $0x3, %ecx
callq 0x4e91f
movq -0x98(%rbp), %rax
testq %rax, %rax
je 0x56332
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, (%rax)
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq