// File: /workspace/github_cpp_makefile_star2_O2/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 0xb4e19(%rip), %xmm2    # 0x1089a0
ucomiss %xmm1, %xmm2
ja 0x53cd6
movl %edi, %ebx
cmpl $0x3e9, %edi            # imm = 0x3E9
ja 0x53cd6
ucomiss 0xa355f(%rip), %xmm1    # 0xf7104
ja 0x53cd6
movl %ebx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x1d53f5(%rip), %rcx    # 0x228fb0
leaq (%rcx,%rax), %r14
movss 0x20c(%rcx,%rax), %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm3
movb $0x20, %al
jne 0x53bd4
jnp 0x53be9
ucomiss %xmm2, %xmm1
jne 0x53bdb
jnp 0x53be9
movb $0x18, %al
ucomiss %xmm3, %xmm1
ja 0x53be9
movb $0x19, %al
ucomiss %xmm1, %xmm3
jbe 0x53bf0
movb %al, 0x210(%r14)
cmpl $0x3e7, %ebx            # imm = 0x3E7
ja 0x53c05
leaq 0x1074c9(%rip), %rax    # 0x15b0c8
cmpl %ebx, (%rax)
jge 0x53c05
movl %ebx, (%rax)
xorps %xmm3, %xmm3
ucomiss %xmm0, %xmm3
movss %xmm1, -0x14(%rbp)
jbe 0x53c2c
pushq $-0xa
popq %rax
movss 0xb4d87(%rip), %xmm2    # 0x1089a4
addss %xmm2, %xmm0
testl %eax, %eax
je 0x53c2c
incl %eax
ucomiss %xmm0, %xmm3
ja 0x53c1d
cvtss2sd %xmm0, %xmm0
movsd 0xb4578(%rip), %xmm1    # 0x1081b0
callq 0x94d0
cvtsd2ss %xmm0, %xmm0
ucomiss 0xb4d5c(%rip), %xmm0    # 0x1089a4
movss -0x14(%rbp), %xmm3
ja 0x53cd6
xorps %xmm2, %xmm2
ucomiss %xmm0, %xmm2
ja 0x53cd6
movss 0x208(%r14), %xmm1
ucomiss %xmm2, %xmm1
movb $0x20, %al
jne 0x53c6d
jnp 0x53c82
ucomiss %xmm2, %xmm0
jne 0x53c74
jnp 0x53c82
movb $0x18, %al
ucomiss %xmm1, %xmm0
ja 0x53c82
movb $0x19, %al
ucomiss %xmm0, %xmm1
jbe 0x53c89
movb %al, 0x211(%r14)
movss %xmm0, 0x208(%r14)
movss %xmm3, 0x20c(%r14)
leaq 0x1aec2e(%rip), %rax    # 0x2028d0
movq (%rax), %rax
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0x53ccc
leaq 0x1b1315(%rip), %rcx    # 0x204fd0
cmpl $0x0, (%rcx)
je 0x53cdf
leaq 0x2a36fd(%rip), %rcx    # 0x2f73c4
cmpl $0x0, (%rcx)
jne 0x53cdf
movl $0x1, 0x3020e6(%rip)    # 0x355dbc
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x2a3cc5(%rip), %rcx    # 0x2f79b4
cmpl $0x0, (%rcx)
setne %cl
andl $0x3fe, %ebx            # imm = 0x3FE
cmpl $0x3e8, %ebx            # imm = 0x3E8
jne 0x53ccc
orb %cl, %al
jne 0x53cd6
jmp 0x53ccc