// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_sky_data(_IO_FILE*)
void log_sky_data(FILE *file)
{
int i;
int sky_shown;

   // write satellite constellation info to the log file

   if(file == 0) return;

   sky_shown = 0;

   for(i=1; i<=SUN_MOON_PRN; i++) {   // mooooo
      if((i == SUN_PRN) && (no_sun_moon & 0x01)) continue;
      if((i == MOON_PRN) && (no_sun_moon & 0x02)) continue;

      if(sat[i].level_msg && ((i == SUN_PRN) || (i == MOON_PRN) || ((sat[i].azimuth >= 0.0) && (sat[i].elevation > 0.0) && (sat[i].tracking > 0)))) {
         if(log_fmt != HEATHER) {
            if(sky_shown == 0) {
               fprintf(file, "        <sky>\n");
               sky_shown = 1;
            }

            fprintf(file, "          <sv prn=\"%d\"", i);
            if     (i < 10)  fprintf(file, "  ");
            else if(i < 100) fprintf(file, " ");

            fprintf(file, "  az=\"%.2f\"", sat[i].azimuth);
            if(sat[i].azimuth < 10.0) fprintf(file, "  ");
            else if(sat[i].azimuth < 100.0) fprintf(file, " ");

            if(0 && (i == SUN_PRN) && (sat[i].sig_level < 0.0)) {
               fprintf(file, "  el=\"%.2f\"", 0.0-sat[i].elevation);
            }
            else if(0 && (i == MOON_PRN) && (sat[i].sig_level < 0.0)) {
               fprintf(file, "  el=\"%.2f\"", 0.0-sat[i].elevation);
            }
            else {
               fprintf(file, "  el=\"%.2f\"", sat[i].elevation);
            }
            if(sat[i].elevation < 10.0) fprintf(file, " ");


            if((i != SUN_PRN) && (i != MOON_PRN)) {
               fprintf(file, "  sig=\"%.2f\"", sat[i].sig_level);
               if(sat[i].sig_level < 10.0) fprintf(file, " ");

               if(have_doppler) {
                  fprintf(file, "  doppler=\"%.3f\"", sat[i].doppler);
                  if     (sat[i].doppler >= 10000.0) fprintf(file, " ");
                  else if(sat[i].doppler >= 1000.0)  fprintf(file, "  ");
                  else if(sat[i].doppler >= 100.0)   fprintf(file, "   ");
                  else if(sat[i].doppler >= 10.0)    fprintf(file, "    ");
                  else if(sat[i].doppler >= 0.0)     fprintf(file, "     ");
                  else if(sat[i].doppler <= -10000.0) ;
                  else if(sat[i].doppler <= -1000.0) fprintf(file, " ");
                  else if(sat[i].doppler <= -100.0)  fprintf(file, "  ");
                  else if(sat[i].doppler <= -10.0)   fprintf(file, "   ");
                  else if(sat[i].doppler <= -0.0)    fprintf(file, "    ");
               }
               if(have_phase) {
                  fprintf(file, "  phase=\"%.3f\"", sat[i].code_phase);
                  if     (sat[i].code_phase >= 100000.0) ;
                  else if(sat[i].code_phase >= 10000.0)  fprintf(file, " ");
                  else if(sat[i].code_phase >= 1000.0)   fprintf(file, "  ");
                  else if(sat[i].code_phase >= 100.0)    fprintf(file, "   ");
                  else if(sat[i].code_phase >= 10.0)     fprintf(file, "   ");
                  else if(sat[i].code_phase >= 0.0)      fprintf(file, "    ");
               }
               if(have_range) {
                  fprintf(file, "  range=\"%.3f\"", sat[i].range);
               }
               if(have_bias) {
                  fprintf(file, "  bias=\"%.10g\"", sat[i].sat_bias);
               }

               if(have_l2_doppler || have_l2_phase || have_l2_range) {
                  fprintf(file, "  l2_sig=\"%.2f\"", sat[i].l2_sig_level);
                  if(sat[i].l2_sig_level < 10.0) fprintf(file, " ");
               }

               if(have_l2_doppler) {
                  fprintf(file, "  l2_doppler=\"%.3f\"", sat[i].l2_doppler);
                  if     (sat[i].l2_doppler >= 10000.0) fprintf(file, " ");
                  else if(sat[i].l2_doppler >= 1000.0)  fprintf(file, "  ");
                  else if(sat[i].l2_doppler >= 100.0)   fprintf(file, "   ");
                  else if(sat[i].l2_doppler >= 10.0)    fprintf(file, "    ");
                  else if(sat[i].l2_doppler >= 0.0)     fprintf(file, "     ");
                  else if(sat[i].l2_doppler <= -10000.0) ;
                  else if(sat[i].l2_doppler <= -1000.0) fprintf(file, " ");
                  else if(sat[i].l2_doppler <= -100.0)  fprintf(file, "  ");
                  else if(sat[i].l2_doppler <= -10.0)   fprintf(file, "   ");
                  else if(sat[i].l2_doppler <= -0.0)    fprintf(file, "    ");
               }
               if(have_l2_phase) {
                  fprintf(file, "  l2_phase=\"%.3f\"", sat[i].l2_code_phase);
                  if     (sat[i].l2_code_phase >= 100000.0) ;
                  else if(sat[i].l2_code_phase >= 10000.0)  fprintf(file, " ");
                  else if(sat[i].l2_code_phase >= 1000.0)   fprintf(file, "  ");
                  else if(sat[i].l2_code_phase >= 100.0)    fprintf(file, "   ");
                  else if(sat[i].l2_code_phase >= 10.0)     fprintf(file, "   ");
                  else if(sat[i].l2_code_phase >= 0.0)      fprintf(file, "    ");
               }
               if(have_l2_range) {
                  fprintf(file, "  l2_range=\"%.3f\"", sat[i].l2_range);
               }
               if(have_bias) {
                  fprintf(file, "  bias=\"%.10g\"", sat[i].sat_bias);
               }
            }

            fprintf(file, "> </sv>\n");
         }
         else if(i == SUN_PRN) {
            if(0 && (sat[i].sig_level < 0.0)) {
               fprintf(file, "#SUN  %04d  %5.1f  %-4.1f  %5.1f", 
                 i, sat[i].azimuth, 0.0-sat[i].elevation, sat[i].sig_level);
            }
            else {
               fprintf(file, "#SUN  %04d  %5.1f  %-4.1f  %5.1f", 
                 i, sat[i].azimuth, sat[i].elevation, sat[i].sig_level);
            }
            fprintf(file, "\n");
         }
         else if(i == MOON_PRN) {
            if(0 && (sat[i].sig_level < 0.0)) {
               fprintf(file, "#MOON %04d  %5.1f  %-4.1f  %5.1f", 
                 i, sat[i].azimuth, 0.0-sat[i].elevation, sat[i].sig_level);
            }
            else {
               fprintf(file, "#MOON %04d  %5.1f  %-4.1f  %5.1f", 
                 i, sat[i].azimuth, sat[i].elevation, sat[i].sig_level);
            }
            fprintf(file, "\n");
         }
         else {
            fprintf(file, "#SIG %02d  %5.1f  %-4.1f  %5.1f", 
              i, sat[i].azimuth, sat[i].elevation, sat[i].sig_level);
            if(have_doppler || have_phase || have_range || have_bias) {
               fprintf(file, "  %10.3f  %13.3f  %12.3f  %.10g", sat[i].doppler, sat[i].code_phase, sat[i].range, sat[i].sat_bias);
            }
            fprintf(file, "\n");
         }
      }
   }

   if(sky_shown) {
      fprintf(file, "        </sky>\n");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xc7841
movq %rdi, %rbx
movl $0x364, %r13d           # imm = 0x364
addq 0x88efc(%rip), %r13     # 0x14ff40
movl $0x1, %r14d
leaq 0xa9c17(%rip), %r12     # 0x170c68
xorps %xmm1, %xmm1
xorl %r15d, %r15d
cmpq $0x3e8, %r14            # imm = 0x3E8
jne 0xc706b
testb $0x1, (%r12)
jne 0xc77d0
cmpq $0x3e9, %r14            # imm = 0x3E9
jne 0xc707f
testb $0x2, (%r12)
jne 0xc77d0
cmpl $0x0, (%r13)
je 0xc77d0
movl %r14d, %eax
andl $0x3fe, %eax            # imm = 0x3FE
cmpl $0x3e8, %eax            # imm = 0x3E8
jne 0xc7103
leaq 0x1773a8(%rip), %rax    # 0x23e448
cmpl $0x0, (%rax)
je 0xc713a
testl %r15d, %r15d
jne 0xc70c7
movl $0xe, %esi
movl $0x1, %edx
leaq 0x67cd1(%rip), %rdi     # 0x12ed90
movq %rbx, %rcx
callq 0x9750
movq %rbx, %rdi
leaq 0x67cce(%rip), %rsi     # 0x12ed9f
movl %r14d, %edx
xorl %eax, %eax
callq 0x9560
cmpq $0x9, %r14
ja 0xc717c
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b97d(%rip), %rdi     # 0x122a73
movq %rbx, %rcx
callq 0x9750
jmp 0xc718f
movss 0x1ec(%r13), %xmm0
ucomiss %xmm1, %xmm0
jb 0xc77d0
movss 0x1f0(%r13), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xc77d0
cmpl $0x0, 0x1fc(%r13)
jg 0xc7099
jmp 0xc77d0
xorps %xmm0, %xmm0
cvtss2sd 0x1ec(%r13), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x1f0(%r13), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x4(%r13), %xmm2
movq %rbx, %rdi
cmpq $0x3e8, %r14            # imm = 0x3E8
jne 0xc734d
leaq 0x67cf8(%rip), %rsi     # 0x12ee6a
movl $0x3e8, %edx            # imm = 0x3E8
jmp 0xc7362
cmpq $0x63, %r14
ja 0xc718f
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
xorps %xmm0, %xmm0
cvtss2sd 0x1ec(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67c11(%rip), %rsi     # 0x12edb6
movb $0x1, %al
callq 0x9560
movss 0x1ec(%r13), %xmm0
movss 0x45e23(%rip), %xmm1    # 0x10cfe0
ucomiss %xmm0, %xmm1
jbe 0xc71dd
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b8a0(%rip), %rdi     # 0x122a73
movq %rbx, %rcx
callq 0x9750
jmp 0xc71f7
movss 0x45df3(%rip), %xmm1    # 0x10cfd8
ucomiss %xmm0, %xmm1
jbe 0xc71f7
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
xorps %xmm0, %xmm0
cvtss2sd 0x1f0(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67bb5(%rip), %rsi     # 0x12edc2
movb $0x1, %al
callq 0x9560
movss 0x45dc4(%rip), %xmm0    # 0x10cfe0
ucomiss 0x1f0(%r13), %xmm0
jbe 0xc7233
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
cmpq $0x3e7, %r14            # imm = 0x3E7
ja 0xc77ae
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67b7b(%rip), %rsi     # 0x12edce
movb $0x1, %al
callq 0x9560
movss 0x45d7e(%rip), %xmm0    # 0x10cfe0
ucomiss 0x4(%r13), %xmm0
jbe 0xc7276
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
leaq 0x2460c3(%rip), %rax    # 0x30d340
cmpl $0x0, (%rax)
je 0xc742e
movsd 0x14(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67b45(%rip), %rsi     # 0x12eddb
movb $0x1, %al
callq 0x9560
movsd 0x14(%r13), %xmm0
ucomisd 0x41e2d(%rip), %xmm0    # 0x1090d8
jae 0xc737b
ucomisd 0x41d7f(%rip), %xmm0    # 0x109038
jae 0xc7402
ucomisd 0x41d99(%rip), %xmm0    # 0x109060
jae 0xc7415
ucomisd 0x41dd3(%rip), %xmm0    # 0x1090a8
jae 0xc7337
ucomisd 0x41e39(%rip), %xmm0    # 0x109118
jae 0xc77e9
movsd 0x41de3(%rip), %xmm1    # 0x1090d0
ucomisd %xmm0, %xmm1
jae 0xc742e
movsd 0x41de1(%rip), %xmm1    # 0x1090e0
ucomisd %xmm0, %xmm1
jae 0xc737b
movsd 0x41ddb(%rip), %xmm1    # 0x1090e8
ucomisd %xmm0, %xmm1
jae 0xc7402
movsd 0x41dd1(%rip), %xmm1    # 0x1090f0
ucomisd %xmm0, %xmm1
jae 0xc7415
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xc742e
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b729(%rip), %rdi     # 0x122a71
jmp 0xc7426
cmpq $0x3e9, %r14            # imm = 0x3E9
jne 0xc738d
leaq 0x67b2e(%rip), %rsi     # 0x12ee8b
movl $0x3e9, %edx            # imm = 0x3E9
movb $0x3, %al
callq 0x9560
movl $0xa, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc77cd
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc742e
leaq 0x67b18(%rip), %rsi     # 0x12eeac
movl %r14d, %edx
movb $0x3, %al
callq 0x9560
leaq 0x245f9b(%rip), %rax    # 0x30d340
cmpl $0x0, (%rax)
jne 0xc73ce
leaq 0x245f93(%rip), %rax    # 0x30d344
cmpl $0x0, (%rax)
jne 0xc73ce
leaq 0x245f8b(%rip), %rax    # 0x30d348
cmpl $0x0, (%rax)
jne 0xc73ce
leaq 0x245ff3(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc7369
movsd 0xc(%r13), %xmm1
movsd 0x14(%r13), %xmm0
movsd 0x1c(%r13), %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x21c(%r13), %xmm3
movq %rbx, %rdi
leaq 0x67ad6(%rip), %rsi     # 0x12eecc
movb $0x4, %al
callq 0x9560
jmp 0xc7369
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b660(%rip), %rdi     # 0x122a73
jmp 0xc7426
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b64c(%rip), %rdi     # 0x122a72
movq %rbx, %rcx
callq 0x9750
leaq 0x245f0f(%rip), %rax    # 0x30d344
cmpl $0x0, (%rax)
je 0xc74e9
movsd 0xc(%r13), %xmm0
movq %rbx, %rdi
leaq 0x6799e(%rip), %rsi     # 0x12edec
movb $0x1, %al
callq 0x9560
movsd 0xc(%r13), %xmm0
ucomisd 0x41c65(%rip), %xmm0    # 0x1090c8
jae 0xc74e9
ucomisd 0x41c67(%rip), %xmm0    # 0x1090d8
jae 0xc74ae
ucomisd 0x41bbd(%rip), %xmm0    # 0x109038
jae 0xc74bd
ucomisd 0x41bdb(%rip), %xmm0    # 0x109060
jae 0xc74d0
ucomisd 0x41c19(%rip), %xmm0    # 0x1090a8
jae 0xc74d0
ucomisd 0x41c7f(%rip), %xmm0    # 0x109118
jb 0xc74e9
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b5c5(%rip), %rdi     # 0x122a71
jmp 0xc74e1
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc74e9
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b5a5(%rip), %rdi     # 0x122a73
jmp 0xc74e1
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b591(%rip), %rdi     # 0x122a72
movq %rbx, %rcx
callq 0x9750
leaq 0x245e58(%rip), %rax    # 0x30d348
cmpl $0x0, (%rax)
je 0xc750c
movsd 0x1c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x678f6(%rip), %rsi     # 0x12edfb
movb $0x1, %al
callq 0x9560
leaq 0x245ea9(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc7535
xorps %xmm0, %xmm0
cvtss2sd 0x21c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x678dc(%rip), %rsi     # 0x12ee0a
movb $0x1, %al
callq 0x9560
leaq 0x245e24(%rip), %rax    # 0x30d360
cmpl $0x0, (%rax)
jne 0xc7559
leaq 0x245e1c(%rip), %rax    # 0x30d364
cmpl $0x0, (%rax)
jne 0xc7559
leaq 0x245e14(%rip), %rax    # 0x30d368
cmpl $0x0, (%rax)
je 0xc7595
xorps %xmm0, %xmm0
cvtss2sd 0x94(%r13), %xmm0
movq %rbx, %rdi
leaq 0x678aa(%rip), %rsi     # 0x12ee19
movb $0x1, %al
callq 0x9560
movss 0x45a62(%rip), %xmm0    # 0x10cfe0
ucomiss 0x94(%r13), %xmm0
jbe 0xc7595
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
leaq 0x245dc4(%rip), %rax    # 0x30d360
cmpl $0x0, (%rax)
je 0xc769e
movsd 0xa4(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67871(%rip), %rsi     # 0x12ee29
movb $0x1, %al
callq 0x9560
movsd 0xa4(%r13), %xmm0
ucomisd 0x41b08(%rip), %xmm0    # 0x1090d8
jae 0xc7663
ucomisd 0x41a5a(%rip), %xmm0    # 0x109038
jae 0xc7672
ucomisd 0x41a74(%rip), %xmm0    # 0x109060
jae 0xc7685
ucomisd 0x41aae(%rip), %xmm0    # 0x1090a8
jae 0xc7650
ucomisd 0x41b14(%rip), %xmm0    # 0x109118
jae 0xc77ff
movsd 0x41abe(%rip), %xmm1    # 0x1090d0
ucomisd %xmm0, %xmm1
jae 0xc769e
movsd 0x41abc(%rip), %xmm1    # 0x1090e0
ucomisd %xmm0, %xmm1
jae 0xc7663
movsd 0x41ab6(%rip), %xmm1    # 0x1090e8
ucomisd %xmm0, %xmm1
jae 0xc7672
movsd 0x41ab0(%rip), %xmm1    # 0x1090f0
ucomisd %xmm0, %xmm1
jae 0xc7685
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xc769e
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b410(%rip), %rdi     # 0x122a71
jmp 0xc7696
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc769e
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b3f0(%rip), %rdi     # 0x122a73
jmp 0xc7696
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b3dc(%rip), %rdi     # 0x122a72
movq %rbx, %rcx
callq 0x9750
leaq 0x245cbf(%rip), %rax    # 0x30d364
cmpl $0x0, (%rax)
je 0xc775f
movsd 0x9c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x6777c(%rip), %rsi     # 0x12ee3d
movb $0x1, %al
callq 0x9560
movsd 0x9c(%r13), %xmm0
ucomisd 0x419ef(%rip), %xmm0    # 0x1090c8
jae 0xc775f
ucomisd 0x419f1(%rip), %xmm0    # 0x1090d8
jae 0xc7724
ucomisd 0x41947(%rip), %xmm0    # 0x109038
jae 0xc7733
ucomisd 0x41965(%rip), %xmm0    # 0x109060
jae 0xc7746
ucomisd 0x419a3(%rip), %xmm0    # 0x1090a8
jae 0xc7746
ucomisd 0x41a09(%rip), %xmm0    # 0x109118
jb 0xc775f
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b34f(%rip), %rdi     # 0x122a71
jmp 0xc7757
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc775f
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b32f(%rip), %rdi     # 0x122a73
jmp 0xc7757
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b31b(%rip), %rdi     # 0x122a72
movq %rbx, %rcx
callq 0x9750
leaq 0x245c02(%rip), %rax    # 0x30d368
cmpl $0x0, (%rax)
je 0xc7785
movsd 0xac(%r13), %xmm0
movq %rbx, %rdi
leaq 0x676d1(%rip), %rsi     # 0x12ee4f
movb $0x1, %al
callq 0x9560
leaq 0x245c30(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc77ae
xorps %xmm0, %xmm0
cvtss2sd 0x21c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67663(%rip), %rsi     # 0x12ee0a
movb $0x1, %al
callq 0x9560
movl $0x8, %esi
movl $0x1, %edx
leaq 0x676a2(%rip), %rdi     # 0x12ee61
movq %rbx, %rcx
callq 0x9750
movl $0x1, %r15d
xorps %xmm1, %xmm1
incq %r14
addq $0x348, %r13            # imm = 0x348
cmpq $0x3ea, %r14            # imm = 0x3EA
jne 0xc7057
jmp 0xc7815
movl $0x5, %esi
movl $0x1, %edx
leaq 0x5b276(%rip), %rdi     # 0x122a70
jmp 0xc7426
movl $0x5, %esi
movl $0x1, %edx
leaq 0x5b260(%rip), %rdi     # 0x122a70
jmp 0xc7696
testl %r15d, %r15d
je 0xc7841
leaq 0x676cb(%rip), %rdi     # 0x12eeec
movl $0xf, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9750
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq