// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_header(_IO_FILE*, int)
void write_log_header(FILE *file, int why)
{
FILE *old_file;

   // write the log file header comments

   if(file == 0) return;
   if(log_comments == 0) return;

   old_file = log_file;
   log_file = file;

   sprintf(log_text, "#");
   write_log_comment(1);

   if(log_fmt == HEATHER) {
      log_rcvr_type();
   }
   else if(log_fmt == RINEX) {
      write_rinex_header(file);
   }

   if((have_info & INFO_LOGGED) == 0) {
      write_log_id();
      have_info |= INFO_LOGGED;
   }

   sprintf(log_text, "#");
   write_log_comment(1);

   if(plot_title[0] && (title_type == USER)) {
      format_plot_title(plot_title);
      sprintf(log_text, "#TITLE: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }

   if(debug_text[0]) {
      format_plot_title(debug_text);
      sprintf(log_text, "#DEBUG1: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text2[0]) {
      format_plot_title(debug_text2);
      sprintf(log_text, "#DEBUG2: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text3[0]) {
      format_plot_title(debug_text3);
      sprintf(log_text, "#DEBUG3: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text4[0]) {
      format_plot_title(debug_text4);
      sprintf(log_text, "#DEBUG4: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text5[0]) {
      format_plot_title(debug_text5);
      sprintf(log_text, "#DEBUG5: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text6[0]) {
      format_plot_title(debug_text6);
      sprintf(log_text, "#DEBUG6: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }
   if(debug_text7[0]) {
      format_plot_title(debug_text7);
      sprintf(log_text, "#DEBUG7: %s", out);
      write_log_comment(1);
      sprintf(log_text, "#");
      write_log_comment(1);
   }

   log_file = old_file;
   return;
}

// Assembly:
testq %rdi, %rdi
je 0xb5802
leaq 0x172ef1(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0xb5802
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
leaq 0x172e1f(%rip), %r15    # 0x228360
movq (%r15), %r12
movq %rdi, (%r15)
leaq 0x172412(%rip), %rbx    # 0x227960
movw $0x23, (%rbx)
pushq $0x1
popq %rdi
callq 0xb25f5
leaq 0x172ee6(%rip), %rax    # 0x228448
movl (%rax), %eax
cmpl $0x12e, %eax            # imm = 0x12E
je 0xb5576
testl %eax, %eax
jne 0xb557e
callq 0xb1cc3
jmp 0xb557e
movq %r14, %rdi
callq 0xb5803
leaq 0x2423ef(%rip), %r14    # 0x2f7974
testb $0x2, 0x1(%r14)
jne 0xb5596
callq 0xb385a
orb $0x2, 0x1(%r14)
movw $0x23, (%rbx)
pushq $0x1
popq %rdi
callq 0xb25f5
leaq 0x2732a6(%rip), %rax    # 0x328850
cmpb $0x0, (%rax)
je 0xb55f8
leaq 0x273d16(%rip), %rax    # 0x3292cc
cmpl $0x2, (%rax)
jne 0xb55f8
leaq 0x27328e(%rip), %rdi    # 0x328850
callq 0x172dc
leaq 0x4ae95(%rip), %rsi     # 0x100463
leaq 0x270c4b(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2733a1(%rip), %rax    # 0x3289a0
cmpb $0x0, (%rax)
je 0xb5641
leaq 0x273395(%rip), %rdi    # 0x3289a0
callq 0x172dc
leaq 0x63735(%rip), %rsi     # 0x118d4c
leaq 0x270c02(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2734a8(%rip), %rax    # 0x328af0
cmpb $0x0, (%rax)
je 0xb568a
leaq 0x27349c(%rip), %rdi    # 0x328af0
callq 0x172dc
leaq 0x636f8(%rip), %rsi     # 0x118d58
leaq 0x270bb9(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2735af(%rip), %rax    # 0x328c40
cmpb $0x0, (%rax)
je 0xb56d3
leaq 0x2735a3(%rip), %rdi    # 0x328c40
callq 0x172dc
leaq 0x636bb(%rip), %rsi     # 0x118d64
leaq 0x270b70(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2736b6(%rip), %rax    # 0x328d90
cmpb $0x0, (%rax)
je 0xb571c
leaq 0x2736aa(%rip), %rdi    # 0x328d90
callq 0x172dc
leaq 0x6367e(%rip), %rsi     # 0x118d70
leaq 0x270b27(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2737bd(%rip), %rax    # 0x328ee0
cmpb $0x0, (%rax)
je 0xb5765
leaq 0x2737b1(%rip), %rdi    # 0x328ee0
callq 0x172dc
leaq 0x63641(%rip), %rsi     # 0x118d7c
leaq 0x270ade(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2738c4(%rip), %rax    # 0x329030
cmpb $0x0, (%rax)
je 0xb57ae
leaq 0x2738b8(%rip), %rdi    # 0x329030
callq 0x172dc
leaq 0x63604(%rip), %rsi     # 0x118d88
leaq 0x270a95(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
leaq 0x2739cb(%rip), %rax    # 0x329180
cmpb $0x0, (%rax)
je 0xb57f7
leaq 0x2739bf(%rip), %rdi    # 0x329180
callq 0x172dc
leaq 0x635c7(%rip), %rsi     # 0x118d94
leaq 0x270a4c(%rip), %rdx    # 0x326220
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
movw $0x23, (%rbx)
movl %r14d, %edi
callq 0xb25f5
movq %r12, (%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq