// File: /workspace/github_cpp_makefile_star2_O3/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 0xc7e91
movq %rdi, %rbx
movl $0x364, %r13d           # imm = 0x364
addq 0x888b3(%rip), %r13     # 0x14ff40
leaq 0xa95d4(%rip), %rsi     # 0x170c68
xorps %xmm1, %xmm1
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %r12, %rax
incq %r12
cmpq $0x3e7, %rax            # imm = 0x3E7
jne 0xc76b5
testb $0x1, (%rsi)
je 0xc76c9
jmp 0xc7e23
cmpq $0x3e8, %rax            # imm = 0x3E8
jne 0xc76c9
movb $0x1, %cl
testb $0x2, (%rsi)
je 0xc76cb
jmp 0xc7e65
xorl %ecx, %ecx
cmpl $0x0, (%r13)
je 0xc7e23
leaq 0x1(%rax), %r14
movl %r14d, %edx
andl $0x3fe, %edx            # imm = 0x3FE
cmpl $0x3e8, %edx            # imm = 0x3E8
jne 0xc7755
leaq 0x176d56(%rip), %rdx    # 0x23e448
cmpl $0x0, (%rdx)
je 0xc778c
testl %r15d, %r15d
jne 0xc7719
movl $0xe, %esi
movl $0x1, %edx
leaq 0x6776f(%rip), %rdi     # 0x12ee80
movq %rbx, %rcx
callq 0x9750
movq %rbx, %rdi
leaq 0x6776c(%rip), %rsi     # 0x12ee8f
movl %r14d, %edx
xorl %eax, %eax
callq 0x9560
cmpq $0x9, %r12
ja 0xc77cd
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b40b(%rip), %rdi     # 0x122b53
movq %rbx, %rcx
callq 0x9750
jmp 0xc77e0
movss 0x1ec(%r13), %xmm0
ucomiss %xmm1, %xmm0
jb 0xc7e23
movss 0x1f0(%r13), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xc7e23
cmpl $0x0, 0x1fc(%r13)
jg 0xc76eb
jmp 0xc7e23
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 $0x3e7, %rax            # imm = 0x3E7
jne 0xc799e
leaq 0x67797(%rip), %rsi     # 0x12ef5a
movl $0x3e8, %edx            # imm = 0x3E8
jmp 0xc79ae
cmpq $0x63, %r12
ja 0xc77e0
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
xorps %xmm0, %xmm0
cvtss2sd 0x1ec(%r13), %xmm0
movq %rbx, %rdi
leaq 0x676b0(%rip), %rsi     # 0x12eea6
movb $0x1, %al
callq 0x9560
movss 0x1ec(%r13), %xmm0
movss 0x45842(%rip), %xmm1    # 0x10d050
ucomiss %xmm0, %xmm1
jbe 0xc782e
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b32f(%rip), %rdi     # 0x122b53
movq %rbx, %rcx
callq 0x9750
jmp 0xc7848
movss 0x4583a(%rip), %xmm1    # 0x10d070
ucomiss %xmm0, %xmm1
jbe 0xc7848
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
xorps %xmm0, %xmm0
cvtss2sd 0x1f0(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67654(%rip), %rsi     # 0x12eeb2
movb $0x1, %al
callq 0x9560
movss 0x457e3(%rip), %xmm0    # 0x10d050
ucomiss 0x1f0(%r13), %xmm0
jbe 0xc7884
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
cmpq $0x3e7, %r12            # imm = 0x3E7
ja 0xc7dfa
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r13), %xmm0
movq %rbx, %rdi
leaq 0x6761a(%rip), %rsi     # 0x12eebe
movb $0x1, %al
callq 0x9560
movss 0x4579d(%rip), %xmm0    # 0x10d050
ucomiss 0x4(%r13), %xmm0
jbe 0xc78c7
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
leaq 0x245a72(%rip), %rax    # 0x30d340
cmpl $0x0, (%rax)
je 0xc7a7a
movsd 0x14(%r13), %xmm0
movq %rbx, %rdi
leaq 0x675e4(%rip), %rsi     # 0x12eecb
movb $0x1, %al
callq 0x9560
movsd 0x14(%r13), %xmm0
ucomisd 0x417dc(%rip), %xmm0    # 0x1090d8
jae 0xc79c7
ucomisd 0x4172e(%rip), %xmm0    # 0x109038
jae 0xc7a4e
ucomisd 0x41748(%rip), %xmm0    # 0x109060
jae 0xc7a61
ucomisd 0x41782(%rip), %xmm0    # 0x1090a8
jae 0xc7988
ucomisd 0x417e8(%rip), %xmm0    # 0x109118
jae 0xc7e39
movsd 0x41792(%rip), %xmm1    # 0x1090d0
ucomisd %xmm0, %xmm1
jae 0xc7a7a
movsd 0x41790(%rip), %xmm1    # 0x1090e0
ucomisd %xmm0, %xmm1
jae 0xc79c7
movsd 0x4178a(%rip), %xmm1    # 0x1090e8
ucomisd %xmm0, %xmm1
jae 0xc7a4e
movsd 0x41780(%rip), %xmm1    # 0x1090f0
ucomisd %xmm0, %xmm1
jae 0xc7a61
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xc7a7a
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b1b8(%rip), %rdi     # 0x122b51
jmp 0xc7a72
testb %cl, %cl
je 0xc79d9
leaq 0x675d2(%rip), %rsi     # 0x12ef7b
movl $0x3e9, %edx            # imm = 0x3E9
movb $0x3, %al
callq 0x9560
movl $0xa, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc7e19
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc7a7a
leaq 0x675bc(%rip), %rsi     # 0x12ef9c
movl %r14d, %edx
movb $0x3, %al
callq 0x9560
leaq 0x24594f(%rip), %rax    # 0x30d340
cmpl $0x0, (%rax)
jne 0xc7a1a
leaq 0x245947(%rip), %rax    # 0x30d344
cmpl $0x0, (%rax)
jne 0xc7a1a
leaq 0x24593f(%rip), %rax    # 0x30d348
cmpl $0x0, (%rax)
jne 0xc7a1a
leaq 0x2459a7(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc79b5
movsd 0xc(%r13), %xmm1
movsd 0x14(%r13), %xmm0
movsd 0x1c(%r13), %xmm2
xorps %xmm3, %xmm3
cvtss2sd 0x21c(%r13), %xmm3
movq %rbx, %rdi
leaq 0x6757a(%rip), %rsi     # 0x12efbc
movb $0x4, %al
callq 0x9560
jmp 0xc79b5
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b0f4(%rip), %rdi     # 0x122b53
jmp 0xc7a72
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b0e0(%rip), %rdi     # 0x122b52
movq %rbx, %rcx
callq 0x9750
leaq 0x2458c3(%rip), %rax    # 0x30d344
cmpl $0x0, (%rax)
je 0xc7b35
movsd 0xc(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67442(%rip), %rsi     # 0x12eedc
movb $0x1, %al
callq 0x9560
movsd 0xc(%r13), %xmm0
ucomisd 0x41619(%rip), %xmm0    # 0x1090c8
jae 0xc7b35
ucomisd 0x4161b(%rip), %xmm0    # 0x1090d8
jae 0xc7afa
ucomisd 0x41571(%rip), %xmm0    # 0x109038
jae 0xc7b09
ucomisd 0x4158f(%rip), %xmm0    # 0x109060
jae 0xc7b1c
ucomisd 0x415cd(%rip), %xmm0    # 0x1090a8
jae 0xc7b1c
ucomisd 0x41633(%rip), %xmm0    # 0x109118
jb 0xc7b35
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5b059(%rip), %rdi     # 0x122b51
jmp 0xc7b2d
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc7b35
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5b039(%rip), %rdi     # 0x122b53
jmp 0xc7b2d
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5b025(%rip), %rdi     # 0x122b52
movq %rbx, %rcx
callq 0x9750
leaq 0x24580c(%rip), %rax    # 0x30d348
cmpl $0x0, (%rax)
je 0xc7b58
movsd 0x1c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x6739a(%rip), %rsi     # 0x12eeeb
movb $0x1, %al
callq 0x9560
leaq 0x24585d(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc7b81
xorps %xmm0, %xmm0
cvtss2sd 0x21c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67380(%rip), %rsi     # 0x12eefa
movb $0x1, %al
callq 0x9560
leaq 0x2457d8(%rip), %rax    # 0x30d360
cmpl $0x0, (%rax)
jne 0xc7ba5
leaq 0x2457d0(%rip), %rax    # 0x30d364
cmpl $0x0, (%rax)
jne 0xc7ba5
leaq 0x2457c8(%rip), %rax    # 0x30d368
cmpl $0x0, (%rax)
je 0xc7be1
xorps %xmm0, %xmm0
cvtss2sd 0x94(%r13), %xmm0
movq %rbx, %rdi
leaq 0x6734e(%rip), %rsi     # 0x12ef09
movb $0x1, %al
callq 0x9560
movss 0x45486(%rip), %xmm0    # 0x10d050
ucomiss 0x94(%r13), %xmm0
jbe 0xc7be1
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
leaq 0x245778(%rip), %rax    # 0x30d360
cmpl $0x0, (%rax)
je 0xc7cea
movsd 0xa4(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67315(%rip), %rsi     # 0x12ef19
movb $0x1, %al
callq 0x9560
movsd 0xa4(%r13), %xmm0
ucomisd 0x414bc(%rip), %xmm0    # 0x1090d8
jae 0xc7caf
ucomisd 0x4140e(%rip), %xmm0    # 0x109038
jae 0xc7cbe
ucomisd 0x41428(%rip), %xmm0    # 0x109060
jae 0xc7cd1
ucomisd 0x41462(%rip), %xmm0    # 0x1090a8
jae 0xc7c9c
ucomisd 0x414c8(%rip), %xmm0    # 0x109118
jae 0xc7e4f
movsd 0x41472(%rip), %xmm1    # 0x1090d0
ucomisd %xmm0, %xmm1
jae 0xc7cea
movsd 0x41470(%rip), %xmm1    # 0x1090e0
ucomisd %xmm0, %xmm1
jae 0xc7caf
movsd 0x4146a(%rip), %xmm1    # 0x1090e8
ucomisd %xmm0, %xmm1
jae 0xc7cbe
movsd 0x41464(%rip), %xmm1    # 0x1090f0
ucomisd %xmm0, %xmm1
jae 0xc7cd1
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xc7cea
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5aea4(%rip), %rdi     # 0x122b51
jmp 0xc7ce2
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc7cea
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5ae84(%rip), %rdi     # 0x122b53
jmp 0xc7ce2
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5ae70(%rip), %rdi     # 0x122b52
movq %rbx, %rcx
callq 0x9750
leaq 0x245673(%rip), %rax    # 0x30d364
cmpl $0x0, (%rax)
je 0xc7dab
movsd 0x9c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67220(%rip), %rsi     # 0x12ef2d
movb $0x1, %al
callq 0x9560
movsd 0x9c(%r13), %xmm0
ucomisd 0x413a3(%rip), %xmm0    # 0x1090c8
jae 0xc7dab
ucomisd 0x413a5(%rip), %xmm0    # 0x1090d8
jae 0xc7d70
ucomisd 0x412fb(%rip), %xmm0    # 0x109038
jae 0xc7d7f
ucomisd 0x41319(%rip), %xmm0    # 0x109060
jae 0xc7d92
ucomisd 0x41357(%rip), %xmm0    # 0x1090a8
jae 0xc7d92
ucomisd 0x413bd(%rip), %xmm0    # 0x109118
jb 0xc7dab
movl $0x4, %esi
movl $0x1, %edx
leaq 0x5ade3(%rip), %rdi     # 0x122b51
jmp 0xc7da3
movl $0x20, %edi
movq %rbx, %rsi
callq 0x9480
jmp 0xc7dab
movl $0x2, %esi
movl $0x1, %edx
leaq 0x5adc3(%rip), %rdi     # 0x122b53
jmp 0xc7da3
movl $0x3, %esi
movl $0x1, %edx
leaq 0x5adaf(%rip), %rdi     # 0x122b52
movq %rbx, %rcx
callq 0x9750
leaq 0x2455b6(%rip), %rax    # 0x30d368
cmpl $0x0, (%rax)
je 0xc7dd1
movsd 0xac(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67175(%rip), %rsi     # 0x12ef3f
movb $0x1, %al
callq 0x9560
leaq 0x2455e4(%rip), %rax    # 0x30d3bc
cmpl $0x0, (%rax)
je 0xc7dfa
xorps %xmm0, %xmm0
cvtss2sd 0x21c(%r13), %xmm0
movq %rbx, %rdi
leaq 0x67107(%rip), %rsi     # 0x12eefa
movb $0x1, %al
callq 0x9560
movl $0x8, %esi
movl $0x1, %edx
leaq 0x67146(%rip), %rdi     # 0x12ef51
movq %rbx, %rcx
callq 0x9750
movl $0x1, %r15d
leaq 0xa8e48(%rip), %rsi     # 0x170c68
xorps %xmm1, %xmm1
addq $0x348, %r13            # imm = 0x348
cmpq $0x3e9, %r12            # imm = 0x3E9
jne 0xc769d
jmp 0xc7e65
movl $0x5, %esi
movl $0x1, %edx
leaq 0x5ad06(%rip), %rdi     # 0x122b50
jmp 0xc7a72
movl $0x5, %esi
movl $0x1, %edx
leaq 0x5acf0(%rip), %rdi     # 0x122b50
jmp 0xc7ce2
testl %r15d, %r15d
je 0xc7e91
leaq 0x6716b(%rip), %rdi     # 0x12efdc
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