// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x1103ab
jmp 0x110778
leaq 0x18d242(%rip), %rax    # 0x29d5f4
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1103bf
jmp 0x110778
leaq 0x18d17a(%rip), %rax    # 0x29d540
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rcx
leaq 0x18d168(%rip), %rax    # 0x29d540
movq %rcx, (%rax)
leaq 0x18c75e(%rip), %rdi    # 0x29cb40
leaq 0x619b3(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18d227(%rip), %rax    # 0x29d628
cmpl $0x0, (%rax)
jne 0x11040d
callq 0x10c210
jmp 0x110427
leaq 0x18d214(%rip), %rax    # 0x29d628
cmpl $0x12e, (%rax)          # imm = 0x12E
jne 0x110425
movq -0x8(%rbp), %rdi
callq 0x110780
jmp 0x110427
leaq 0x25c726(%rip), %rax    # 0x36cb54
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x110457
callq 0x10e360
leaq 0x25c70e(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0x200, %ecx            # imm = 0x200
leaq 0x25c6ff(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
leaq 0x18c6e2(%rip), %rdi    # 0x29cb40
leaq 0x61937(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28d5b3(%rip), %rax    # 0x39da30
cmpb $0x0, (%rax)
je 0x1104df
leaq 0x28e023(%rip), %rax    # 0x39e4ac
cmpl $0x2, (%rax)
jne 0x1104df
leaq 0x28d59b(%rip), %rdi    # 0x39da30
callq 0x21570
leaq 0x18c69f(%rip), %rdi    # 0x29cb40
leaq 0x6a900(%rip), %rsi     # 0x17ada8
leaq 0x28af51(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c679(%rip), %rdi    # 0x29cb40
leaq 0x618ce(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28d69a(%rip), %rax    # 0x39db80
cmpb $0x0, (%rax)
je 0x11053c
leaq 0x28d68e(%rip), %rdi    # 0x39db80
callq 0x21570
leaq 0x18c642(%rip), %rdi    # 0x29cb40
leaq 0x81423(%rip), %rsi     # 0x191928
leaq 0x28aef4(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c61c(%rip), %rdi    # 0x29cb40
leaq 0x61871(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28d78d(%rip), %rax    # 0x39dcd0
cmpb $0x0, (%rax)
je 0x110599
leaq 0x28d781(%rip), %rdi    # 0x39dcd0
callq 0x21570
leaq 0x18c5e5(%rip), %rdi    # 0x29cb40
leaq 0x813d2(%rip), %rsi     # 0x191934
leaq 0x28ae97(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c5bf(%rip), %rdi    # 0x29cb40
leaq 0x61814(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28d880(%rip), %rax    # 0x39de20
cmpb $0x0, (%rax)
je 0x1105f6
leaq 0x28d874(%rip), %rdi    # 0x39de20
callq 0x21570
leaq 0x18c588(%rip), %rdi    # 0x29cb40
leaq 0x81381(%rip), %rsi     # 0x191940
leaq 0x28ae3a(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c562(%rip), %rdi    # 0x29cb40
leaq 0x617b7(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28d973(%rip), %rax    # 0x39df70
cmpb $0x0, (%rax)
je 0x110653
leaq 0x28d967(%rip), %rdi    # 0x39df70
callq 0x21570
leaq 0x18c52b(%rip), %rdi    # 0x29cb40
leaq 0x81330(%rip), %rsi     # 0x19194c
leaq 0x28addd(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c505(%rip), %rdi    # 0x29cb40
leaq 0x6175a(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28da66(%rip), %rax    # 0x39e0c0
cmpb $0x0, (%rax)
je 0x1106b0
leaq 0x28da5a(%rip), %rdi    # 0x39e0c0
callq 0x21570
leaq 0x18c4ce(%rip), %rdi    # 0x29cb40
leaq 0x812df(%rip), %rsi     # 0x191958
leaq 0x28ad80(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c4a8(%rip), %rdi    # 0x29cb40
leaq 0x616fd(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28db59(%rip), %rax    # 0x39e210
cmpb $0x0, (%rax)
je 0x11070d
leaq 0x28db4d(%rip), %rdi    # 0x39e210
callq 0x21570
leaq 0x18c471(%rip), %rdi    # 0x29cb40
leaq 0x8128e(%rip), %rsi     # 0x191964
leaq 0x28ad23(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c44b(%rip), %rdi    # 0x29cb40
leaq 0x616a0(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x28dc4c(%rip), %rax    # 0x39e360
cmpb $0x0, (%rax)
je 0x11076a
leaq 0x28dc40(%rip), %rdi    # 0x39e360
callq 0x21570
leaq 0x18c414(%rip), %rdi    # 0x29cb40
leaq 0x8123d(%rip), %rsi     # 0x191970
leaq 0x28acc6(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
leaq 0x18c3ee(%rip), %rdi    # 0x29cb40
leaq 0x61643(%rip), %rsi     # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movq -0x18(%rbp), %rcx
leaq 0x18cdcb(%rip), %rax    # 0x29d540
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop