// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_sun_posn()
void log_sun_posn()
{
   // record the position of the sun (as satellite PRN 1000)

   sunrise = sunset = 0;
   if(have_sun_el == 0) ;
   else if((last_sun_el < 0.0) && (sun_el >= 0.0)) sunrise = 1;
   else if((last_sun_el >= 0.0) && (sun_el < 0.0)) sunset = 1;
   last_sun_el = sun_el;

   sat[SUN_PRN].level_msg = 1;
   sat[SUN_PRN].sig_level = (-1.0);
   sat[SUN_PRN].azimuth = (float) sun_az;
   if(sun_el >= 0.0) {
      sat[SUN_PRN].elevation = (float) sun_el;
      sat[SUN_PRN].sig_level = (40.0F);
      sat[SUN_PRN].tracking = 1;
   }
   else {
      sat[SUN_PRN].elevation = 0.0F - (float) sun_el;
      sat[SUN_PRN].sig_level = (-40.0F);
      sat[SUN_PRN].tracking = 0;
   }
sat[SUN_PRN].elevation = (float) sun_el;
   if(sat[SUN_PRN].elevation > 90.0) sat[SUN_PRN].elevation = 90.0;
   if(sat[SUN_PRN].elevation < -90.0) sat[SUN_PRN].elevation = -90.0;
   if(sat[SUN_PRN].azimuth > 360.0) sat[SUN_PRN].azimuth -= 360.0;


   sat[MOON_PRN].level_msg = 1;
   sat[MOON_PRN].sig_level = (-1.0);
   sat[MOON_PRN].azimuth = (float) moon_az;
   if(moon_el >= 0.0) {
      sat[MOON_PRN].elevation = (float) moon_el;
      sat[MOON_PRN].sig_level = (40.0F);
      sat[MOON_PRN].tracking = 1;
   }
   else {
      sat[MOON_PRN].elevation = 0.0F - (float) moon_el;
      sat[MOON_PRN].sig_level = (-40.0F);
      sat[MOON_PRN].tracking = 0;
   }

sat[MOON_PRN].elevation = (float) moon_el;
   if(sat[MOON_PRN].elevation > 90.0) sat[MOON_PRN].elevation = 90.0;
   if(sat[MOON_PRN].elevation < -90.0) sat[MOON_PRN].elevation = -90.0;
   if(sat[MOON_PRN].azimuth > 360.0) sat[MOON_PRN].azimuth -= 360.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movl %eax, 0x2853b9(%rip)    # 0x379d70
movl %eax, 0x2853b7(%rip)    # 0x379d74
leaq 0x218e04(%rip), %rcx    # 0x30d7c8
cmpl %eax, (%rcx)
je 0xf4a14
leaq 0x218df1(%rip), %rax    # 0x30d7c0
movsd (%rax), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
leaq 0x218dd6(%rip), %rax    # 0x30d7b8
movsd (%rax), %xmm0
jbe 0xf49f7
ucomisd %xmm2, %xmm0
jb 0xf49f7
leaq 0x28537f(%rip), %rax    # 0x379d74
jmp 0xf4a0e
ucomisd %xmm2, %xmm1
jb 0xf4a14
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0xf4a14
leaq 0x285362(%rip), %rax    # 0x379d70
movl $0x1, (%rax)
leaq 0x218d9d(%rip), %rax    # 0x30d7b8
movsd (%rax), %xmm1
leaq 0x218d9a(%rip), %rax    # 0x30d7c0
movsd %xmm1, (%rax)
leaq 0x218d9f(%rip), %rax    # 0x30d7d0
cvtsd2ss (%rax), %xmm3
leaq 0x14a574(%rip), %rax    # 0x23efb0
movl $0x1, 0xcd15c(%rax)
movss %xmm3, 0xcd348(%rax)
xorpd %xmm0, %xmm0
xorl %edx, %edx
ucomisd %xmm0, %xmm1
setae %dl
xorps %xmm2, %xmm2
cvtsd2ss %xmm1, %xmm2
leaq 0x37c07(%rip), %rcx     # 0x12c670
movss (%rcx,%rdx,4), %xmm1
movss %xmm1, 0xcd160(%rax)
movl %edx, 0xcd358(%rax)
movss 0x1856c(%rip), %xmm1    # 0x10cff0
movaps %xmm1, %xmm4
minss %xmm2, %xmm4
movss 0x29ee5(%rip), %xmm2    # 0x11e978
movaps %xmm2, %xmm5
maxss %xmm4, %xmm5
movss %xmm5, 0xcd34c(%rax)
ucomiss 0x29ed3(%rip), %xmm3    # 0x11e97c
jbe 0xf4abb
addss 0x37c49(%rip), %xmm3    # 0x12c6fc
movss %xmm3, 0xcd348(%rax)
leaq 0x218d26(%rip), %rdx    # 0x30d7e8
xorps %xmm3, %xmm3
cvtsd2ss (%rdx), %xmm3
movl $0x1, 0xcd4a4(%rax)
movss %xmm3, 0xcd690(%rax)
leaq 0x218d0e(%rip), %rdx    # 0x30d7f0
movsd (%rdx), %xmm4
xorl %edx, %edx
ucomisd %xmm0, %xmm4
setae %dl
xorps %xmm0, %xmm0
cvtsd2ss %xmm4, %xmm0
movss (%rcx,%rdx,4), %xmm4
movss %xmm4, 0xcd4a8(%rax)
movl %edx, 0xcd6a0(%rax)
minss %xmm0, %xmm1
maxss %xmm1, %xmm2
movss %xmm2, 0xcd694(%rax)
ucomiss 0x29e5c(%rip), %xmm3    # 0x11e97c
jbe 0xf4b32
addss 0x37bd2(%rip), %xmm3    # 0x12c6fc
movss %xmm3, 0xcd690(%rax)
popq %rbp
retq