// File: /workspace/github_cpp_makefile_star2_O2/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 0xb6b2a
movq %rdi, %rbx
movl $0x364, %r15d           # imm = 0x364
addq 0x83b6a(%rip), %r15     # 0x139f48
leaq 0xa4883(%rip), %rsi     # 0x15ac68
xorps %xmm1, %xmm1
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpq $0x3e9, %r14            # imm = 0x3E9
je 0xb6b02
movq %r14, %rax
incq %r14
cmpq $0x3e7, %rax            # imm = 0x3E7
jne 0xb6414
testb $0x1, (%rsi)
jne 0xb6ada
jmp 0xb6429
cmpq $0x3e8, %rax            # imm = 0x3E8
jne 0xb6429
movb $0x1, %cl
testb $0x2, (%rsi)
jne 0xb6ada
jmp 0xb642b
xorl %ecx, %ecx
cmpl $0x0, (%r15)
je 0xb6ada
leaq 0x1(%rax), %r13
movl %r13d, %edx
andl $0x3fe, %edx            # imm = 0x3FE
cmpl $0x3e8, %edx            # imm = 0x3E8
jne 0xb64b0
leaq 0x171ff7(%rip), %rdx    # 0x228448
cmpl $0x0, (%rdx)
je 0xb64e7
testl %r12d, %r12d
pushq $0x1
popq %r12
jne 0xb6478
leaq 0x62936(%rip), %rdi     # 0x118da0
pushq $0xe
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
movq %rbx, %rdi
leaq 0x6292d(%rip), %rsi     # 0x118daf
movl %r13d, %edx
xorl %eax, %eax
callq 0x9560
cmpq $0x9, %r14
ja 0xb651f
leaq 0x565fe(%rip), %rdi     # 0x10ca9b
pushq $0x2
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
jmp 0xb6530
movss 0x1ec(%r15), %xmm0
ucomiss %xmm1, %xmm0
jb 0xb6ada
movss 0x1f0(%r15), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xb6ada
cmpl $0x0, 0x1fc(%r15)
jg 0xb644a
jmp 0xb6ada
cvtss2sd 0x1ec(%r15), %xmm0
cvtss2sd 0x1f0(%r15), %xmm1
cvtss2sd 0x4(%r15), %xmm2
movq %rbx, %rdi
cmpq $0x3e7, %rax            # imm = 0x3E7
jne 0xb66d3
leaq 0x62965(%rip), %rsi     # 0x118e7a
movl $0x3e8, %edx            # imm = 0x3E8
jmp 0xb66e3
cmpq $0x63, %r14
ja 0xb6530
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
cvtss2sd 0x1ec(%r15), %xmm0
movq %rbx, %rdi
leaq 0x62883(%rip), %rsi     # 0x118dc6
movb $0x1, %al
callq 0x9560
movss 0x1ec(%r15), %xmm0
movss 0x40b75(%rip), %xmm1    # 0xf70d0
ucomiss %xmm0, %xmm1
jbe 0xb6577
leaq 0x56534(%rip), %rdi     # 0x10ca9b
pushq $0x2
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
jmp 0xb658f
movss 0x40b71(%rip), %xmm1    # 0xf70f0
ucomiss %xmm0, %xmm1
jbe 0xb658f
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
cvtss2sd 0x1f0(%r15), %xmm0
movq %rbx, %rdi
leaq 0x62830(%rip), %rsi     # 0x118dd2
movb $0x1, %al
callq 0x9560
movss 0x40b1f(%rip), %xmm0    # 0xf70d0
ucomiss 0x1f0(%r15), %xmm0
jbe 0xb65c6
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
cmpq $0x3e7, %r14            # imm = 0x3E7
ja 0xb6ab7
cvtss2sd 0x4(%r15), %xmm0
movq %rbx, %rdi
leaq 0x627fb(%rip), %rsi     # 0x118dde
movb $0x1, %al
callq 0x9560
movss 0x40ade(%rip), %xmm0    # 0xf70d0
ucomiss 0x4(%r15), %xmm0
jbe 0xb6604
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
leaq 0x240d35(%rip), %rax    # 0x2f7340
cmpl $0x0, (%rax)
je 0xb679c
movsd 0x14(%r15), %xmm0
movq %rbx, %rdi
leaq 0x627c7(%rip), %rsi     # 0x118deb
movb $0x1, %al
callq 0x9560
movsd 0x14(%r15), %xmm0
ucomisd 0x3ca9f(%rip), %xmm0    # 0xf30d8
jae 0xb66fa
ucomisd 0x3c9f1(%rip), %xmm0    # 0xf3038
jae 0xb677c
ucomisd 0x3ca0b(%rip), %xmm0    # 0xf3060
jae 0xb6787
ucomisd 0x3ca45(%rip), %xmm0    # 0xf30a8
jae 0xb66c5
ucomisd 0x3caab(%rip), %xmm0    # 0xf3118
jae 0xb6ae6
movsd 0x3ca55(%rip), %xmm1    # 0xf30d0
ucomisd %xmm0, %xmm1
jae 0xb679c
movsd 0x3ca53(%rip), %xmm1    # 0xf30e0
ucomisd %xmm0, %xmm1
jae 0xb66fa
movsd 0x3ca4d(%rip), %xmm1    # 0xf30e8
ucomisd %xmm0, %xmm1
jae 0xb677c
movsd 0x3ca43(%rip), %xmm1    # 0xf30f0
ucomisd %xmm0, %xmm1
jae 0xb6787
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xb679c
leaq 0x563cd(%rip), %rdi     # 0x10ca99
pushq $0x4
jmp 0xb6790
testb %cl, %cl
je 0xb670a
leaq 0x627bd(%rip), %rsi     # 0x118e9b
movl $0x3e9, %edx            # imm = 0x3E9
movb $0x3, %al
callq 0x9560
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x9480
jmp 0xb6ad0
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
jmp 0xb679c
leaq 0x627ab(%rip), %rsi     # 0x118ebc
movl %r13d, %edx
movb $0x3, %al
callq 0x9560
leaq 0x240c1e(%rip), %rax    # 0x2f7340
cmpl $0x0, (%rax)
jne 0xb674b
leaq 0x240c16(%rip), %rax    # 0x2f7344
cmpl $0x0, (%rax)
jne 0xb674b
leaq 0x240c0e(%rip), %rax    # 0x2f7348
cmpl $0x0, (%rax)
jne 0xb674b
leaq 0x240c76(%rip), %rax    # 0x2f73bc
cmpl $0x0, (%rax)
je 0xb66ea
movsd 0xc(%r15), %xmm1
movsd 0x14(%r15), %xmm0
movsd 0x1c(%r15), %xmm2
cvtss2sd 0x21c(%r15), %xmm3
movq %rbx, %rdi
leaq 0x6276c(%rip), %rsi     # 0x118edc
movb $0x4, %al
callq 0x9560
jmp 0xb66ea
leaq 0x56318(%rip), %rdi     # 0x10ca9b
pushq $0x2
jmp 0xb6790
leaq 0x5630c(%rip), %rdi     # 0x10ca9a
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
leaq 0x240ba1(%rip), %rax    # 0x2f7344
cmpl $0x0, (%rax)
je 0xb683d
movsd 0xc(%r15), %xmm0
movq %rbx, %rdi
leaq 0x62640(%rip), %rsi     # 0x118dfc
movb $0x1, %al
callq 0x9560
movsd 0xc(%r15), %xmm0
ucomisd 0x3c8f7(%rip), %xmm0    # 0xf30c8
jae 0xb683d
ucomisd 0x3c8fd(%rip), %xmm0    # 0xf30d8
jae 0xb6810
ucomisd 0x3c853(%rip), %xmm0    # 0xf3038
jae 0xb681d
ucomisd 0x3c871(%rip), %xmm0    # 0xf3060
jae 0xb6828
ucomisd 0x3c8af(%rip), %xmm0    # 0xf30a8
jae 0xb6828
ucomisd 0x3c915(%rip), %xmm0    # 0xf3118
jb 0xb683d
leaq 0x5628d(%rip), %rdi     # 0x10ca99
pushq $0x4
jmp 0xb6831
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
jmp 0xb683d
leaq 0x56277(%rip), %rdi     # 0x10ca9b
pushq $0x2
jmp 0xb6831
leaq 0x5626b(%rip), %rdi     # 0x10ca9a
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
leaq 0x240b04(%rip), %rax    # 0x2f7348
cmpl $0x0, (%rax)
je 0xb6860
movsd 0x1c(%r15), %xmm0
movq %rbx, %rdi
leaq 0x625b2(%rip), %rsi     # 0x118e0b
movb $0x1, %al
callq 0x9560
leaq 0x240b55(%rip), %rax    # 0x2f73bc
cmpl $0x0, (%rax)
je 0xb6886
cvtss2sd 0x21c(%r15), %xmm0
movq %rbx, %rdi
leaq 0x6259b(%rip), %rsi     # 0x118e1a
movb $0x1, %al
callq 0x9560
leaq 0x240ad3(%rip), %rax    # 0x2f7360
cmpl $0x0, (%rax)
jne 0xb68aa
leaq 0x240acb(%rip), %rax    # 0x2f7364
cmpl $0x0, (%rax)
jne 0xb68aa
leaq 0x240ac3(%rip), %rax    # 0x2f7368
cmpl $0x0, (%rax)
je 0xb68e1
cvtss2sd 0x94(%r15), %xmm0
movq %rbx, %rdi
leaq 0x6256c(%rip), %rsi     # 0x118e29
movb $0x1, %al
callq 0x9560
movss 0x40804(%rip), %xmm0    # 0xf70d0
ucomiss 0x94(%r15), %xmm0
jbe 0xb68e1
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
leaq 0x240a78(%rip), %rax    # 0x2f7360
cmpl $0x0, (%rax)
je 0xb69c4
movsd 0xa4(%r15), %xmm0
movq %rbx, %rdi
leaq 0x62535(%rip), %rsi     # 0x118e39
movb $0x1, %al
callq 0x9560
movsd 0xa4(%r15), %xmm0
ucomisd 0x3c7bc(%rip), %xmm0    # 0xf30d8
jae 0xb6997
ucomisd 0x3c712(%rip), %xmm0    # 0xf3038
jae 0xb69a4
ucomisd 0x3c730(%rip), %xmm0    # 0xf3060
jae 0xb69af
ucomisd 0x3c76e(%rip), %xmm0    # 0xf30a8
jae 0xb698c
ucomisd 0x3c7d4(%rip), %xmm0    # 0xf3118
jae 0xb6af4
movsd 0x3c77e(%rip), %xmm1    # 0xf30d0
ucomisd %xmm0, %xmm1
jae 0xb69c4
movsd 0x3c780(%rip), %xmm1    # 0xf30e0
ucomisd %xmm0, %xmm1
jae 0xb6997
movsd 0x3c77a(%rip), %xmm1    # 0xf30e8
ucomisd %xmm0, %xmm1
jae 0xb69a4
movsd 0x3c774(%rip), %xmm1    # 0xf30f0
ucomisd %xmm0, %xmm1
jae 0xb69af
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jb 0xb69c4
leaq 0x56106(%rip), %rdi     # 0x10ca99
pushq $0x4
jmp 0xb69b8
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
jmp 0xb69c4
leaq 0x560f0(%rip), %rdi     # 0x10ca9b
pushq $0x2
jmp 0xb69b8
leaq 0x560e4(%rip), %rdi     # 0x10ca9a
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
leaq 0x240999(%rip), %rax    # 0x2f7364
cmpl $0x0, (%rax)
je 0xb6a6b
movsd 0x9c(%r15), %xmm0
movq %rbx, %rdi
leaq 0x62466(%rip), %rsi     # 0x118e4d
movb $0x1, %al
callq 0x9560
movsd 0x9c(%r15), %xmm0
ucomisd 0x3c6c9(%rip), %xmm0    # 0xf30c8
jae 0xb6a6b
ucomisd 0x3c6cf(%rip), %xmm0    # 0xf30d8
jae 0xb6a3e
ucomisd 0x3c625(%rip), %xmm0    # 0xf3038
jae 0xb6a4b
ucomisd 0x3c643(%rip), %xmm0    # 0xf3060
jae 0xb6a56
ucomisd 0x3c681(%rip), %xmm0    # 0xf30a8
jae 0xb6a56
ucomisd 0x3c6e7(%rip), %xmm0    # 0xf3118
jb 0xb6a6b
leaq 0x5605f(%rip), %rdi     # 0x10ca99
pushq $0x4
jmp 0xb6a5f
pushq $0x20
popq %rdi
movq %rbx, %rsi
callq 0x9480
jmp 0xb6a6b
leaq 0x56049(%rip), %rdi     # 0x10ca9b
pushq $0x2
jmp 0xb6a5f
leaq 0x5603d(%rip), %rdi     # 0x10ca9a
pushq $0x3
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
leaq 0x2408f6(%rip), %rax    # 0x2f7368
cmpl $0x0, (%rax)
je 0xb6a91
movsd 0xac(%r15), %xmm0
movq %rbx, %rdi
leaq 0x623d5(%rip), %rsi     # 0x118e5f
movb $0x1, %al
callq 0x9560
leaq 0x240924(%rip), %rax    # 0x2f73bc
cmpl $0x0, (%rax)
je 0xb6ab7
cvtss2sd 0x21c(%r15), %xmm0
movq %rbx, %rdi
leaq 0x6236a(%rip), %rsi     # 0x118e1a
movb $0x1, %al
callq 0x9560
leaq 0x623b3(%rip), %rdi     # 0x118e71
pushq $0x8
popq %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x9750
pushq $0x1
popq %r12
leaq 0xa4191(%rip), %rsi     # 0x15ac68
xorps %xmm1, %xmm1
addq $0x348, %r15            # imm = 0x348
jmp 0xb63ee
leaq 0x55fab(%rip), %rdi     # 0x10ca98
pushq $0x5
jmp 0xb6790
leaq 0x55f9d(%rip), %rdi     # 0x10ca98
pushq $0x5
jmp 0xb69b8
testl %r12d, %r12d
je 0xb6b2a
leaq 0x623ee(%rip), %rdi     # 0x118efc
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
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