// File: /workspace/github_cpp_makefile_star2_O1/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 0xc3bcd(%rip), %xmm2    # 0x11e978
ucomiss %xmm1, %xmm2
ja 0x5aefc
movl %edi, %ebx
cmpl $0x3e9, %edi            # imm = 0x3E9
ja 0x5aefc
ucomiss 0xb2227(%rip), %xmm1    # 0x10cff0
ja 0x5aefc
movl %ebx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x1e41d1(%rip), %rcx    # 0x23efb0
leaq (%rcx,%rax), %r14
movss 0x20c(%rcx,%rax), %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm3
movb $0x20, %al
jne 0x5adf8
jnp 0x5ae0d
ucomiss %xmm2, %xmm1
jne 0x5adff
jnp 0x5ae0d
movb $0x18, %al
ucomiss %xmm3, %xmm1
ja 0x5ae0d
movb $0x19, %al
ucomiss %xmm1, %xmm3
jbe 0x5ae14
movb %al, 0x210(%r14)
cmpl $0x3e7, %ebx            # imm = 0x3E7
jg 0x5ae29
leaq 0x1162a5(%rip), %rax    # 0x1710c8
cmpl %ebx, (%rax)
jge 0x5ae29
movl %ebx, (%rax)
xorps %xmm3, %xmm3
ucomiss %xmm0, %xmm3
movss %xmm1, -0x14(%rbp)
jbe 0x5ae52
movl $0xfffffff6, %eax       # imm = 0xFFFFFFF6
movss 0xc3b39(%rip), %xmm2    # 0x11e97c
addss %xmm2, %xmm0
testl %eax, %eax
je 0x5ae52
incl %eax
ucomiss %xmm0, %xmm3
ja 0x5ae43
cvtss2sd %xmm0, %xmm0
movsd 0xc3232(%rip), %xmm1    # 0x11e090
callq 0x94d0
cvtsd2ss %xmm0, %xmm0
ucomiss 0xc3b0e(%rip), %xmm0    # 0x11e97c
movss -0x14(%rbp), %xmm3
ja 0x5aefc
xorps %xmm2, %xmm2
ucomiss %xmm0, %xmm2
ja 0x5aefc
movss 0x208(%r14), %xmm1
ucomiss %xmm2, %xmm1
movb $0x20, %al
jne 0x5ae93
jnp 0x5aea8
ucomiss %xmm2, %xmm0
jne 0x5ae9a
jnp 0x5aea8
movb $0x18, %al
ucomiss %xmm1, %xmm0
ja 0x5aea8
movb $0x19, %al
ucomiss %xmm0, %xmm1
jbe 0x5aeaf
movb %al, 0x211(%r14)
movss %xmm0, 0x208(%r14)
movss %xmm3, 0x20c(%r14)
leaq 0x1bda08(%rip), %rax    # 0x2188d0
movq (%rax), %rax
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0x5aef2
leaq 0x1c00ef(%rip), %rcx    # 0x21afd0
cmpl $0x0, (%rcx)
je 0x5af05
leaq 0x2b24d7(%rip), %rcx    # 0x30d3c4
cmpl $0x0, (%rcx)
jne 0x5af05
movl $0x1, 0x310ec0(%rip)    # 0x36bdbc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x2b2a9f(%rip), %rcx    # 0x30d9b4
cmpl $0x0, (%rcx)
setne %cl
andl $0x3fe, %ebx            # imm = 0x3FE
cmpl $0x3e8, %ebx            # imm = 0x3E8
jne 0x5aef2
orb %cl, %al
jne 0x5aefc
jmp 0x5aef2