// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x3
popq %rbx
movl %ebx, %esi
callq 0x47b0e
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
movl %ebx, %esi
callq 0x47b0e
movq %r14, %rdi
callq 0x46ee2
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %rax, %rsi
callq 0x8340
addsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
divsd 0x14075(%rip), %xmm0    # 0x608c0
divsd 0x1e34d(%rip), %xmm0    # 0x6aba0
movsd %xmm0, -0x30(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x48c03
movsd 0x1e5ac(%rip), %xmm0    # 0x6ae18
mulsd -0x30(%rbp), %xmm0
addsd 0x1e5a7(%rip), %xmm0    # 0x6ae20
mulsd 0x1e3ff(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x38(%rbp)
callq 0x8160
movsd %xmm0, -0x68(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8bf0
testq %r13, %r13
movsd %xmm0, -0x60(%rbp)
je 0x4c9dd
movsd 0x1e578(%rip), %xmm2    # 0x6ae28
movsd -0x30(%rbp), %xmm0
mulsd %xmm0, %xmm2
addsd 0x1e56f(%rip), %xmm2    # 0x6ae30
movsd %xmm2, -0x48(%rbp)
movsd 0x1e56a(%rip), %xmm3    # 0x6ae38
mulsd %xmm0, %xmm3
addsd 0x1e566(%rip), %xmm3    # 0x6ae40
movsd %xmm3, -0x38(%rbp)
movapd %xmm2, %xmm0
mulsd 0x1e395(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x40(%rbp)
callq 0x8160
mulsd 0x1e54b(%rip), %xmm0    # 0x6ae48
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
mulsd 0x1e368(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x48(%rbp)
callq 0x8160
mulsd 0x1e526(%rip), %xmm0    # 0x6ae50
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e512(%rip), %xmm0    # 0x6ae58
addsd 0x1e512(%rip), %xmm0    # 0x6ae60
movsd %xmm0, -0x40(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e503(%rip), %xmm0    # 0x6ae68
addsd -0x40(%rbp), %xmm0
mulsd 0x1e4fe(%rip), %xmm0    # 0x6ae70
movsd %xmm0, -0x48(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd 0x1e2fc(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x38(%rbp)
callq 0x8160
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 0x4ccc8
mulsd 0x1e47e(%rip), %xmm0    # 0x6ae78
addsd 0x1e47e(%rip), %xmm0    # 0x6ae80
movsd %xmm0, -0x30(%rbp)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
callq 0x8160
mulsd 0x1e467(%rip), %xmm0    # 0x6ae88
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xb8(%rbp), %xmm1
movsd %xmm1, -0x48(%rbp)
movsd 0x153b8(%rip), %xmm0    # 0x61df8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
callq 0x8160
mulsd 0x1e430(%rip), %xmm0    # 0x6ae90
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x48(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x8160
mulsd 0x1e413(%rip), %xmm0    # 0x6ae98
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
callq 0x8160
mulsd 0x1e3f6(%rip), %xmm0    # 0x6aea0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0xc8(%rbp), %xmm0
callq 0x8160
mulsd 0x1e3df(%rip), %xmm0    # 0x6aea8
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
addsd %xmm0, %xmm0
callq 0x8160
mulsd 0x1e3bf(%rip), %xmm0    # 0x6aeb0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
callq 0x8160
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x8160
mulsd 0x1e397(%rip), %xmm0    # 0x6aeb8
movsd -0x50(%rbp), %xmm1
mulsd 0x1e392(%rip), %xmm1    # 0x6aec0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x30(%rbp), %xmm0
subsd -0x38(%rbp), %xmm0
callq 0x8160
mulsd 0x1e37a(%rip), %xmm0    # 0x6aec8
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x78(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
callq 0x8160
mulsd 0x1e361(%rip), %xmm0    # 0x6aed0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e34d(%rip), %xmm0    # 0x6aed8
addsd 0x1e34d(%rip), %xmm0    # 0x6aee0
movsd %xmm0, -0x38(%rbp)
movsd -0x58(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e33e(%rip), %xmm0    # 0x6aee8
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x48(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e32a(%rip), %xmm0    # 0x6aef0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x80(%rbp), %xmm0
callq 0x8bf0
mulsd 0x1e316(%rip), %xmm0    # 0x6aef8
addsd -0x38(%rbp), %xmm0
mulsd 0x1e091(%rip), %xmm0    # 0x6ac80
callq 0x8160
movsd 0x13cec(%rip), %xmm1    # 0x608e8
divsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
mulsd 0x1e06e(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x40(%rbp)
callq 0x8160
movsd %xmm0, -0x38(%rbp)
movsd -0x40(%rbp), %xmm0
callq 0x8bf0
movsd %xmm0, -0x40(%rbp)
movsd -0x30(%rbp), %xmm0
mulsd 0x1e043(%rip), %xmm0    # 0x6ac80
movsd %xmm0, -0x30(%rbp)
callq 0x8160
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 0x4832e
testq %r13, %r13
je 0x4cd25
movq %r13, (%rsp)
leaq 0x1e37f(%rip), %rdi     # 0x6b07d
pushq $0x1
popq %rdx
pushq $0x3
popq %rcx
movsd 0x12c14(%rip), %xmm0    # 0x5f920
leaq -0x160(%rbp), %r8
leaq -0x110(%rbp), %r9
xorpd %xmm1, %xmm1
movl %ecx, %esi
callq 0x45f19
testq %r15, %r15
je 0x4cd5c
movq %r15, (%rsp)
leaq 0x1e348(%rip), %rdi     # 0x6b07d
pushq $0x1
popq %rdx
pushq $0x3
popq %rcx
movsd 0x12bdd(%rip), %xmm0    # 0x5f920
leaq -0x160(%rbp), %r8
leaq -0xf0(%rbp), %r9
xorpd %xmm1, %xmm1
movl %ecx, %esi
callq 0x45f19
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x4cd74
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