// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: close_log_file()
void close_log_file()
{
   if(log_file) {
      if(log_fmt == GPX) {
         end_log_track();
         fprintf(log_file, "</gpx>\n");
         gpx_track_number = 0;
      }
      else if(log_fmt == KML) {
         end_log_track();

         if(1) {
            fprintf(log_file, "\n");
            fprintf(log_file, "    <LookAt>\n");
            fprintf(log_file, "      <longitude>%.9f</longitude>\n", lon*180.0/PI);            
            fprintf(log_file, "      <latitude>%.9f</latitude>\n", lat*180.0/PI);             
            fprintf(log_file, "      <altitude>%.2f</altitude>\n", alt);               
            fprintf(log_file, "      <altitudeMode>absolute</altitudeMode>\n");
//               <heading>0</heading>               
//               <tilt>45</tilt>
//               <range>175</range>                    
            fprintf(log_file, "    </LookAt>\n");
         }

         fprintf(log_file, "\n");
         fprintf(log_file, "  </Document>\n");
         fprintf(log_file, "</kml>\n");
         gpx_track_number = 0;
      }
      else if(log_fmt == RINEX) {
         rinex_header_written = 0;
         rinex_obs_written = 0;
      }
      else if(log_fmt == XML) {
         end_log_track();
         fprintf(log_file, "</gpx>\n");
         gpx_track_number = 0;
      }

      if(log_fmt != RINEX) {
         fprintf(log_file, "\n");
         fprintf(log_file, "\n");
      }

      fclose(log_file);
   }

   log_file = 0;
   if(log_header) log_written = 0;
   show_log_state();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x190195(%rip), %rax    # 0x29d540
cmpq $0x0, (%rax)
je 0x10d602
leaq 0x19026c(%rip), %rax    # 0x29d628
cmpl $0x14, (%rax)
jne 0x10d3f0
callq 0x10c110
leaq 0x190173(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82e17(%rip), %rsi     # 0x1901ee
movb $0x0, %al
callq 0x9550
leaq 0x190247(%rip), %rax    # 0x29d62c
movl $0x0, (%rax)
jmp 0x10d5b4
leaq 0x190231(%rip), %rax    # 0x29d628
cmpl $0x1e, (%rax)
jne 0x10d54d
callq 0x10c110
leaq 0x190134(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x8b210(%rip), %rsi     # 0x198626
movb $0x0, %al
callq 0x9550
leaq 0x19011c(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82dc8(%rip), %rsi     # 0x1901f6
movb $0x0, %al
callq 0x9550
leaq 0x190104(%rip), %rax    # 0x29d540
movq (%rax), %rdi
movsd 0x61c31(%rip), %xmm0    # 0x16f078
leaq 0x25ed6a(%rip), %rax    # 0x36c1b8
mulsd (%rax), %xmm0
movsd 0x6416e(%rip), %xmm1    # 0x1715c8
divsd %xmm1, %xmm0
leaq 0x82d9f(%rip), %rsi     # 0x190204
movb $0x1, %al
callq 0x9550
leaq 0x1900cd(%rip), %rax    # 0x29d540
movq (%rax), %rdi
movsd 0x61bfa(%rip), %xmm0    # 0x16f078
leaq 0x25ed2b(%rip), %rax    # 0x36c1b0
mulsd (%rax), %xmm0
movsd 0x64137(%rip), %xmm1    # 0x1715c8
divsd %xmm1, %xmm0
leaq 0x82d8b(%rip), %rsi     # 0x190227
movb $0x1, %al
callq 0x9550
leaq 0x190096(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x25ed0c(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
leaq 0x82d89(%rip), %rsi     # 0x190248
movb $0x1, %al
callq 0x9550
leaq 0x190073(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82386(%rip), %rsi     # 0x18f85d
movb $0x0, %al
callq 0x9550
leaq 0x19005b(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82d7a(%rip), %rsi     # 0x190269
movb $0x0, %al
callq 0x9550
leaq 0x190043(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x8b11f(%rip), %rsi     # 0x198626
movb $0x0, %al
callq 0x9550
leaq 0x19002b(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82d59(%rip), %rsi     # 0x190278
movb $0x0, %al
callq 0x9550
leaq 0x190013(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82d50(%rip), %rsi     # 0x190287
movb $0x0, %al
callq 0x9550
leaq 0x1900e7(%rip), %rax    # 0x29d62c
movl $0x0, (%rax)
jmp 0x10d5b2
leaq 0x1900d4(%rip), %rax    # 0x29d628
cmpl $0x12e, (%rax)          # imm = 0x12E
jne 0x10d578
leaq 0x190069(%rip), %rax    # 0x29d5cc
movl $0x0, (%rax)
leaq 0x190060(%rip), %rax    # 0x29d5d0
movl $0x0, (%rax)
jmp 0x10d5b0
leaq 0x1900a9(%rip), %rax    # 0x29d628
cmpl $0xa, (%rax)
jne 0x10d5ae
callq 0x10c110
leaq 0x18ffb0(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x82c54(%rip), %rsi     # 0x1901ee
movb $0x0, %al
callq 0x9550
leaq 0x190084(%rip), %rax    # 0x29d62c
movl $0x0, (%rax)
jmp 0x10d5b0
jmp 0x10d5b2
jmp 0x10d5b4
leaq 0x19006d(%rip), %rax    # 0x29d628
cmpl $0x12e, (%rax)          # imm = 0x12E
je 0x10d5f3
leaq 0x18ff76(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x8b052(%rip), %rsi     # 0x198626
movb $0x0, %al
callq 0x9550
leaq 0x18ff5e(%rip), %rax    # 0x29d540
movq (%rax), %rdi
leaq 0x8b03a(%rip), %rsi     # 0x198626
movb $0x0, %al
callq 0x9550
leaq 0x18ff46(%rip), %rax    # 0x29d540
movq (%rax), %rdi
callq 0x9380
leaq 0x18ff37(%rip), %rax    # 0x29d540
movq $0x0, (%rax)
leaq 0x18ffc1(%rip), %rax    # 0x29d5d8
cmpb $0x0, (%rax)
je 0x10d626
leaq 0x18ffa7(%rip), %rax    # 0x29d5ca
movb $0x0, (%rax)
callq 0x10ae40
popq %rbp
retq
nopl (%rax)