LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: new_x72_interval(int)
void new_x72_interval(int why)
{
unsigned i;

   // start accumulating a new pps interval

   x72_pps_interval = 0;
   x72_dis_sum = 0;
   x72_sum_sum = 0;

   for(i=0; i<X72_PPS_BINS; i++) {
      x72_pps_list[i] = 0;
   }

   x72_sum_y = 0.0;
   x72_sum_x = 0.0; 
   x72_sum_xx = 0.0; 
   x72_sum_yy = 0.0; 
   x72_sum_xy = 0.0; 

   x72_pps_avg = 0.0;
   x72_pps_trend = 0.0;
if(debug_file) fprintf(debug_file, "Clear pps list!  why:%d\n", why);
}

// Assembly:
leaq 0x1548c5(%rip), %rax    # 0x204f24
andl $0x0, (%rax)
andl $0x0, 0x2affcb(%rip)    # 0x360634
andl $0x0, 0x2affc8(%rip)    # 0x360638
movl %edi, %edx
xorl %eax, %eax
leaq 0x2affe5(%rip), %rcx    # 0x360660
cmpq $0xa4, %rax
je 0xb068d
andl $0x0, (%rax,%rcx)
addq $0x4, %rax
jmp 0xb067b
pushq %rbp
movq %rsp, %rbp
andq $0x0, 0x2b006f(%rip)    # 0x360708
andq $0x0, 0x2b0087(%rip)    # 0x360728
andq $0x0, 0x2b0077(%rip)    # 0x360720
andq $0x0, 0x2b005f(%rip)    # 0x360710
andq $0x0, 0x2b005f(%rip)    # 0x360718
andq $0x0, 0x2aff7f(%rip)    # 0x360640
leaq 0x154868(%rip), %rax    # 0x204f30
andq $0x0, (%rax)
leaq 0x177cbd(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
popq %rbp
je 0xb06ea
leaq 0x644ee(%rip), %rsi     # 0x114bd1
xorl %eax, %eax
jmp 0x9560
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_update_pps_list(int)
void x72_update_pps_list(int val)
{
double x;
double y;

   // add a new point to the pps list
   if(dac_dac == 0) {
      if(val < (-X72_PPS_SPREAD)) return;
      if(val > X72_PPS_SPREAD) return;
      ++x72_pps_list[val+X72_PPS_SPREAD];
   }

   x = (double) x72_pps_interval;
   y = (double) val;

   x72_sum_x  += x;      // update trend line data
   x72_sum_y  += y;
   x72_sum_xx += (x * x);
   x72_sum_yy += (y * y);
   x72_sum_xy += (x * y);

   ++x72_pps_interval;   // how many points we have so far for this interval

if(show_debug_info && (last_x72_dmode > 2)) sprintf(debug_text3, "add pps %g: %g  ival:%d  tavg:%g  pid_time:%d   dds_count:%d  in:%d  out:%d  filtered_dds:%g", x, y, x72_ival, x72_sum_y/x, pid_time, x72_dds_count, x72_dds_in, x72_dds_out, filtered_dds);
}

// Assembly:
leaq 0x27512a(%rip), %rax    # 0x32581c
cmpl $0x0, (%rax)
jne 0xb0710
leal -0x15(%rdi), %eax
cmpl $-0x29, %eax
jb 0xb0804
leal 0x14(%rdi), %eax
leaq 0x2aff53(%rip), %rcx    # 0x360660
incl (%rcx,%rax,4)
leaq 0x15480d(%rip), %rax    # 0x204f24
movl (%rax), %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %edi, %xmm1
movsd 0x2affff(%rip), %xmm2   # 0x360728
addsd %xmm0, %xmm2
movsd %xmm2, 0x2afff3(%rip)   # 0x360728
movsd 0x2affcb(%rip), %xmm2   # 0x360708
addsd %xmm1, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd 0x2affcf(%rip), %xmm3   # 0x360720
movsd %xmm3, 0x2affc7(%rip)   # 0x360720
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2affa7(%rip), %xmm3   # 0x360710
movsd %xmm2, 0x2aff97(%rip)   # 0x360708
movsd %xmm3, 0x2aff97(%rip)   # 0x360710
movapd %xmm0, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2aff8f(%rip), %xmm3   # 0x360718
movsd %xmm3, 0x2aff87(%rip)   # 0x360718
incl %ecx
movl %ecx, (%rax)
leaq 0x152128(%rip), %rax    # 0x2028c4
cmpb $0x0, (%rax)
je 0xb0804
leaq 0x154778(%rip), %rax    # 0x204f20
cmpl $0x3, (%rax)
jl 0xb0804
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x154780(%rip), %rax    # 0x204f3c
movl (%rax), %edx
divsd %xmm0, %xmm2
movl 0x2afe94(%rip), %ecx    # 0x36065c
leaq 0x154759(%rip), %rax    # 0x204f28
movl (%rax), %r8d
movl 0x2b355b(%rip), %r9d    # 0x363d34
movl 0x2b3551(%rip), %eax    # 0x363d30
movsd 0x2b3551(%rip), %xmm3   # 0x363d38
movl %eax, (%rsp)
leaq 0x27844f(%rip), %rdi    # 0x328c40
leaq 0x643f2(%rip), %rsi     # 0x114bea
movb $0x4, %al
callq 0x9060
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_init_state0()
void x72_init_state0()
{
   // startup the discipline algorithm

   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   x72_startup_flag = 1;
   x72_holdover_points = 0;
   x72_idif_sum = 0;
   new_x72_interval(1);
   x72_initial_pps = x72_pps;
   x72_jamsync_ticks = 0;
   if(x72_start_timer < 0) x72_start_timer = 0;

   if(x72_start_timer < 6) {  // wait for 6 seconds to make sure we have TICs
      ++x72_start_timer;
      return;
   }

   if(have_x72_pps) {  // we have a PPS value, now jamsync the PPS out to PPS in
      update_x72_tic(x72_pps, 1);
      x72_idif = x72_pps_diff;
      init_x72_pid();
//x72_user_state = X72_STATE_START1;
x72_user_state = X72_STATE_JAM2;   // we no longer do the holdover stuff
   }
}

// Assembly:
leaq 0x247514(%rip), %rax    # 0x2f7d20
cmpb $0x0, (%rax)
je 0x83005
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x2afe00(%rip)    # 0x360620
movl $0x1, 0xa3e0e(%rip)     # 0x154638
andl $0x0, 0x2afde3(%rip)    # 0x360614
pushq $0x1
popq %rdi
callq 0xb0658
leaq 0x1545bc(%rip), %rax    # 0x204dfc
andl $0x0, 0x2afde5(%rip)    # 0x36062c
movl (%rax), %edi
movl %edi, 0x2afdd5(%rip)    # 0x360624
movl 0x2afe03(%rip), %eax    # 0x360658
testl %eax, %eax
js 0xb088e
cmpl $0x5, %eax
jbe 0xb0890
leaq 0x15446b(%rip), %rax    # 0x204cd0
cmpl $0x0, (%rax)
je 0xb0898
callq 0x64928
movl 0x2a6377(%rip), %eax    # 0x356bec
movl %eax, 0x2afd95(%rip)    # 0x360610
andl $0x0, 0x2afdda(%rip)    # 0x36065c
movl $0x5, 0x2a6358(%rip)    # 0x356be4
jmp 0xb0898
xorl %eax, %eax
incl %eax
movl %eax, 0x2afdc0(%rip)    # 0x360658
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_init_state1()
void x72_init_state1()
{
   // wait for initial 1PPS jamsync to complete
   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   if(++x72_jamsync_ticks >= 6) {
      x72_jamsync_ticks = 0;
      x72_user_state = X72_STATE_HOLDOVER; // do holdover analysis
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x24747b(%rip), %rax    # 0x2f7d20
cmpb $0x0, (%rax)
je 0xb08d1
movl 0x2afd7c(%rip), %eax    # 0x36062c
leal 0x1(%rax), %ecx
movl %ecx, 0x2afd73(%rip)    # 0x36062c
cmpl $0x5, %eax
jl 0xb08cf
andl $0x0, 0x2afd67(%rip)    # 0x36062c
movl $0x3, 0x2a6315(%rip)    # 0x356be4
popq %rbp
retq
popq %rbp
jmp 0x83005
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_holdover_state()
void x72_holdover_state()
{
   // collect a few minutes of data to see how the frequency is drifting
   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }
   if(x72_holdover_val <= X72_HOLDOVER_SIZE) x72_holdover_val = X72_HOLDOVER_SIZE;


   x72_idif_sum += x72_pps_diff;
   if(x72_holdover_points == 0) x72_idif_sum = 0;
   ++x72_holdover_points;
   holdover = x72_holdover_points;
if(show_debug_info) sprintf(debug_text6, "holdover state: points:%d  idif:%d  sum:%d  mcv:%g  ival:%d", x72_holdover_points, x72_pps_diff, x72_idif_sum, x72_pps_stats(0), x72_ival);

   if(x72_holdover_points >= x72_holdover_val) {  // now go calculate the drift slope and adjust the DDS
      x72_user_state = X72_STATE_SLOPECALC;
   }
}

// Assembly:
leaq 0x247442(%rip), %rax    # 0x2f7d20
cmpb $0x0, (%rax)
je 0x83005
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x15450f(%rip), %r12    # 0x204e08
movl (%r12), %eax
cmpl $0x78, %eax
jg 0xb090d
movl $0x78, (%r12)
pushq $0x78
popq %rax
movl 0x2a62d8(%rip), %r14d   # 0x356bec
movl 0x2afcf9(%rip), %r15d   # 0x360614
addl %r14d, %r15d
movl 0x2afcfc(%rip), %ebx    # 0x360620
testl %ebx, %ebx
cmovel %ebx, %r15d
movl %r15d, 0x2afce3(%rip)   # 0x360614
incl %ebx
movl %ebx, 0x2afce7(%rip)    # 0x360620
leaq 0x246b18(%rip), %rcx    # 0x2f7458
movl %ebx, (%rcx)
leaq 0x151f7b(%rip), %rcx    # 0x2028c4
cmpb $0x0, (%rcx)
je 0xb0984
callq 0xb0447
leaq 0x1545e2(%rip), %rax    # 0x204f3c
movl (%rax), %r9d
leaq 0x2786cc(%rip), %rdi    # 0x329030
leaq 0x642dc(%rip), %rsi     # 0x114c47
movl %ebx, %edx
movl %r14d, %ecx
movl %r15d, %r8d
movb $0x1, %al
callq 0x9060
movl 0x2afca0(%rip), %ebx    # 0x360620
movl (%r12), %eax
cmpl %eax, %ebx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jl 0xb099a
movl $0x9, 0x2a624a(%rip)    # 0x356be4
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_jam2_state()
void x72_jam2_state()
{
   // wait for change in TIC register to complete

   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   if(++x72_jamsync_ticks >= 6) {  // allow 6 seconds for a TIC change to take effect
      x72_jamsync_ticks = 0;
      new_x72_interval(2);
      x72_user_state = X72_STATE_DISCIPLINE;  // start the disciplining
   }
}

// Assembly:
leaq 0x24725c(%rip), %rax    # 0x2f7d20
cmpb $0x0, (%rax)
je 0x83005
movl 0x2afb59(%rip), %eax    # 0x36062c
leal 0x1(%rax), %ecx
movl %ecx, 0x2afb50(%rip)    # 0x36062c
cmpl $0x5, %eax
jl 0xb0aff
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x2afb40(%rip)    # 0x36062c
pushq $0x2
popq %rdi
callq 0xb0658
movl $0x6, 0x2a60e6(%rip)    # 0x356be4
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: end_log_track()
void end_log_track()
{
   if(log_file == 0) return;

   if((log_fmt == GPX) || (log_fmt == XML)) {
      fprintf(log_file, "    </trkseg>\n");
      fprintf(log_file, "  </trk>\n\n");
   }
   else if(log_fmt == KML) {
      fprintf(log_file, "          </coordinates>\n");
      fprintf(log_file, "        </LineString>\n");
      fprintf(log_file, "      </Placemark>\n");
      fprintf(log_file, "    </Folder>\n");
   }
   if(log_flush_mode && log_file) fflush(log_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x176763(%rip), %r14    # 0x228360
movq (%r14), %rcx
testq %rcx, %rcx
je 0xb1cbe
leaq 0x176838(%rip), %rax    # 0x228448
movl (%rax), %eax
cmpl $0xa, %eax
je 0xb1c21
cmpl $0x1e, %eax
je 0xb1c44
cmpl $0x14, %eax
jne 0xb1c98
leaq 0x6509f(%rip), %rdi     # 0x116cc7
pushq $0xe
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x9750
movq (%r14), %rcx
leaq 0x65096(%rip), %rdi     # 0x116cd6
pushq $0xa
jmp 0xb1c8f
leaq 0x65096(%rip), %rdi     # 0x116ce1
pushq $0x19
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x9750
movq (%r14), %rcx
leaq 0x65098(%rip), %rdi     # 0x116cfb
pushq $0x16
popq %rsi
movq %rbx, %rdx
callq 0x9750
movq (%r14), %rcx
leaq 0x6509a(%rip), %rdi     # 0x116d12
pushq $0x13
popq %rsi
movq %rbx, %rdx
callq 0x9750
movq (%r14), %rcx
leaq 0x65099(%rip), %rdi     # 0x116d26
pushq $0xe
popq %rsi
movq %rbx, %rdx
callq 0x9750
leaq 0x176781(%rip), %rax    # 0x228420
cmpl $0x0, (%rax)
setne %al
movq (%r14), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xb1cbe
popq %rbx
popq %r14
popq %rbp
jmp 0x9420
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_comment(int)
void write_log_comment(int spaces)
{
   if(log_file == 0) return;
   if(log_comments == 0) return;

   if(log_fmt == HEATHER) {
      fprintf(log_file, "%s", log_text);
      while(spaces--) fprintf(log_file, "\n");
   }
   else if(log_fmt == KML) {
      if(filter_log_text()) {
         fprintf(log_file, "<!-- %s -->", log_text);
      }
      while(spaces--) fprintf(log_file, "\n");
   }
   else if(log_fmt == RINEX) {  // don't output anything until the RINEX header has been output
      if(rinex_header_written) {
         write_rinex_line(log_file, log_text, "COMMENT");
      }
   }
   else if(log_fmt == XML) {  // !!!! does this work when sending to a GPX viewer?
      if(filter_log_text()) {
         fprintf(log_file, "<!-- %s -->", log_text);
      }
      else {  // blank line
//       fprintf(log_file, "<!--  -->");
      }

      while(spaces--) {
         fprintf(log_file, "\n");
      }
   }

   if(debug_file) {
      if(log_text[1] == '!') fprintf(debug_file, "Event: %s\n", log_text);
      fflush(debug_file);
   }

   if(log_flush_mode && log_file) fflush(log_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x175d5a(%rip), %r15    # 0x228360
movq (%r15), %rsi
testq %rsi, %rsi
je 0xb2768
leaq 0x175dfb(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0xb2768
leaq 0x175e1f(%rip), %rax    # 0x228448
movl (%rax), %eax
cmpl $0x12e, %eax            # imm = 0x12E
je 0xb26de
movl %edi, %ebx
cmpl $0xa, %eax
je 0xb2670
cmpl $0x1e, %eax
je 0xb26a7
testl %eax, %eax
jne 0xb2703
leaq 0x17530f(%rip), %rdi    # 0x227960
callq 0x9400
pushq $0xa
popq %r14
subl $0x1, %ebx
jb 0xb2703
movq (%r15), %rsi
movl %r14d, %edi
callq 0x9480
jmp 0xb265a
callq 0xb2dcd
testl %eax, %eax
je 0xb2691
movq (%r15), %rdi
leaq 0x65041(%rip), %rsi     # 0x1176c4
leaq 0x1752d6(%rip), %rdx    # 0x227960
xorl %eax, %eax
callq 0x9560
pushq $0xa
popq %r14
subl $0x1, %ebx
jb 0xb2703
movq (%r15), %rsi
movl %r14d, %edi
callq 0x9480
jmp 0xb2695
callq 0xb2dcd
testl %eax, %eax
je 0xb26c8
movq (%r15), %rdi
leaq 0x6500a(%rip), %rsi     # 0x1176c4
leaq 0x17529f(%rip), %rdx    # 0x227960
xorl %eax, %eax
callq 0x9560
pushq $0xa
popq %r14
subl $0x1, %ebx
jb 0xb2703
movq (%r15), %rsi
movl %r14d, %edi
callq 0x9480
jmp 0xb26cc
leaq 0x175d07(%rip), %rax    # 0x2283ec
cmpl $0x0, (%rax)
je 0xb2703
leaq 0x17526f(%rip), %rax    # 0x227960
leaq 0x64fd8(%rip), %rdx     # 0x1176d0
movq %rsi, %rdi
movq %rax, %rsi
callq 0xb2e38
leaq 0x175c86(%rip), %rbx    # 0x228390
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xb273c
leaq 0x175247(%rip), %rax    # 0x227960
cmpb $0x21, 0x1(%rax)
jne 0xb2737
leaq 0x64fb2(%rip), %rsi     # 0x1176d8
leaq 0x175233(%rip), %rdx    # 0x227960
xorl %eax, %eax
callq 0x9560
movq (%rbx), %rdi
callq 0x9420
leaq 0x175cdd(%rip), %rax    # 0x228420
cmpl $0x0, (%rax)
setne %al
movq (%r15), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xb2768
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9420
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: sync_log_file()
void sync_log_file()
{
   if(log_file == 0) return;

   if(log_fmt != HEATHER) {
      end_log_track();
      sync_file(log_file);
      start_log_track();
   }
   else {
      sync_file(log_file);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1755d1(%rip), %rbx    # 0x228360
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xb2dbb
leaq 0x1756aa(%rip), %rax    # 0x228448
cmpl $0x0, (%rax)
je 0xb2dc2
callq 0xb1bef
movq (%rbx), %rdi
callq 0xa6b9
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xb1947
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa6b9
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: filter_log_text()
int filter_log_text()
{
char *s;

   // remove potentially corrupting chars from log_text lines
   // returns 0 if resulting line is blank, 1 otherwise

   s = strchr(log_text, '!');
   while(s) {
      *s = ' ';
      s = strchr(s+1, '!');
   }

   s = strchr(log_text, '#');
   while(s) {
      *s = ' ';
      s = strchr(s+1, '#');
   }

   if(log_text[0] == 0) return 0;  // empty line
   if((log_text[0] == ' ') && (log_text[1] == 0)) return 0;  // blank line
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x174b86(%rip), %rax    # 0x227960
pushq $0x21
popq %rbx
movq %rax, %rdi
movl %ebx, %esi
callq 0x9100
testq %rax, %rax
je 0xb2df4
movb $0x20, (%rax)
incq %rax
jmp 0xb2ddd
leaq 0x174b65(%rip), %rax    # 0x227960
pushq $0x23
popq %rbx
movq %rax, %rdi
movl %ebx, %esi
callq 0x9100
testq %rax, %rax
je 0xb2e15
movb $0x20, (%rax)
incq %rax
jmp 0xb2dfe
leaq 0x174b44(%rip), %rcx    # 0x227960
movb (%rcx), %dl
testb %dl, %dl
je 0xb2e2f
xorb $0x20, %dl
xorl %eax, %eax
orb 0x1(%rcx), %dl
setne %al
jmp 0xb2e31
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_rinex_line(_IO_FILE*, char*, char*)
void write_rinex_line(FILE *file, char *s, char *type)
{
char buf[SLEN+1];

   // output a 60:20 character line to a RINEX file

   if(file == 0) return;
   if(s == 0) return;
   if(type == 0) return;

   sprintf(buf, "%-60.60s%-20.20s", s,type);
   buf[80] = 0;
   fprintf(file, "%s\n", buf);
}

// Assembly:
movq %rdx, %rcx
movq %rsi, %rdx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
testq %rcx, %rcx
sete %al
orb %sil, %al
jne 0xb2ea6
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
leaq 0x64842(%rip), %rsi     # 0x1176b3
leaq -0x110(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
movb $0x0, 0x50(%r14)
leaq 0x5cb91(%rip), %rsi     # 0x10fa1f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x9560
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_enviro_info()
void log_enviro_info()
{
   strcpy(log_text, "#");
   write_log_comment(1);

   if(enviro_type == HEATHER_ENVIRO) {
      sprintf(log_text, "#   Enviro type:   Heather Environmental Sensor");
   }
   else if(enviro_type == DOG_ENVIRO) {
      if(enviro_dev[0]) sprintf(log_text, "#   Enviro type:   %s", enviro_dev);
      else              sprintf(log_text, "#   Envito type:   Dogratian USB");
   }
   else if(enviro_type == LFS_ENVIRO) {
      if(enviro_dev[0]) sprintf(log_text, "#   Enviro type:   %s", enviro_dev);
      else              sprintf(log_text, "#   Enviro type:   LFS10xx");
   }
   else {
      sprintf(log_text, "#   Enviro type:   Environmental sensor");
   }
   write_log_comment(1);

   if(enviro_sn[0]) {
      sprintf(log_text, "#   Enviro serial: %s", enviro_sn);
      write_log_comment(1);
   }

   strcpy(log_text, "#");
   write_log_comment(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x174aac(%rip), %rbx    # 0x227960
movw $0x23, (%rbx)
pushq $0x1
popq %rdi
callq 0xb25f5
leaq 0x14fa4c(%rip), %rax    # 0x202914
movl (%rax), %eax
cmpl $0x1, %eax
je 0xb2f1b
cmpl $0x3, %eax
je 0xb2ef8
cmpl $0x2, %eax
jne 0xb2f45
movups 0x64823(%rip), %xmm0    # 0x117703
movaps %xmm0, 0x20(%rbx)
movups 0x64808(%rip), %xmm0    # 0x1176f3
movaps %xmm0, 0x10(%rbx)
movups 0x647ed(%rip), %xmm0    # 0x1176e3
jmp 0xb2f16
leaq 0x274361(%rip), %rax    # 0x327260
cmpb $0x0, (%rax)
jne 0xb2f27
movups 0x6484a(%rip), %xmm0    # 0x117755
movups %xmm0, 0xb(%rbx)
movups 0x64834(%rip), %xmm0    # 0x11774a
movaps %xmm0, (%rbx)
jmp 0xb2f83
leaq 0x27433e(%rip), %rax    # 0x327260
cmpb $0x0, (%rax)
je 0xb2f6a
leaq 0x174a32(%rip), %rdi    # 0x227960
leaq 0x647de(%rip), %rsi     # 0x117713
leaq 0x274324(%rip), %rdx    # 0x327260
xorl %eax, %eax
callq 0x9060
jmp 0xb2f83
movups 0x64829(%rip), %xmm0    # 0x117775
movaps %xmm0, 0x10(%rbx)
movups 0x6480e(%rip), %xmm0    # 0x117765
movaps %xmm0, (%rbx)
movabsq $0x726f736e657320, %rax # imm = 0x726F736E657320
movq %rax, 0x20(%rbx)
jmp 0xb2f83
movups 0x647c8(%rip), %xmm0    # 0x117739
movaps %xmm0, 0x10(%rbx)
movups 0x647ad(%rip), %xmm0    # 0x117729
movaps %xmm0, (%rbx)
movb $0x0, 0x20(%rbx)
pushq $0x1
popq %rdi
callq 0xb25f5
leaq 0x2742ee(%rip), %rax    # 0x327280
cmpb $0x0, (%rax)
je 0xb2fbb
leaq 0x1749c2(%rip), %rdi    # 0x227960
leaq 0x647e8(%rip), %rsi     # 0x11778d
leaq 0x2742d4(%rip), %rdx    # 0x327280
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %rdi
callq 0xb25f5
movw $0x23, (%rbx)
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xb25f5
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_cs_log(int, int, int)
void show_cs_log(int row,int col, int extended)
{
int i;
int count;

   vidstr(row,col, GREEN, "Log: Message");
   ++row;
   count = 0;
   for(i=cs_log_count-1; i>=0; i--) {
      if(cs_log_msg[i][0]) {
         vidstr(row,col, WHITE, &blanks[TEXT_COLS-LOG_MSG_LEN]);
         vidstr(row,col, WHITE, cs_log_msg[i]);
         ++row;
         ++count;
         if(count >= CS_LOG_SHOW) break;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
leaq 0x60773(%rip), %rcx     # 0x119d99
pushq $0xa
popq %rdx
movl %esi, -0x2c(%rbp)
callq 0xe2d2
leaq 0x14b2bc(%rip), %rax    # 0x2048f4
movl (%rax), %r13d
xorl %r15d, %r15d
leaq 0x14990b(%rip), %rdx    # 0x202f50
leaq 0x1491bc(%rip), %rsi    # 0x202808
leaq 0x26c9bd(%rip), %rdi    # 0x326010
movl -0x2c(%rbp), %ebx
incl %r14d
leal 0x1(%r13), %eax
imulq $0x22, %r13, %rcx
addq %rdx, %rcx
decl %eax
testl %eax, %eax
jle 0xb96c4
leaq -0x22(%rcx), %r12
decq %r13
cmpb $0x0, -0x22(%rcx)
movq %r12, %rcx
je 0xb9664
movslq (%rsi), %rax
leaq (%rax,%rdi), %rcx
addq $-0x20, %rcx
movl %r14d, %edi
movl %ebx, %esi
pushq $0xf
popq %rdx
callq 0xe2d2
movl %r14d, %edi
movl %ebx, %esi
pushq $0xf
popq %rdx
movq %r12, %rcx
callq 0xe2d2
leaq 0x26c967(%rip), %rdi    # 0x326010
leaq 0x149158(%rip), %rsi    # 0x202808
leaq 0x149899(%rip), %rdx    # 0x202f50
leal 0x1(%r15), %eax
cmpl $0x7, %r15d
movl %eax, %r15d
jb 0xb9656
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_cs_val(int, int, int)
void show_cs_val(int row,int col, int color)
{
char *s;
int i;

   s = strchr(out, ':');
   if(s == 0) return;

   i = s - &out[0] + 1;
   out[i] = 0;
   i = strlen(out);

   vidstr(row,col, WHITE, &blanks[TEXT_COLS-40]);
   vidstr(row,col, GREEN, out);
   vidstr(row,col+i+1, color, &out[i+1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r12d
movl %edi, %r14d
leaq 0x26cb30(%rip), %r15    # 0x326220
pushq $0x3a
popq %rsi
movq %r15, %rdi
callq 0x9100
testq %rax, %rax
je 0xb9774
subl %r15d, %eax
incl %eax
cltq
movb $0x0, (%r15,%rax)
movq %r15, %rdi
callq 0x9120
movq %rax, %r13
leaq 0x1490ea(%rip), %rax    # 0x202808
movslq (%rax), %rax
leaq 0x26c8e8(%rip), %rcx    # 0x326010
leaq -0x28(%rax,%rcx), %rcx
pushq $0xf
popq %rdx
movl %r14d, %edi
movl %r12d, %esi
callq 0xe2d2
pushq $0xa
popq %rdx
movl %r14d, %edi
movl %r12d, %esi
movq %r15, %rcx
callq 0xe2d2
leal (%r12,%r13), %esi
incl %esi
incl %r13d
movslq %r13d, %rcx
addq %r15, %rcx
movzbl %bl, %edx
movl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe2d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_lpfrs_xml(_IO_FILE*)
void log_lpfrs_xml(FILE *file)
{
   fprintf(file, "        <aa>%g</aa>\n", lpfrs_aa);
   fprintf(file, "        <bb>%g</bb>\n", lpfrs_bb);
   fprintf(file, "        <cc>%g</cc>\n", lpfrs_cc);
   fprintf(file, "        <dd>%g</dd>\n", lpfrs_dd);
   fprintf(file, "        <ee>%g</ee>\n", lpfrs_ee);
   fprintf(file, "        <ff>%g</ff>\n", lpfrs_ff);
   fprintf(file, "        <gg>%g</gg>\n", lpfrs_gg);
   fprintf(file, "        <hh>%g</hh>\n", lpfrs_hh);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x23d627(%rip), %rax    # 0x2f7d00
movsd (%rax), %xmm0
leaq 0x5fd98(%rip), %rsi     # 0x11a47c
movb $0x1, %al
callq 0x9560
leaq 0x23d606(%rip), %rax    # 0x2f7cf8
movsd (%rax), %xmm0
leaq 0x5fd94(%rip), %rsi     # 0x11a491
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d5e2(%rip), %rax    # 0x2f7cf0
movsd (%rax), %xmm0
leaq 0x5fd8d(%rip), %rsi     # 0x11a4a6
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d5be(%rip), %rax    # 0x2f7ce8
movsd (%rax), %xmm0
leaq 0x5fd86(%rip), %rsi     # 0x11a4bb
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d59a(%rip), %rax    # 0x2f7ce0
movsd (%rax), %xmm0
leaq 0x5fd7f(%rip), %rsi     # 0x11a4d0
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d576(%rip), %rax    # 0x2f7cd8
movsd (%rax), %xmm0
leaq 0x5fd78(%rip), %rsi     # 0x11a4e5
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d552(%rip), %rax    # 0x2f7cd0
movsd (%rax), %xmm0
leaq 0x5fd71(%rip), %rsi     # 0x11a4fa
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d52e(%rip), %rax    # 0x2f7cc8
movsd (%rax), %xmm0
leaq 0x5fd6a(%rip), %rsi     # 0x11a50f
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9560
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: log_sro_xml(_IO_FILE*)
void log_sro_xml(FILE *file)
{
   fprintf(file, "        <aa>%g</aa>\n", sro_aa);
   fprintf(file, "        <bb>%g</bb>\n", sro_bb);
   fprintf(file, "        <cc>%g</cc>\n", sro_cc);
   fprintf(file, "        <dd>%g</dd>\n", sro_dd);
   fprintf(file, "        <ee>%g</ee>\n", sro_ee);
   fprintf(file, "        <ff>%g</ff>\n", sro_ff);
   fprintf(file, "        <gg>%g</gg>\n", sro_gg);
   fprintf(file, "        <hh>%g</hh>\n", sro_hh);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x23d3d5(%rip), %rax    # 0x2f7ba0
movsd (%rax), %xmm0
leaq 0x5fca6(%rip), %rsi     # 0x11a47c
movb $0x1, %al
callq 0x9560
leaq 0x23d3b4(%rip), %rax    # 0x2f7b98
movsd (%rax), %xmm0
leaq 0x5fca2(%rip), %rsi     # 0x11a491
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d390(%rip), %rax    # 0x2f7b90
movsd (%rax), %xmm0
leaq 0x5fc9b(%rip), %rsi     # 0x11a4a6
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d36c(%rip), %rax    # 0x2f7b88
movsd (%rax), %xmm0
leaq 0x5fc94(%rip), %rsi     # 0x11a4bb
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d348(%rip), %rax    # 0x2f7b80
movsd (%rax), %xmm0
leaq 0x5fc8d(%rip), %rsi     # 0x11a4d0
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d324(%rip), %rax    # 0x2f7b78
movsd (%rax), %xmm0
leaq 0x5fc86(%rip), %rsi     # 0x11a4e5
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d300(%rip), %rax    # 0x2f7b70
movsd (%rax), %xmm0
leaq 0x5fc7f(%rip), %rsi     # 0x11a4fa
movq %rbx, %rdi
movb $0x1, %al
callq 0x9560
leaq 0x23d2dc(%rip), %rax    # 0x2f7b68
movsd (%rax), %xmm0
leaq 0x5fc78(%rip), %rsi     # 0x11a50f
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9560
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: utc_delta_t()
double utc_delta_t()
{
double dt;

   // return UTC delta T (in Julian days!)

   if(user_set_delta_t) dt = user_delta_t;
   else dt = jtime(0, 0, 51+utc_offset, 0.184);  // TDT is 51.184 seconds ahead of GPS

   return dt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x23a84b(%rip), %rax    # 0x2f74e8
cmpl $0x0, (%rax)
je 0xbccaf
leaq 0x23a847(%rip), %rax    # 0x2f74f0
movsd (%rax), %xmm0
jmp 0xbccdf
leaq 0x23aa72(%rip), %rax    # 0x2f7728
movl (%rax), %eax
addl $0x33, %eax
cvtsi2sd %eax, %xmm1
addsd 0x589e9(%rip), %xmm1    # 0x1156b0
divsd 0x36341(%rip), %xmm1    # 0xf3010
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
divsd 0x36361(%rip), %xmm0    # 0xf3040
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_error(char*, unsigned int)
void write_log_error(char *s, u32 val)
{
   if(log_file == 0) return;
   if(log_errors == 0) return;
   if(log_comments == 0) return;

   sprintf(log_text, "#! %s error: %u", s, (u32) val);
   write_log_comment(1);
}

// Assembly:
leaq 0x1662e7(%rip), %rax    # 0x228360
cmpq $0x0, (%rax)
je 0xc20be
leaq 0x166375(%rip), %rax    # 0x2283fb
cmpb $0x0, (%rax)
je 0xc20be
leaq 0x166382(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0xc20be
pushq %rbp
movq %rsp, %rbp
movl %esi, %ecx
movq %rdi, %rdx
leaq 0x1658b9(%rip), %rdi    # 0x227960
leaq 0x5a58b(%rip), %rsi     # 0x11c639
xorl %eax, %eax
callq 0x9060
pushq $0x1
popq %rdi
popq %rbp
jmp 0xb25f5
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_utc(int)
void write_log_utc(int utc_offset)
{
   // write UTC offset changes to the log file

   if(log_file == 0) return;
   if(log_comments == 0) return;
   if((have_info & INFO_LOGGED) == 0) { // log file header not written yet   
      if(user_set_log) return;   // keeps bogus UTC entry out of log file
   }

   sprintf(log_text,"#");
   write_log_comment(1);
   sprintf(log_text,"#! New UTC offset: %d seconds", utc_offset);
   write_log_comment(1);
   sprintf(log_text,"#");
   write_log_comment(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x16628f(%rip), %rax    # 0x228360
cmpq $0x0, (%rax)
je 0xc20fe
leaq 0x166336(%rip), %rax    # 0x228414
cmpb $0x0, (%rax)
je 0xc20fe
movl %edi, %ebx
leaq 0x235888(%rip), %rax    # 0x2f7974
testb $0x2, 0x1(%rax)
jne 0xc2107
leaq 0x166303(%rip), %rax    # 0x2283fc
cmpb $0x0, (%rax)
je 0xc2107
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x165852(%rip), %r14    # 0x227960
movw $0x23, %r12w
movw %r12w, (%r14)
pushq $0x1
popq %r15
movl %r15d, %edi
callq 0xb25f5
leaq 0x5a51f(%rip), %rsi     # 0x11c649
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movl %r15d, %edi
callq 0xb25f5
movw %r12w, (%r14)
movl %r15d, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xb25f5
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_leapsecond()
void write_log_leapsecond()
{
   // write leapsecond occurance in the log file

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

   month = fix_month(month);
   sprintf(log_text,"#! Leapsecond: %02d:%02d:%02d %s   %02d %s %04d - interval %ld secs", 
      hours,minutes,seconds, (time_flags & TFLAGS_UTC)?"UTC":"GPS", day,months[month],year, log_interval);
   write_log_comment(1);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x1657f9(%rip), %rbx    # 0x227960
movw $0x23, %ax
movw %ax, (%rbx)
pushq $0x1
popq %r14
movl %r14d, %edi
callq 0xb25f5
leaq 0x235357(%rip), %r12    # 0x2f74d8
movl (%r12), %edi
callq 0x68914
movl %eax, (%r12)
leaq 0x23533b(%rip), %rcx    # 0x2f74d0
movl (%rcx), %edx
leaq 0x23532e(%rip), %rcx    # 0x2f74cc
movl (%rcx), %ecx
leaq 0x235321(%rip), %rsi    # 0x2f74c8
leaq 0x2352f6(%rip), %rdi    # 0x2f74a4
testb $0x1, (%rdi)
leaq 0x5b659(%rip), %rdi     # 0x11d811
leaq 0x5cc0f(%rip), %r9      # 0x11edce
cmoveq %rdi, %r9
movl (%rsi), %r8d
leaq 0x235307(%rip), %rsi    # 0x2f74d4
movl (%rsi), %r10d
movslq %eax, %r11
leaq 0x92566(%rip), %r15     # 0x154740
leaq 0x2352fb(%rip), %rax    # 0x2f74dc
movl (%rax), %r13d
leaq 0x1431bd(%rip), %r12    # 0x2053a8
leaq 0x5a475(%rip), %rsi     # 0x11c667
movq %rbx, %rdi
xorl %eax, %eax
pushq (%r12)
pushq %r13
pushq (%r15,%r11,8)
pushq %r10
callq 0x9060
addq $0x20, %rsp
movl %r14d, %edi
callq 0xb25f5
movw $0x23, %ax
movw %ax, (%rbx)
movl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb25f5
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: restore_plot_config()
void restore_plot_config()
{
int i;

   if(showing_adv_file) { // restore all plots
      showing_adv_file = 0;
      for(i=0; i<NUM_PLOTS+DERIVED_PLOTS; i++) {
         plot[i].show_plot = plot[i].old_show;
      }
      plot_sat_count = old_sat_plot;
      plot_adev_data = old_adev_plot;
      if(plot_adev_data == 0) adev_decades_shown = 0;
      adev_period = xxx_adev_period;       // aaaaaapppppp other periods
      keep_adevs_fresh = old_keep_fresh;
   }
}

// Assembly:
leaq 0x262f48(%rip), %rax    # 0x3253f1
cmpb $0x0, (%rax)
je 0xc253a
movb $0x0, (%rax)
movl $0xc4, %eax
leaq 0x8586f(%rip), %rcx     # 0x147d30
cmpq $0x12e4, %rax           # imm = 0x12E4
je 0xc24db
movl (%rcx,%rax), %edx
movl %edx, -0xac(%rcx,%rax)
addq $0xe8, %rax
jmp 0xc24c1
pushq %rbp
movq %rsp, %rbp
leaq 0x262f0c(%rip), %rax    # 0x3253f2
movb (%rax), %al
leaq 0x142eec(%rip), %rcx    # 0x2053db
movb %al, (%rcx)
leaq 0x262efb(%rip), %rax    # 0x3253f3
movb (%rax), %al
leaq 0x142ed8(%rip), %rcx    # 0x2053d9
movb %al, (%rcx)
testb %al, %al
jne 0xc2511
leaq 0x1402b6(%rip), %rax    # 0x2027c4
andl $0x0, (%rax)
leaq 0x262ee0(%rip), %rax    # 0x3253f8
movsd (%rax), %xmm0
leaq 0x1647d5(%rip), %rax    # 0x226cf8
movsd %xmm0, (%rax)
leaq 0x262ec6(%rip), %rax    # 0x3253f4
movb (%rax), %al
leaq 0x164805(%rip), %rcx    # 0x226d3c
movb %al, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: jdate(int, int, int)
double jdate(int y, int m, int d)
{
long j;
long j1;
long j2;
long j3;
long c;
long x;

   // return the julian date of the start of a given day

   if(m < 3) {
      m = m + 12;
      j = y - 1;
   }
   else j = y;

   c = (j / 100L);
   x = j - (100L * c);
   j1 = (146097L * c) / 4L;
   j2 = (36525L * x) / 100L;
   j3 = ((153L*(long)m) - 457L) / 5L;
   return (1721119.5-1.0) + (double) j1 + (double) j2 + (double) j3 + (double) d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %ecx
leal 0xc(%rsi), %r8d
xorl %eax, %eax
cmpl $0x3, %esi
setl %al
cmovgel %esi, %r8d
subl %eax, %edi
movslq %edi, %rsi
movl $0x64, %edi
movl %esi, %eax
cltd
idivl %edi
cltq
imulq $-0x64, %rax, %rdi
addq %rsi, %rdi
imulq $0x23ab1, %rax, %rax    # imm = 0x23AB1
movabsq $0x4, %rsi
cqto
idivq %rsi
movq %rax, %rsi
imulq $0x8ead, %rdi, %rax     # imm = 0x8EAD
movabsq $0x64, %rdi
cqto
idivq %rdi
movq %rax, %rdi
movslq %r8d, %rax
imulq $0x99, %rax, %rax
addq $-0x1c9, %rax           # imm = 0xFE37
movabsq $0x5, %r8
cqto
cvtsi2sd %rsi, %xmm0
addsd 0x527a0(%rip), %xmm0    # 0x115730
idivq %r8
cvtsi2sd %rdi, %xmm1
addsd %xmm0, %xmm1
cvtsi2sd %rax, %xmm2
addsd %xmm1, %xmm2
cvtsi2sd %ecx, %xmm0
addsd %xmm2, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: xml_val(char*)
DATA_SIZE xml_val(char *line)
{
char *s;

   // get a numeric value from an XML data point line

   if(line == 0) return 0.0;

   s = strchr(line, '>');

   if(s == 0) return 0.0;
   else if(s[0] == 0) return 0.0;
   else return (DATA_SIZE) atof(s+1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0xc300c
pushq $0x3e
popq %rsi
callq 0x9100
testq %rax, %rax
je 0xc300c
cmpb $0x0, (%rax)
je 0xc300c
incq %rax
movq %rax, %rdi
popq %rbp
jmp 0x9470
xorps %xmm0, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: xml_string(char*)
char *xml_string(char *line)
{
char *s;
char *s2;

   // get a string value from an XML data point line

   if(line == 0) return "";

   s = strchr(line, '>');
   if(s == 0) return "";
   else if(s[0] == 0) return "";

   s2 = strchr(s, '<');
   if(s2) *s2 = 0;

   return s+1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x58997(%rip), %rbx     # 0x11b9b6
testq %rdi, %rdi
je 0xc3052
pushq $0x3e
popq %rsi
callq 0x9100
testq %rax, %rax
je 0xc3052
movq %rax, %r14
cmpb $0x0, (%rax)
je 0xc3052
pushq $0x3c
popq %rsi
movq %r14, %rdi
callq 0x9100
testq %rax, %rax
je 0xc304c
movb $0x0, (%rax)
incq %r14
movq %r14, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: set_log_title(char*)
void set_log_title(char *plot_title)
{
int i;

   // set the plot title string from info in a log file
   if(plot_title == 0) return;

   i = strlen(plot_title);

   if(i && (plot_title[i-1] == 0x0D)) plot_title[i-1] = 0;
   if(i && (plot_title[i-1] == 0x0A)) plot_title[i-1] = 0;
   if(plot_title[0]) title_type = USER;
   else              title_type = NONE;

   saw_log_title = 1;
   show_title();
   refresh_page();
}

// Assembly:
testq %rdi, %rdi
je 0xc5982
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9120
testl %eax, %eax
je 0xc5955
decl %eax
cltq
movzbl (%rbx,%rax), %ecx
cmpl $0xd, %ecx
je 0xc5951
cmpl $0xa, %ecx
jne 0xc5955
movb $0x0, (%rbx,%rax)
xorl %eax, %eax
cmpb $0x0, (%rbx)
setne %al
addl %eax, %eax
leaq 0x263966(%rip), %rcx    # 0x3292cc
movl %eax, (%rcx)
movl $0x1, 0x29ed02(%rip)    # 0x364674
callq 0x1747f
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xaa05
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: read_tie_file(char*)
void read_tie_file(char *s)
{
FILE *tie_file;
double cha, chb, chc, chd;
int n;
int count;

   // stop recording live signal strength data and load in signal strength 
   // data from a log file

   tie_file = topen(s, "r");
   if(tie_file == 0) return;

   ATYPE = A_MTIE;
   if(rcvr_type == TICC_RCVR) all_adevs = ALL_CHANS;
   else                       all_adevs = SINGLE_ADEVS;
   alloc_mtie(10);

   count = 0;

   while(fgets(out, sizeof out, tie_file) != NULL) {
      if((out[0] == '*') || (out[0] == ';') || (out[0] == '/') || (out[0] == '#')) {
         continue;  // comment line
      }
      n = sscanf(out, "%lg %lg %lg %lg", &cha, &chb, &chc, &chd);
      if(n >= 1) add_mtie_point(CHA_MTIE, cha);
      if(n >= 2) add_mtie_point(CHB_MTIE, chb);
      if(n >= 3) add_mtie_point(CHC_MTIE, chc);
      if(n >= 4) add_mtie_point(CHD_MTIE, chd);
      if(++count > adev_q_size) break;
   }

   fclose(tie_file);

   find_global_max();
   force_adev_redraw(10);
   config_screen(108);
   if(adevs_active(0)) last_was_adev = 'I';

// show_all_adevs();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x44501(%rip), %rsi     # 0x10acd5
callq 0x9a22
testq %rax, %rax
je 0xc6913
movq %rax, %rbx
leaq 0x146e24(%rip), %rax    # 0x20d610
movl $0x9, (%rax)
leaq 0x13c0d7(%rip), %rax    # 0x2028d0
xorl %ecx, %ecx
cmpq $0x10000, (%rax)        # imm = 0x10000
sete %cl
leal (%rcx,%rcx,4), %eax
leaq 0x16052f(%rip), %rcx    # 0x226d3e
movb %al, (%rcx)
callq 0xc6922
leaq 0x25fa03(%rip), %r14    # 0x326220
leaq 0x567f4(%rip), %r13     # 0x11d018
movabsq $0x800840800000000, %r12 # imm = 0x800840800000000
xorl %r15d, %r15d
movq %r14, %rdi
movl $0x201, %esi            # imm = 0x201
movq %rbx, %rdx
callq 0x9600
testq %rax, %rax
je 0xc68e1
movzbl (%r14), %eax
cmpq $0x3b, %rax
ja 0xc685a
btq %rax, %r12
jb 0xc6831
movq %r14, %rdi
movq %r13, %rsi
leaq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x30(%rbp), %r9
xorl %eax, %eax
callq 0x9350
testl %eax, %eax
jle 0xc68c3
movl %eax, %r13d
movsd -0x48(%rbp), %xmm0
xorl %edi, %edi
callq 0xc696a
cmpl $0x1, %r13d
je 0xc68c3
movsd -0x40(%rbp), %xmm0
pushq $0x1
popq %rdi
callq 0xc696a
cmpl $0x3, %r13d
jb 0xc68c3
movsd -0x38(%rbp), %xmm0
pushq $0x2
popq %rdi
callq 0xc696a
cmpl $0x3, %r13d
je 0xc68c3
movsd -0x30(%rbp), %xmm0
pushq $0x3
popq %rdi
callq 0xc696a
leaq 0x1(%r15), %rax
leaq 0x16040a(%rip), %rcx    # 0x226cd8
cmpq %r15, (%rcx)
movq %rax, %r15
leaq 0x5673d(%rip), %r13     # 0x11d018
jg 0xc6831
movq %rbx, %rdi
callq 0x9360
callq 0xc6cd3
callq 0xc7144
pushq $0x6c
popq %rdi
callq 0xcc4f
xorl %edi, %edi
callq 0xc71ad
testl %eax, %eax
je 0xc6913
leaq 0x13e9f7(%rip), %rax    # 0x205304
movl $0x49, (%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: alloc_mtie(int)
void alloc_mtie(int why)
{
   alloc_mtie_data(CHA_MTIE, adev_q_size);
   alloc_mtie_data(CHB_MTIE, adev_q_size);
   alloc_mtie_data(CHC_MTIE, adev_q_size);
   alloc_mtie_data(CHD_MTIE, adev_q_size);
   mtie_allocated = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1603a9(%rip), %rbx    # 0x226cd8
movl (%rbx), %esi
xorl %edi, %edi
callq 0xe81d4
movl (%rbx), %esi
pushq $0x1
popq %rdi
callq 0xe81d4
movl (%rbx), %esi
pushq $0x2
popq %rdi
callq 0xe81d4
movl (%rbx), %esi
pushq $0x3
popq %rdi
callq 0xe81d4
leaq 0x160387(%rip), %rax    # 0x226ce4
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: force_adev_redraw(int)
void force_adev_redraw(int why)
{
    // force a redraw of the the adev tables and graphs
    have_time = 0;
    pps_adev_disp = ADEV_DISPLAY_RATE;
    osc_adev_disp = ADEV_DISPLAY_RATE;
    chc_adev_disp = ADEV_DISPLAY_RATE;
    chd_adev_disp = ADEV_DISPLAY_RATE;

    max_adev_width = 0;    // recalc table sizes
    adev_page_size = 0;
    adev_table_rows = 0;

    update_adev_display(ATYPE, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x161d8d(%rip), %rax    # 0x228edc
movb $0x0, (%rax)
leaq 0x15f9f7(%rip), %rax    # 0x226b50
movl $0xa, %ecx
movl %ecx, (%rax)
leaq 0x15fa39(%rip), %rax    # 0x226ba0
movl %ecx, (%rax)
leaq 0x15fa80(%rip), %rax    # 0x226bf0
movl %ecx, (%rax)
leaq 0x15fabf(%rip), %rax    # 0x226c38
movl %ecx, (%rax)
leaq 0x15fb0a(%rip), %rax    # 0x226c8c
andl $0x0, (%rax)
leaq 0x13b630(%rip), %rax    # 0x2027bc
andl $0x0, (%rax)
leaq 0x13b62a(%rip), %rax    # 0x2027c0
andl $0x0, (%rax)
leaq 0x146470(%rip), %rax    # 0x20d610
movl (%rax), %edi
movl $0x1, %esi
popq %rbp
jmp 0xed5f1
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: read_rawfile(char*)
int read_rawfile(char *s)
{
long seek_addr;

   // load a .raw capture file and treat it as a simulation file

   if(s == 0) return 0;
   strcpy(sim_name, s);

   s = strchr(sim_name, ',');
   if(s) {  // seek offset set
      *s = 0;
      seek_addr = (long) atoi(s+1);
   }
   else seek_addr = 0;

   sim_file = topen(sim_name, "rb");
   if(sim_file == 0) return 1;
   if(rcvr_type != CS_RCVR) sim_file_read |= 0x01;

   kbd_sim = 1;  // flag that a keyboard command opened the simulation file
   fseek(sim_file, seek_addr, SEEK_SET);
   sim_eof = 0;

   return 2;
}

// Assembly:
testq %rdi, %rdi
je 0xc74b1
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rsi
leaq 0x1600da(%rip), %rbx    # 0x227560
movq %rbx, %rdi
callq 0x9330
pushq $0x2c
popq %rsi
movq %rbx, %rdi
callq 0x9100
testq %rax, %rax
je 0xc74b4
movb $0x0, (%rax)
incq %rax
movq %rax, %rdi
callq 0x95e0
movslq %eax, %rbx
jmp 0xc74b6
xorl %eax, %eax
retq
xorl %ebx, %ebx
leaq 0x1600a3(%rip), %rdi    # 0x227560
leaq 0x40c94(%rip), %rsi     # 0x108158
callq 0x9a22
leaq 0x160ef0(%rip), %rcx    # 0x2283c0
movq %rax, (%rcx)
testq %rax, %rax
je 0xc751a
leaq 0x13b3f1(%rip), %rcx    # 0x2028d0
cmpq $0x20000, (%rcx)        # imm = 0x20000
je 0xc74f2
leaq 0x14611d(%rip), %rcx    # 0x20d60c
orb $0x1, (%rcx)
leaq 0x160ee7(%rip), %rcx    # 0x2283e0
movl $0x1, (%rcx)
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x93d0
leaq 0x160ec5(%rip), %rax    # 0x2283d8
andl $0x0, (%rax)
pushq $0x2
jmp 0xc751c
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: read_signals(char*)
void read_signals(char *s)
{
FILE *sig_file;
float az, el, sig;

   // stop recording live signal strength data and load in signal strength 
   // data from a log file

   sig_file = topen(s, "r");
   if(sig_file == 0) return;
   clear_signals();       // flush the old data
   
   plot_signals = 4;      // show the pretty color map

   while(fgets(out, sizeof out, sig_file) != NULL) {
      if((out[0] == '*') || (out[0] == ';') || (out[0] == '/') || (out[0] == '#')) {
         continue;  // comment line
      }
      sscanf(out, "%f %f %f", &az, &el, &sig);
      log_signal(az, el, sig, 0);
   }

   fclose(sig_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x41704(%rip), %rsi     # 0x10acd5
callq 0x9a22
testq %rax, %rax
je 0xc966a
movq %rax, %rbx
callq 0xe3ba8
leaq 0x13be27(%rip), %rax    # 0x205415
movb $0x4, (%rax)
leaq 0x25cc28(%rip), %r14    # 0x326220
leaq -0x30(%rbp), %r13
leaq -0x2c(%rbp), %r15
movabsq $0x800840800000000, %r12 # imm = 0x800840800000000
movq %r14, %rdi
movl $0x201, %esi            # imm = 0x201
movq %rbx, %rdx
callq 0x9600
testq %rax, %rax
je 0xc9662
movzbl (%r14), %eax
cmpq $0x3b, %rax
ja 0xc962f
btq %rax, %r12
jb 0xc960a
movq %r14, %rdi
leaq 0x55a96(%rip), %rsi     # 0x11f0cf
leaq -0x34(%rbp), %rdx
movq %r13, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x9350
movss -0x34(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
xorl %edi, %edi
callq 0xe3d50
jmp 0xc960a
movq %rbx, %rdi
callq 0x9360
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: read_prn(char*)
void read_prn(char *s)
{
FILE *prn_file;
double jd;
int prn;
float az, el, sig;

   // load in satellie time, prn, az, el, signal strength 
   // data from a .prn file

   prn_file = topen(s, "r");
   if(prn_file == 0) return;

   while(fgets(out, sizeof out, prn_file) != NULL) {
      if((out[0] == '*') || (out[0] == ';') || (out[0] == '/') || (out[0] == '#')) {
         continue;  // comment line
      }
      sscanf(out, "%lf %d %f %f %f", &jd, &prn, &az, &el, &sig);
      log_signal(az, el, sig, 0);   // !!!!! do something with this data?
   }

   fclose(prn_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x41644(%rip), %rsi     # 0x10acd5
callq 0x9a22
testq %rax, %rax
je 0xc9727
movq %rax, %rbx
leaq 0x25cb77(%rip), %r14    # 0x326220
leaq -0x34(%rbp), %r15
leaq -0x30(%rbp), %r12
movabsq $0x800840800000000, %r13 # imm = 0x800840800000000
movq %r14, %rdi
movl $0x201, %esi            # imm = 0x201
movq %rbx, %rdx
callq 0x9600
testq %rax, %rax
je 0xc971f
movzbl (%r14), %eax
cmpq $0x3b, %rax
ja 0xc96e0
btq %rax, %r13
jb 0xc96bb
leaq -0x2c(%rbp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
leaq 0x559d6(%rip), %rsi     # 0x11f0c8
leaq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x9350
movss -0x34(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
xorl %edi, %edi
callq 0xe3d50
jmp 0xc96bb
movq %rbx, %rdi
callq 0x9360
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: bump_time()
void bump_time(void)
{
  // add one second to current time value
  month = fix_month(month);
  if(++seconds >= 60) {
     seconds = 0;
     if(++minutes >= 60) {
        minutes = 0;
        if(++hours >= 24) {
           hours = 0;
           if(++day > dim[month]) {
              day = 1;
              if(++month > 12) {
                 month = 1;
                 ++year;
              }
           }
        }
     }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x22d425(%rip), %rbx    # 0x2f74d8
movl (%rbx), %edi
callq 0x68914
movl %eax, (%rbx)
leaq 0x22d405(%rip), %rcx    # 0x2f74c8
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
cmpl $0x3b, %edx
jl 0xca13a
andl $0x0, (%rcx)
leaq 0x22d3f3(%rip), %rcx    # 0x2f74cc
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
cmpl $0x3b, %edx
jl 0xca13a
andl $0x0, (%rcx)
leaq 0x22d3e1(%rip), %rcx    # 0x2f74d0
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
cmpl $0x17, %edx
jl 0xca13a
andl $0x0, (%rcx)
leaq 0x22d3cf(%rip), %rcx    # 0x2f74d4
movl (%rcx), %edx
leal 0x1(%rdx), %esi
movl %esi, (%rcx)
movslq %eax, %rsi
leaq 0x8a5ea(%rip), %rdi     # 0x154700
cmpl (%rdi,%rsi,4), %edx
jl 0xca13a
movl $0x1, (%rcx)
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
cmpl $0xc, %eax
jl 0xca13a
movl $0x1, (%rbx)
leaq 0x22d3a4(%rip), %rax    # 0x2f74dc
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: glonass_prn(int)
int glonass_prn(int prn)
{
   if(rcvr_type == GPSD_RCVR) { // we don't know the actual receiver type GPSD is using 
      return 0;
   }
   else if(rcvr_type == ESIP_RCVR) {
      if(prn < 65) return 0;
      if(prn > 92) return 0;
   }
   else {
      if(prn < 65) return 0;
      if(prn > 96) return 0;
   }
   return (prn-64);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1386f5(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
xorl %eax, %eax
cmpq $0x200, %rcx            # imm = 0x200
je 0xca200
movl $0x80000000, %edx       # imm = 0x80000000
cmpq %rdx, %rcx
jne 0xca202
leal -0x5d(%rdi), %ecx
cmpl $-0x1c, %ecx
jb 0xca200
addl $-0x40, %edi
movl %edi, %eax
popq %rbp
retq
leal -0x61(%rdi), %ecx
cmpl $-0x20, %ecx
jae 0xca1fb
jmp 0xca200