// File: 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
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movss %xmm0, -0x8(%rbp)
movss %xmm1, -0xc(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x7d470
jmp 0x7d83c
cmpl $0x3e9, -0x4(%rbp)      # imm = 0x3E9
jle 0x7d47e
jmp 0x7d83c
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0xf1bf9(%rip), %xmm1    # 0x16f088
ucomisd %xmm1, %xmm0
jbe 0x7d49a
jmp 0x7d83c
movss 0x105e5e(%rip), %xmm0   # 0x183300
ucomiss -0xc(%rbp), %xmm0
jbe 0x7d4ad
jmp 0x7d83c
jmp 0x7d4af
movslq -0x4(%rbp), %rcx
leaq 0x220cd6(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x20c(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7d4fc
jp 0x7d4fc
movslq -0x4(%rbp), %rcx
leaq 0x220caa(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x20, 0x210(%rax)
jmp 0x7d5bb
movss -0xc(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7d531
jp 0x7d531
movslq -0x4(%rbp), %rcx
leaq 0x220c75(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x20, 0x210(%rax)
jmp 0x7d5b9
movss -0xc(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x220c4f(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
ucomiss 0x20c(%rax), %xmm0
jbe 0x7d572
movslq -0x4(%rbp), %rcx
leaq 0x220c31(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x18, 0x210(%rax)
jmp 0x7d5b7
movss -0xc(%rbp), %xmm1
movslq -0x4(%rbp), %rcx
leaq 0x220c0e(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x20c(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x7d5b5
movslq -0x4(%rbp), %rcx
leaq 0x220bec(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x19, 0x210(%rax)
jmp 0x7d5b7
jmp 0x7d5b9
jmp 0x7d5bb
cmpl $0x3e8, -0x4(%rbp)      # imm = 0x3E8
jge 0x7d5e0
movl -0x4(%rbp), %eax
leaq 0x152cda(%rip), %rcx    # 0x1d02a8
cmpl (%rcx), %eax
jle 0x7d5de
movl -0x4(%rbp), %ecx
leaq 0x152ccc(%rip), %rax    # 0x1d02a8
movl %ecx, (%rax)
jmp 0x7d5e0
movl $0xa, -0x10(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x8(%rbp), %xmm0
jbe 0x7d614
movss 0x105d0c(%rip), %xmm0   # 0x183304
addss -0x8(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, %eax
jge 0x7d612
jmp 0x7d614
jmp 0x7d5e7
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x10550b(%rip), %xmm1   # 0x182b30
callq 0x94d0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x8(%rbp)
movss -0x8(%rbp), %xmm0
movss 0x105cc4(%rip), %xmm1   # 0x183304
ucomiss %xmm1, %xmm0
jbe 0x7d64a
jmp 0x7d83c
xorps %xmm0, %xmm0
ucomiss -0x8(%rbp), %xmm0
jbe 0x7d658
jmp 0x7d83c
jmp 0x7d65a
movslq -0x4(%rbp), %rcx
leaq 0x220b2b(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x208(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7d6a7
jp 0x7d6a7
movslq -0x4(%rbp), %rcx
leaq 0x220aff(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x20, 0x211(%rax)
jmp 0x7d766
movss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7d6dc
jp 0x7d6dc
movslq -0x4(%rbp), %rcx
leaq 0x220aca(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x20, 0x211(%rax)
jmp 0x7d764
movss -0x8(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x220aa4(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
ucomiss 0x208(%rax), %xmm0
jbe 0x7d71d
movslq -0x4(%rbp), %rcx
leaq 0x220a86(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x18, 0x211(%rax)
jmp 0x7d762
movss -0x8(%rbp), %xmm1
movslq -0x4(%rbp), %rcx
leaq 0x220a63(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x208(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x7d760
movslq -0x4(%rbp), %rcx
leaq 0x220a41(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movb $0x19, 0x211(%rax)
jmp 0x7d762
jmp 0x7d764
jmp 0x7d766
movss -0x8(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x220a1a(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x208(%rax)
movss -0xc(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x2209f8(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20c(%rax)
leaq 0x1fa2ff(%rip), %rax    # 0x277ab0
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
andq (%rax), %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, -0x11(%rbp)
jne 0x7d811
leaq 0x1fc9e0(%rip), %rax    # 0x27a1b0
cmpl $0x0, (%rax)
je 0x7d7e6
movb $0x1, %al
leaq 0x2eedc6(%rip), %rcx    # 0x36c5a4
cmpl $0x0, (%rcx)
movb %al, -0x11(%rbp)
je 0x7d811
xorl %eax, %eax
leaq 0x1fa2c1(%rip), %rcx    # 0x277ab0
cmpq $0x400000, (%rcx)       # imm = 0x400000
movb %al, -0x12(%rbp)
jne 0x7d80b
leaq 0x2ef392(%rip), %rax    # 0x36cb94
cmpl $0x0, (%rax)
sete %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x7d832
cmpl $0x3e8, -0x4(%rbp)      # imm = 0x3E8
je 0x7d830
cmpl $0x3e9, -0x4(%rbp)      # imm = 0x3E9
jne 0x7d832
jmp 0x7d83c
movl $0x1, 0x34d760(%rip)    # 0x3caf9c
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)