// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_sat_azel(int, float, float)
void set_sat_azel(int prn, float az, float elev)
{
int count;

   // record the current elevation of sat PRN "prn" and flag how its elevation
   // if changing

   if(prn < 0) return;
   if(prn > MOON_PRN) return;

   // range check az, el
   if(elev > 90.0) return;  //elev = 90.0F;
   else if(elev < (-90.0F)) return; //elev = (-90.0F);

   if(sat[prn].elevation == 0.0) sat[prn].el_dir = ' ';
   else if(elev == 0.0) sat[prn].el_dir = ' ';
   else if(elev > sat[prn].elevation) sat[prn].el_dir = UP_ARROW;
   else if(elev < sat[prn].elevation) sat[prn].el_dir = DOWN_ARROW;

   if(prn < SUN_PRN) {
      if(prn > max_sat_prn) max_sat_prn = prn;
   }

   count = 10;
   while(az < 0.0F) {
      az += 360.0F;
      if(--count < 0) break;
   }
   az = (float) fmod((double) az, 360.0);
   if(az > 360.0F) return; // az = 0.0F;
   else if(az < 0.0F) return; //az = (0.0F);

   if(sat[prn].azimuth == 0.0) sat[prn].az_dir = ' ';
   else if(az == 0.0) sat[prn].az_dir = ' ';
   else if(az > sat[prn].azimuth) sat[prn].az_dir = UP_ARROW;
   else if(az < sat[prn].azimuth) sat[prn].az_dir = DOWN_ARROW;

   sat[prn].azimuth = az;
   sat[prn].elevation = elev;

   if(1 && (NO_SATS == 0) && ((prn == SUN_PRN) || (prn == MOON_PRN))) ;  // only write whan sats change
   else new_sat_azel = 1;  // update PRN file if open
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss 0xc3d34(%rip), %xmm2    # 0x11ea28
ucomiss %xmm1, %xmm2
ja 0x5ae45
movl %edi, %ebx
cmpl $0x3e9, %edi            # imm = 0x3E9
ja 0x5ae45
ucomiss 0xb2372(%rip), %xmm1    # 0x10d084
ja 0x5ae45
movl %ebx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x1e4288(%rip), %rcx    # 0x23efb0
leaq (%rcx,%rax), %r14
movss 0x20c(%rcx,%rax), %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm3
movb $0x20, %al
jne 0x5ad41
jnp 0x5ad56
ucomiss %xmm2, %xmm1
jne 0x5ad48
jnp 0x5ad56
movb $0x18, %al
ucomiss %xmm3, %xmm1
ja 0x5ad56
movb $0x19, %al
ucomiss %xmm1, %xmm3
jbe 0x5ad5d
movb %al, 0x210(%r14)
cmpl $0x3e7, %ebx            # imm = 0x3E7
ja 0x5ad72
leaq 0x11635c(%rip), %rax    # 0x1710c8
cmpl %ebx, (%rax)
jge 0x5ad72
movl %ebx, (%rax)
xorps %xmm3, %xmm3
ucomiss %xmm0, %xmm3
movss %xmm1, -0x14(%rbp)
jbe 0x5ad9b
movl $0xfffffff6, %eax       # imm = 0xFFFFFFF6
movss 0xc3ca0(%rip), %xmm2    # 0x11ea2c
addss %xmm2, %xmm0
testl %eax, %eax
je 0x5ad9b
incl %eax
ucomiss %xmm0, %xmm3
ja 0x5ad8c
cvtss2sd %xmm0, %xmm0
movsd 0xc3391(%rip), %xmm1    # 0x11e138
callq 0x94d0
cvtsd2ss %xmm0, %xmm0
ucomiss 0xc3c75(%rip), %xmm0    # 0x11ea2c
movss -0x14(%rbp), %xmm3
ja 0x5ae45
xorps %xmm2, %xmm2
ucomiss %xmm0, %xmm2
ja 0x5ae45
movss 0x208(%r14), %xmm1
ucomiss %xmm2, %xmm1
movb $0x20, %al
jne 0x5addc
jnp 0x5adf1
ucomiss %xmm2, %xmm0
jne 0x5ade3
jnp 0x5adf1
movb $0x18, %al
ucomiss %xmm1, %xmm0
ja 0x5adf1
movb $0x19, %al
ucomiss %xmm0, %xmm1
jbe 0x5adf8
movb %al, 0x211(%r14)
movss %xmm0, 0x208(%r14)
movss %xmm3, 0x20c(%r14)
leaq 0x1bdabf(%rip), %rax    # 0x2188d0
movq (%rax), %rax
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0x5ae3b
leaq 0x1c01a6(%rip), %rcx    # 0x21afd0
cmpl $0x0, (%rcx)
je 0x5ae4e
leaq 0x2b258e(%rip), %rcx    # 0x30d3c4
cmpl $0x0, (%rcx)
jne 0x5ae4e
movl $0x1, 0x310f77(%rip)    # 0x36bdbc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x2b2b56(%rip), %rcx    # 0x30d9b4
cmpl $0x0, (%rcx)
setne %cl
andl $0x3fe, %ebx            # imm = 0x3FE
cmpl $0x3e8, %ebx            # imm = 0x3E8
jne 0x5ae3b
orb %cl, %al
jne 0x5ae45
jmp 0x5ae3b