// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1757ad(%rip), %r12    # 0x228360
movq (%r12), %rsi
testq %rsi, %rsi
je 0xb2d54
leaq 0x175881(%rip), %r13    # 0x228448
movl (%r13), %eax
cmpl $0xa, %eax
je 0xb2be5
cmpl $0x12e, %eax            # imm = 0x12E
je 0xb2bf6
cmpl $0x1e, %eax
je 0xb2c0f
cmpl $0x14, %eax
jne 0xb2d2c
callq 0xb1bef
leaq 0x64a21(%rip), %rdi     # 0x117612
jmp 0xb2d0b
leaq 0x1757ef(%rip), %rax    # 0x2283ec
andl $0x0, (%rax)
leaq 0x1757e9(%rip), %rax    # 0x2283f0
andl $0x0, (%rax)
jmp 0xb2d4c
callq 0xb1bef
movq (%r12), %rsi
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x9480
movq (%r12), %rcx
leaq 0x649ed(%rip), %rdi     # 0x11761a
pushq $0xd
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x9750
movq (%r12), %rdi
leaq 0x244391(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm0
mulsd 0x42c55(%rip), %xmm0    # 0xf58a8
divsd 0x42c45(%rip), %xmm0    # 0xf58a0
leaq 0x649c6(%rip), %rsi     # 0x117628
movb $0x1, %al
callq 0x9560
movq (%r12), %rdi
leaq 0x24435c(%rip), %rax    # 0x2f6fd0
movsd 0x42c2c(%rip), %xmm0    # 0xf58a8
mulsd (%rax), %xmm0
divsd 0x42c18(%rip), %xmm0    # 0xf58a0
leaq 0x649bc(%rip), %rsi     # 0x11764b
movb $0x1, %al
callq 0x9560
movq (%r12), %rdi
leaq 0x24433f(%rip), %rax    # 0x2f6fe0
movsd (%rax), %xmm0
leaq 0x649c0(%rip), %rsi     # 0x11766c
movb $0x1, %al
callq 0x9560
movq (%r12), %rcx
leaq 0x63fc3(%rip), %rdi     # 0x116c81
pushq $0x2c
popq %rsi
movq %r14, %rdx
callq 0x9750
movq (%r12), %rcx
leaq 0x649b9(%rip), %rdi     # 0x11768d
pushq $0xe
popq %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x9750
movq (%r12), %rsi
movl %ebx, %edi
callq 0x9480
movq (%r12), %rcx
leaq 0x649a3(%rip), %rdi     # 0x11769c
movq %r15, %rsi
movq %r14, %rdx
callq 0x9750
leaq 0x649a0(%rip), %rdi     # 0x1176ab
movq (%r12), %rcx
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x9750
leaq 0x17572b(%rip), %rax    # 0x22844c
andl $0x0, (%rax)
movl (%r13), %eax
movq (%r12), %rsi
cmpl $0x12e, %eax            # imm = 0x12E
je 0xb2d4c
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x9480
movq (%r12), %rsi
movl %ebx, %edi
callq 0x9480
movq (%r12), %rsi
movq %rsi, %rdi
callq 0x9360
andq $0x0, (%r12)
leaq 0x175698(%rip), %rax    # 0x2283f8
cmpb $0x0, (%rax)
je 0xb2d6f
leaq 0x17567e(%rip), %rax    # 0x2283ea
movb $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb1018