LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: fmt_temp(double)
char *fmt_temp(double temp)
{
static char buf[SLEN];
double val;

   val = scale_temp(temp);
   if     (round_temp == 1) sprintf(buf, "%.1f %c%c", val, DEGREES, DEG_SCALE);
   else if(round_temp == 2) sprintf(buf, "%.2f %c%c", val, DEGREES, DEG_SCALE);
   else if(round_temp == 3) sprintf(buf, "%.3f %c%c", val, DEGREES, DEG_SCALE);
   else if(round_temp == 4) sprintf(buf, "%.4f %c%c", val, DEGREES, DEG_SCALE);
   else if(round_temp == 5) sprintf(buf, "%.5f %c%c", val, DEGREES, DEG_SCALE);
   else {
      if((rcvr_type == THERMO_RCVR) || (enviro_mode() && (have_temperature == 0))) {  // flag external temp sensor with upper case
         sprintf(buf, "%.5f %c%c", val, DEGREES, DEG_SCALE);
      }
      else {
         sprintf(buf, "%.6f %c%c", val, DEGREES, DEG_SCALE);
      }
   }
   return &buf[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x12952
movl 0x2e4288(%rip), %eax    # 0x2f6c88
decl %eax
cmpl $0x5, %eax
jae 0x12a19
movl %eax, %eax
leaq 0xe0bbc(%rip), %rcx     # 0xf35cc
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x12a5d
cmpq $0x80000, 0x1efeac(%rip) # imm = 0x80000
jne 0x12a2f
leaq 0xe196f(%rip), %rsi     # 0xf439c
jmp 0x12a5d
movsd %xmm0, -0x10(%rbp)
callq 0x57eca
movsd -0x10(%rbp), %xmm0
cmpl $0x0, 0x2e4807(%rip)    # 0x2f724c
leaq 0xe1950(%rip), %rsi     # 0xf439c
leaq 0xe1953(%rip), %rcx     # 0xf43a6
cmovneq %rcx, %rsi
testl %eax, %eax
cmoveq %rcx, %rsi
movsbl 0x2e4541(%rip), %ecx    # 0x2f6fa5
leaq 0x3177f5(%rip), %rbx    # 0x32a260
pushq $0x1
popq %rdx
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: fmt_pressure(double)
char *fmt_pressure(double pressure)
{
static char buf[SLEN];
double val;

   val = scale_pressure(pressure);
   if(HG_PRESS) sprintf(buf, "%.5f %s", val, "Hg");
   else         sprintf(buf, "%.5f %s", val, "mb");
   return &buf[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x2e4501(%rip), %rax    # 0x2f6fa8
cmpb $0x66, (%rax)
jne 0x12acb
mulsd 0xe060c(%rip), %xmm0    # 0xf30c0
leaq 0x3178a5(%rip), %rdi    # 0x32a360
leaq 0xe1daf(%rip), %rsi     # 0xf4871
leaq 0x101563(%rip), %rdx    # 0x11402c
jmp 0x12ae0
leaq 0x31788e(%rip), %rdi    # 0x32a360
leaq 0xe1d98(%rip), %rsi     # 0xf4871
leaq 0x10c389(%rip), %rdx    # 0x11ee69
movb $0x1, %al
callq 0x9060
leaq 0x317872(%rip), %rax    # 0x32a360
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: fmt_secs(double)
char *fmt_secs(double val)
{
static char buf[SLEN];
long secs;
char c1,c2;
int nav_flag;

   if(cursor_time_ref & 0x01) {  // time since start of displayed data
      c1 = '[';
      c2 = ']';
   }
   else {                 // time since start of capture
      c1 = '<';
      c2 = '>';
   }

   secs = (int) (val + 0.50);
   nav_flag = (((DATA_SIZE) (int) nav_rate) != nav_rate);

   if(cursor_time_ref & 0x02) {  // always show time as seconds
      if(nav_flag) {
         sprintf(buf, "%c%.1fs%c", c1, val, c2);
      }
      else {
         sprintf(buf, "%c%lds%c", c1, secs, c2);
      }
   }
   else if(nav_flag) {
      sprintf(buf, "%c%.1fs%c", c1, val, c2);
   }
   else if(secs < 60L) {
      sprintf(buf, "%c%lds%c", c1, secs, c2);
   }
   else if(secs < 60L*60L) {
      sprintf(buf, "%c%ldm%lds%c", c1, secs/60L, secs%60L, c2);
   }
   else {
      sprintf(buf, "%c%ldh%ldm%lds%c", c1, (secs/(60L*60L)), (secs/60L)%60L, secs%60L, c2);
   }

   return &buf[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl 0x1f27a2(%rip), %edx    # 0x2052a0
testb $0x1, %dl
pushq $0x3e
popq %rax
pushq $0x5d
popq %r9
cmovel %eax, %r9d
pushq $0x3c
popq %rax
pushq $0x5b
popq %r8
cmovel %eax, %r8d
movsd 0xe0549(%rip), %xmm1    # 0xf3068
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movsd 0x1f2829(%rip), %xmm1   # 0x205358
cvttpd2dq %xmm1, %xmm2
movslq %eax, %rcx
cvtdq2pd %xmm2, %xmm2
testb $0x2, %dl
jne 0x12b81
ucomisd %xmm2, %xmm1
jne 0x12b89
jp 0x12b89
cmpl $0x3b, %eax
jle 0x12ba6
cmpl $0xe0f, %eax            # imm = 0xE0F
ja 0x12bce
pushq $0x3c
popq %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r10
leaq 0x3178f8(%rip), %rdi    # 0x32a460
leaq 0xe1854(%rip), %rsi     # 0xf43c3
movl %r8d, %edx
movq %rax, %rcx
movq %r10, %r8
xorl %eax, %eax
callq 0x9060
jmp 0x12bc1
ucomisd %xmm2, %xmm1
jne 0x12b89
jnp 0x12ba6
leaq 0x3178d0(%rip), %rdi    # 0x32a460
leaq 0xe1819(%rip), %rsi     # 0xf43b0
movl %r8d, %edx
movl %r9d, %ecx
movb $0x1, %al
callq 0x9060
jmp 0x12bc1
leaq 0x3178b3(%rip), %rdi    # 0x32a460
leaq 0xe1806(%rip), %rsi     # 0xf43ba
movl %r8d, %edx
movl %r9d, %r8d
xorl %eax, %eax
callq 0x9060
leaq 0x317898(%rip), %rax    # 0x32a460
addq $0x10, %rsp
popq %rbp
retq
movl $0xe10, %esi            # imm = 0xE10
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rax, %r10
pushq $0x3c
popq %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r11
xorl %edx, %edx
divq %rsi
movq %rdx, %rax
movl %r9d, (%rsp)
leaq 0x317861(%rip), %rdi    # 0x32a460
leaq 0xe17ca(%rip), %rsi     # 0xf43d0
movl %r8d, %edx
movq %r10, %rcx
movq %rax, %r8
movq %r11, %r9
xorl %eax, %eax
callq 0x9060
jmp 0x12bc1
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: trend_value(int, double)
DATA_SIZE trend_value(int plot, double t)
{
double r;
double a0, a1;
double sxx,syy,sxy;

   // calculate linear regression trend line slope and offset

   sxy = resid[plot].sum_xy - ((resid[plot].sum_x*resid[plot].sum_y)/resid[plot].resid_count);
   syy = resid[plot].sum_yy - ((resid[plot].sum_y*resid[plot].sum_y)/resid[plot].resid_count);
   sxx = resid[plot].sum_xx - ((resid[plot].sum_x*resid[plot].sum_x)/resid[plot].resid_count);

   if(sxx == 0.0F) {
      a1 = a0 = 0.0;
   }
   else {
      a1 = (sxy / sxx);
      a0 = (resid[plot].sum_y/resid[plot].resid_count) - (resid[plot].a1*(resid[plot].sum_x/resid[plot].resid_count));
   }

//if(plot == PPS) sprintf(debug_text2, "t:%f  a0:%.12f a1:%.12f", t,a0,a1);

   resid[plot].a0 = a0;
   resid[plot].a1 = a1;

   r = (a0 + (a1 * t));
   return (DATA_SIZE) r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edi, %rcx
shlq $0x6, %rcx
leaq 0x316552(%rip), %rdx    # 0x329850
leaq (%rdx,%rcx), %rax
movsd (%rcx,%rdx), %xmm1
movsd 0x10(%rcx,%rdx), %xmm5
movsd 0x38(%rcx,%rdx), %xmm4
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
divsd %xmm4, %xmm2
subsd %xmm2, %xmm5
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm5
xorpd %xmm3, %xmm3
jne 0x13333
jnp 0x13362
movsd 0x8(%rax), %xmm3
movsd 0x20(%rax), %xmm2
movapd %xmm1, %xmm6
mulsd %xmm3, %xmm6
divsd %xmm4, %xmm6
subsd %xmm6, %xmm2
divsd %xmm5, %xmm2
divsd %xmm4, %xmm3
divsd %xmm4, %xmm1
mulsd 0x30(%rax), %xmm1
subsd %xmm1, %xmm3
movsd %xmm3, 0x28(%rax)
movsd %xmm2, 0x30(%rax)
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: tie_plot(int)
int tie_plot(int id)
{
   // return true if plot *id* is a time interval error plot

   if(rcvr_type == TICC_RCVR) {
      if((id == PPS) || (id == OSC) || (id == SEVEN) || (id == EIGHT)) return 1;
   }
   else if(((have_pps_offset == 0) || (have_pps_offset == 55)) && have_lars_pps) {
      if(id == PPS) return 1;
   }
   else if(rcvr_type == PRS_RCVR) {
      if(id == OSC) return 1;
   }
else if(0 && (rcvr_type == X72_RCVR)) {
   if(id == PPS) return 1;
}

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x1ef54f(%rip), %rax    # 0x2028d0
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x1339f
cmpl $0xb, %edi
ja 0x133c1
movl $0xc03, %eax            # imm = 0xC03
btl %edi, %eax
jae 0x133c1
movl $0x1, %eax
jmp 0x133c3
movl 0x2e3e93(%rip), %ecx    # 0x2f7238
testl %ecx, %ecx
setne %dl
cmpl $0x37, %ecx
setne %cl
testb %cl, %dl
jne 0x133c5
cmpl $0x0, 0x2e3695(%rip)    # 0x2f6a50
je 0x133c5
testl %edi, %edi
je 0x13398
xorl %eax, %eax
popq %rbp
retq
cmpq $0x1000000, %rax        # imm = 0x1000000
sete %al
cmpl $0x1, %edi
sete %cl
testb %al, %cl
jne 0x13398
jmp 0x133c1
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: plot_axes()
void plot_axes()
{
   // draw the plot background grid and label info
   if(first_key) return;   // plot area is in use for help/warning message

   erase_plot(ERASE_GRAPH_AREA);          // erase plot area
   if(read_only || just_read || no_send) {
      show_version_header();
   }

   if(no_plots) ;
   else if(rcvr_type == NO_RCVR) ;
   else {
      show_queue_info();      // show the queue stats
      if((text_mode == 0) && ((zoom_screen == 0) || (zoom_screen == 'P'))) {
         show_view_info();    // display the plot view settings
         show_plot_grid();    // display the plot grid
      }
   }
   show_title();           // display the plot title
}

// Assembly:
cmpl $0x0, 0x2117e3(%rip)    # 0x228f58
je 0x17778
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0xeaef
cmpb $0x0, 0x309890(%rip)    # 0x32101a
jne 0x1779e
cmpb $0x0, 0x309885(%rip)    # 0x321018
jne 0x1779e
cmpb $0x0, 0x30987d(%rip)    # 0x321019
je 0x177a3
callq 0x68b5b
cmpl $0x0, 0x3125be(%rip)    # 0x329d68
jne 0x177e1
cmpq $0x400, 0x1eb119(%rip) # imm = 0x400
je 0x177e1
callq 0x16531
cmpl $0x0, 0x1eb013(%rip)    # 0x2027d8
jne 0x177e1
movzbl 0x2defda(%rip), %eax    # 0x2f67a8
cmpl $0x50, %eax
je 0x177d7
testl %eax, %eax
jne 0x177e1
callq 0x1697a
callq 0x16c79
popq %rbp
jmp 0x1747f
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: round_scale(double)
DATA_SIZE round_scale(DATA_SIZE val)
{
double decade;

   // round the scale factor to a 1 2 (2.5) 5  sequence
   for(decade=1.0E-15; decade<=1.0E15; decade*=10.0) {
      if(val <= decade)       return (DATA_SIZE) decade;
      if(val <= (decade*2.0)) return (DATA_SIZE) (decade*2.0);
//    if(val <= (decade*2.5)) if(decade >= 10.0) return (DATA_SIZE) (decade*2.5);
      if(val <= (decade*2.5)) return (DATA_SIZE) (decade*2.5);
      if(val <= (decade*5.0)) return (DATA_SIZE) (decade*5.0);
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0xdb935(%rip), %xmm2    # 0xf3128
movsd 0xdb935(%rip), %xmm3    # 0xf3130
movsd 0xdb935(%rip), %xmm4    # 0xf3138
movsd 0xdb935(%rip), %xmm5    # 0xf3140
movsd 0xdb895(%rip), %xmm6    # 0xf30a8
ucomisd %xmm2, %xmm3
jb 0x1784f
ucomisd %xmm0, %xmm2
jae 0x17855
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jae 0x17859
movapd %xmm2, %xmm1
mulsd %xmm4, %xmm1
ucomisd %xmm0, %xmm1
jae 0x17859
movapd %xmm2, %xmm1
mulsd %xmm5, %xmm1
ucomisd %xmm0, %xmm1
jae 0x17859
mulsd %xmm6, %xmm2
jmp 0x17813
movapd %xmm0, %xmm1
jmp 0x17859
movapd %xmm2, %xmm1
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: plot_y(double, int, int)
int plot_y(DATA_SIZE val, int last_y, int color)
{
int py;

   // draw a data point on the plot
   py = (int) (val * (DATA_SIZE) VERT_MAJOR);
   if(py >= PLOT_CENTER) {  // point is off the top of the plot area
      off_scale |= 0x01;
      py = PLOT_ROW;
   }
   else if(py <= (-PLOT_CENTER)) {  // point is off the bottom of the plot area
      off_scale |= 0x02;
      py = PLOT_ROW+PLOT_CENTER+PLOT_CENTER;
   }
   else {  // point is in the plot area
      py = (PLOT_ROW+PLOT_CENTER) - py;
   }

   if(plot_dot) dot(PLOT_COL+plot_column,py, color);
   else         line(PLOT_COL+last_plot_col,last_y,  PLOT_COL+plot_column,py, color);

   return py;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cvtsi2sdl 0x1eada1(%rip), %xmm1 # 0x20286c
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl %edi, %eax
movl 0x1eadb9(%rip), %ebx    # 0x202894
movl %ebx, %ecx
subl %edx, %ecx
jle 0x17af3
movl %ebx, %edi
negl %edi
cmpl %edi, %edx
jle 0x17b02
addl 0x1ead8d(%rip), %ecx    # 0x20287c
movl %ecx, %ebx
jmp 0x17b11
orb $0x1, 0x1ed8dd(%rip)    # 0x2053d7
movl 0x1ead7c(%rip), %ebx    # 0x20287c
jmp 0x17b11
orb $0x2, 0x1ed8ce(%rip)    # 0x2053d7
addl %ebx, %ebx
addl 0x1ead6b(%rip), %ebx    # 0x20287c
cmpb $0x0, 0x312a4c(%rip)    # 0x32a564
movl 0x1ead62(%rip), %ecx    # 0x202880
je 0x17b35
addl 0x1ed8a6(%rip), %ecx    # 0x2053cc
movzbl %sil, %edx
movl %ecx, %edi
movl %ebx, %esi
callq 0xe1a7
jmp 0x17b52
movl 0x312a25(%rip), %edi    # 0x32a560
addl %ecx, %edi
addl 0x1ed889(%rip), %ecx    # 0x2053cc
movzbl %sil, %r8d
movl %eax, %esi
movl %ecx, %edx
movl %ebx, %ecx
callq 0xdedf
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: config_lla_zoom(int)
void config_lla_zoom(int why)
{
    if(rcvr_type == CS_RCVR) un_zoom = UN_ZOOM;

    change_zoom_config(4);

    if(rcvr_type == CS_RCVR) {
       zoom_screen = 'D';
    }
    else {
       zoom_screen = 'L';
       zoom_fixes = show_fixes;
       show_fixes = 1;
       change_fix_config(show_fixes);
       if(show_fixes && (precision_survey == 0)) {  // set reference position for fix map
          precise_lat = lat;
          precise_lon = lon;
          precise_alt = alt;
          have_precise_lla = (-1);
          if(user_set_ref_lla == 0) {
             ref_lat = lat;
             ref_lon = lon;
             ref_alt = alt;
          }
          cos_factor = cos(ref_lat);
          if(cos_factor == 0.0) cos_factor = 0.001;
       }
       start_3d_fixes(-1, 3);  // !!!!! only if show_fixes == 1?
    }

    config_screen(113);
}

// Assembly:
cmpq $0x20000, 0x1e85fc(%rip) # imm = 0x20000
jne 0x1a2dd
andl $0x0, 0x2dc4d3(%rip)    # 0x2f67b0
pushq %rbp
movq %rsp, %rbp
pushq $0x4
popq %rdi
callq 0x257d9
cmpq $0x20000, 0x1e85dc(%rip) # imm = 0x20000
jne 0x1a302
movb $0x44, 0x2dc4ab(%rip)   # 0x2f67a8
jmp 0x1a3d6
movb $0x4c, 0x2dc49f(%rip)   # 0x2f67a8
movzbl 0x30afc4(%rip), %eax    # 0x3252d4
movl %eax, 0x2dc496(%rip)    # 0x2f67ac
movb $0x1, 0x30afb7(%rip)    # 0x3252d4
pushq $0x1
popq %rdi
callq 0x377c9
cmpb $0x0, 0x30afa8(%rip)    # 0x3252d4
je 0x1a3cb
cmpb $0x0, 0x2ddb5f(%rip)    # 0x2f7e98
jne 0x1a3cb
movsd 0x2dcc89(%rip), %xmm0   # 0x2f6fd0
movsd %xmm0, 0x30afa1(%rip)   # 0x3252f0
movsd 0x2dcc81(%rip), %xmm1   # 0x2f6fd8
movsd %xmm1, 0x30af99(%rip)   # 0x3252f8
orl $-0x1, 0x30afa2(%rip)   # 0x325308
movsd 0x2dcc72(%rip), %xmm2   # 0x2f6fe0
movsd %xmm2, 0x30af8a(%rip)   # 0x325300
cmpl $0x0, 0x30afc3(%rip)    # 0x325340
je 0x1a389
movsd 0x30af89(%rip), %xmm0   # 0x325310
jmp 0x1a3a1
movsd %xmm0, 0x30af7f(%rip)   # 0x325310
movsd %xmm1, 0x30af7f(%rip)   # 0x325318
movsd %xmm2, 0x30af7f(%rip)   # 0x325320
callq 0x9710
movsd %xmm0, 0x2dcc1a(%rip)   # 0x2f6fc8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1a3cb
jp 0x1a3cb
movabsq $0x3f50624dd2f1a9fc, %rax # imm = 0x3F50624DD2F1A9FC
movq %rax, 0x2dcbfd(%rip)    # 0x2f6fc8
pushq $-0x1
popq %rdi
pushq $0x3
popq %rsi
callq 0xe534c
pushq $0x71
popq %rdi
popq %rbp
jmp 0xcc4f
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: goto_mark(int)
void goto_mark(int i)
{
long val;

   // center plot window on the marked point
   if((i < 0) || (i >= MAX_MARKER)) return;
   if(mark_q_entry[i] && plot_mag) { // a queue entry is marked
      last_q_place = last_mouse_q;
      val = mark_q_entry[i];
      val -= (((PLOT_WIDTH/2)*view_interval) / (long) plot_mag);  // center point on screen
      if(mark_q_entry[i] < plot_q_out) val += plot_q_size;
      zoom_review(val, REVIEW_QUIET);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x9, %edi
ja 0x1a856
movl %edi, %eax
leaq 0x1eaaca(%rip), %rcx    # 0x2052b0
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
setne %dl
movl 0x1eabda(%rip), %eax    # 0x2053d0
testl %eax, %eax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1a856
movslq %eax, %rsi
movq 0x1eaa69(%rip), %rax    # 0x205278
movq %rax, 0x1eaa82(%rip)    # 0x205298
movl 0x1e8068(%rip), %eax    # 0x202884
movl $0x2, %edi
cltd
idivl %edi
cltq
imulq 0x1eab72(%rip), %rax    # 0x2053a0
cqto
idivq %rsi
movq %rcx, %rdi
subq %rax, %rdi
xorl %eax, %eax
cmpq 0x1eaaee(%rip), %rcx    # 0x205330
jge 0x1a84b
movq 0x1eaad5(%rip), %rax    # 0x205320
addq %rax, %rdi
xorl %esi, %esi
popq %rbp
jmp 0x10ccb
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: kbd_zoom()
void kbd_zoom()
{
u32 val;

   // toggle view interval from 1 sec/pixel to longer view
   if(mouse_plot_valid && plot_mag) {
      if((view_interval == 1L) && (queue_interval > 0)) {
         if(user_view) view_interval = user_view;
////     else if(0 && (plot_q_count < ((24L*60L*60L) / queue_interval))) {  // less than 24 hours of data available
         else if(0) {  // less than 24 hours of data available
            view_all(0);
            mark_q_entry[0] = last_mouse_q;  // marker 0 is mouse click marker
         }
         else {
            val = ((60L*60L)/HORIZ_MAJOR)/queue_interval;  // 1 hr per division
            view_interval = val;
         }
      }
      else {
         day_plot = 0;
         view_interval = 1L;
      }

      mark_q_entry[0] = last_mouse_q;  // marker 0 is mouse click marker

      val = last_mouse_q;
      val -= (((PLOT_WIDTH/2)*view_interval) / (long) plot_mag);  // center point on screen
      if(last_mouse_q < plot_q_out) val += plot_q_size;
      zoom_review(val, REVIEW_BEEP);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x1ea74b(%rip)    # 0x205258
setne %cl
movl 0x1ea8ba(%rip), %eax    # 0x2053d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1ab68
movslq %eax, %rcx
cmpq $0x1, 0x1ea873(%rip)    # 0x2053a0
sete %al
movq 0x1ea861(%rip), %rdi    # 0x205398
testq %rdi, %rdi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1ab6a
movq 0x1ea86d(%rip), %rsi    # 0x2053b8
testq %rsi, %rsi
jne 0x1ab7b
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl 0x1e7d17(%rip)          # 0x202874
cltq
cqto
idivq %rdi
movl %eax, %esi
jmp 0x1ab7b
popq %rbp
retq
andl $0x0, 0x1e7d2b(%rip)    # 0x20289c
movabsq $0x1, %rsi
movq %rsi, 0x1ea81e(%rip)    # 0x2053a0
movq 0x1ea6ef(%rip), %r8     # 0x205278
movq %r8, 0x1ea720(%rip)     # 0x2052b0
movl 0x1e7cee(%rip), %eax    # 0x202884
movl $0x2, %edi
cltd
idivl %edi
cltq
imulq %rsi, %rax
cqto
idivq %rcx
movl %r8d, %edi
subl %eax, %edi
xorl %eax, %eax
cmpq 0x1ea779(%rip), %r8     # 0x205330
jge 0x1abbf
movl 0x1ea761(%rip), %eax    # 0x205320
addl %eax, %edi
movl $0x1, %esi
popq %rbp
jmp 0x10ccb
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: plot_review(long)
void plot_review(long i)
{
   // start viewing queue data at point *i*
   if(i <= 0) review_home = 1;
   else       review_home = 0;

   if(i >= plot_q_count) {  // we are past the end of the data, back up a minor tick
      while((i >= plot_q_count) && plot_mag) {
         i = plot_q_count - (HORIZ_MINOR*view_interval) / (long) plot_mag;
      }
      if(i < 0) i = 0;
      BEEP(8);
   }
   else if(i < 0) {  // we are at the start of the data in the queue
      i = 0;
      BEEP(9);
   }

   review = i;
   review_mode = 1;
   plot_start = review;

   draw_plot(REFRESH_SCREEN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
setle 0x20b5aa(%rip)          # 0x226d41
movq 0x1e9b9a(%rip), %rsi    # 0x205338
cmpq %rdi, %rsi
jle 0x1b7af
testq %rdi, %rdi
jns 0x1b7f3
pushq $0x9
popq %rdi
xorl %ebx, %ebx
jmp 0x1b7eb
movslq 0x1e9c1a(%rip), %r8     # 0x2053d0
movslq 0x1e70bb(%rip), %rcx    # 0x202878
imulq 0x1e9bdb(%rip), %rcx    # 0x2053a0
cmpq %rsi, %rdi
jl 0x1b7df
testl %r8d, %r8d
je 0x1b7df
movq %rcx, %rax
cqto
idivq %r8
movq %rsi, %rdi
subq %rax, %rdi
jmp 0x1b7c5
xorl %ebx, %ebx
testq %rdi, %rdi
cmovgq %rdi, %rbx
pushq $0x8
popq %rdi
callq 0x9d23
movq %rbx, %rdi
movq %rdi, 0x20b54e(%rip)    # 0x226d48
movb $0x1, 0x20b53f(%rip)    # 0x226d40
movq %rdi, 0x1e9b40(%rip)    # 0x205348
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x18cb0
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: new_view()
void new_view()
{
   // set up display for the new view parameters
   if((view_interval == 1L) && (queue_interval > 0) && nav_rate) {
      view_interval = ((60L*60L)/HORIZ_MAJOR)/queue_interval;  // 1 hr per division
      view_interval = (int) (((float) view_interval) / nav_rate);
   }
   else {
      day_plot = 0;
      view_interval = 1L;
      config_screen(8);
   }
   if(view_interval <= 0L) view_interval = 1L;
   user_view = 0;

   redraw_screen();
}

// Assembly:
cmpq $0x1, 0x1e9832(%rip)    # 0x2053a0
jne 0x1bbc0
movq 0x1e9821(%rip), %rcx    # 0x205398
testq %rcx, %rcx
jle 0x1bbc0
movsd 0x1e97d4(%rip), %xmm0   # 0x205358
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1bb90
jnp 0x1bbc0
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl 0x1e6cd7(%rip)          # 0x202874
cltq
cqto
idivq %rcx
cvtsi2ss %rax, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
cltq
movq %rax, 0x1e97e2(%rip)    # 0x2053a0
jmp 0x1bbe6
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x1e6cd1(%rip)    # 0x20289c
movq $0x1, 0x1e97ca(%rip) # 0x2053a0
pushq $0x8
popq %rdi
callq 0xcc4f
movq 0x1e97bb(%rip), %rax    # 0x2053a0
popq %rbp
testq %rax, %rax
jg 0x1bbf6
movq $0x1, 0x1e97aa(%rip) # 0x2053a0
andq $0x0, 0x1e97ba(%rip)    # 0x2053b8
jmp 0xf426
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: adjust_view()
void adjust_view()
{
   // configure screen for the view the user specified on the command line
   if(set_view == 1) {
      config_screen(9);
      day_plot = SCREEN_WIDTH / HORIZ_MAJOR;

      if((view_interval == 1L) && (queue_interval > 0)) {
         view_interval = ((60L*60L)/HORIZ_MAJOR)/queue_interval;  // 1 hr per division
      }
      else {
         day_plot = 0;
         view_interval = 1L;
         config_screen(10);
      }
      if(view_interval <= 0L) view_interval = 1L;
      user_view = 0;
//    user_view = day_plot;
   }
}

// Assembly:
cmpb $0x1, 0x1e97bd(%rip)    # 0x2053c7
jne 0x1bca3
pushq %rbp
movq %rsp, %rbp
pushq $0x9
popq %rdi
callq 0xcc4f
movl 0x1e6bde(%rip), %eax    # 0x202800
movl 0x1e6c4c(%rip), %ecx    # 0x202874
cltd
idivl %ecx
movl %eax, 0x1e6c6b(%rip)    # 0x20289c
cmpq $0x1, 0x1e9767(%rip)    # 0x2053a0
sete %al
movq 0x1e9755(%rip), %rsi    # 0x205398
testq %rsi, %rsi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1bc69
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl %ecx
cltq
cqto
idivq %rsi
movq %rax, 0x1e9739(%rip)    # 0x2053a0
jmp 0x1bc8a
andl $0x0, 0x1e6c2c(%rip)    # 0x20289c
movq $0x1, 0x1e9725(%rip) # 0x2053a0
pushq $0xa
popq %rdi
callq 0xcc4f
movq 0x1e9716(%rip), %rax    # 0x2053a0
testq %rax, %rax
popq %rbp
jg 0x1bc9b
movq $0x1, 0x1e9705(%rip) # 0x2053a0
andq $0x0, 0x1e9715(%rip)    # 0x2053b8
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: key_wait(char*)
void key_wait(char *s)
{
// debug routine - display message and wait for key
strcpy(plot_title, s);
title_type = OTHER;
show_title();
refresh_page();
BEEP(14);

   while(1) {
      serve_os_queue();

      if(zoom_screen == 'K') get_mouse_info();
      if(KBHIT()) break;
   }
   GETCH();
BEEP(15);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rsi
leaq 0x30cb88(%rip), %rdi    # 0x328850
callq 0x9330
movl $0x3, 0x30d5f5(%rip)    # 0x3292cc
callq 0x1747f
callq 0xaa05
pushq $0xe
popq %rdi
callq 0x9d23
callq 0x1bca4
cmpb $0x4b, 0x2daab3(%rip)   # 0x2f67a8
jne 0x1bcfc
callq 0x1b5eb
callq 0xd1b9
testl %eax, %eax
je 0x1bce9
callq 0xd1d5
pushq $0xf
popq %rdi
popq %rbp
jmp 0x9d23
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: wait_for_key(int)
void wait_for_key(int serve)
{
     if(SER_AVAIL_RCVR) serve = 0;  // prevent possible lockup
//   if(POLLED_RCVR) serve = 0;  // prevent possible lockup

   if(timer_serve) {
      return; // don't let windows timer access this routine
   }

   first_key = ' ';  // make sure plot area is not disturbed
   while(break_flag == 0) {
      serve_os_queue();

if((zoom_screen == 'K') || showing_cmd_help) get_mouse_info();
      if(KBHIT()) break;

      if(serve && (com[RCVR_PORT].process_com || sim_file || (rcvr_type == NO_RCVR) || (rcvr_type == TIDE_RCVR))) {
         get_pending_gps(0);   //!!!! possible recursion
      }
   }
}

// Assembly:
movq 0x1e6bb6(%rip), %rax    # 0x2028d0
cmpl $0x0, 0x1e94f7(%rip)    # 0x205218
je 0x1bd24
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movabsq $0x101b465000, %rcx     # imm = 0x101B465000
testq %rcx, %rax
setne %al
movl $0x20, 0x20d214(%rip)   # 0x228f58
testl %edi, %edi
sete %bl
orb %al, %bl
cmpl $0x0, 0x3052d2(%rip)    # 0x321024
jne 0x1bdae
callq 0x1bca4
cmpb $0x4b, 0x2daa48(%rip)   # 0x2f67a8
je 0x1bd6b
cmpl $0x0, 0x30e8b3(%rip)    # 0x32a61c
je 0x1bd70
callq 0x1b5eb
callq 0xd1b9
testl %eax, %eax
jne 0x1bdae
testb %bl, %bl
jne 0x1bd4b
cmpl $0x0, 0x2f3f50(%rip)    # 0x30fcd4
jne 0x1bda7
cmpq $0x0, 0x20c632(%rip)    # 0x2283c0
jne 0x1bda7
movq 0x1e6b39(%rip), %rax    # 0x2028d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1bda7
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1bd4b
callq 0x1bdb5
jmp 0x1bd4b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: get_pending_gps(int)
void get_pending_gps(int why)
{
u08 old_disable_kbd;

   // process all the data currently in the com port input buffers
   old_disable_kbd = disable_kbd;
   disable_kbd = 2; // (so that do_kbd() won't do anything when it's called by WM_CHAR during get_pending_gps())
   system_busy = 1; // we are doing other things besides waiting for serial data

   while((break_flag == 0) && (take_a_dump == 0) && (com[RCVR_PORT].process_com || sim_file || ((rcvr_type == NO_RCVR) || (rcvr_type == TIDE_RCVR))) && SERIAL_DATA_AVAILABLE(RCVR_PORT)) {
      serve_os_queue();

      get_rcvr_message();
      process_extra_ports(2);

      if(NO_PEND_LOOP) break;
   }
   check_com_timer(RCVR_PORT);

   disable_kbd = old_disable_kbd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movb 0x1e9459(%rip), %r14b   # 0x20521c
movb $0x2, 0x1e9452(%rip)    # 0x20521c
movb $0x1, 0x305257(%rip)    # 0x321028
pushq $0xa
popq %rbx
movl 0x20d176(%rip), %eax    # 0x228f50
orl 0x305244(%rip), %eax    # 0x321024
jne 0x1be54
cmpl $0x0, 0x2f3eeb(%rip)    # 0x30fcd4
jne 0x1be0c
cmpq $0x0, 0x20c5cd(%rip)    # 0x2283c0
jne 0x1be0c
movq 0x1e6ad4(%rip), %rax    # 0x2028d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1be0c
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1be54
movl %ebx, %edi
callq 0xb771
testl %eax, %eax
je 0x1be54
callq 0x1bca4
callq 0xaffcb
callq 0x1d57a
movq 0x1e6aa3(%rip), %rax    # 0x2028d0
cmpq $0x1000, %rax           # imm = 0x1000
sete %cl
cmpl $0x4e, 0x1e91ab(%rip)   # 0x204fe8
sete %dl
testb %dl, %cl
jne 0x1be54
cmpq $0x40000, %rax          # imm = 0x40000
je 0x1be54
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x1bdd4
pushq $0xa
popq %rdi
callq 0x1d61b
movb %r14b, 0x1e93b9(%rip)   # 0x20521c
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: abort_wakeup()
void abort_wakeup()
{
   // see if user says to stop the receiver wakeup loop
   serve_os_queue();

   if(KBHIT()) {
      if(GETCH() == ESC_CHAR) {
         error_exit(6666, "User pressed ESC during abort_wakeup()");
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x1bca4
callq 0xd1b9
testl %eax, %eax
je 0x1be96
callq 0xd1d5
cmpl $0x1b, %eax
jne 0x1be96
leaq 0xd8de5(%rip), %rsi     # 0xf4c70
movl $0x1a0a, %edi           # imm = 0x1A0A
popq %rbp
jmp 0xb290
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: close_script(unsigned char)
void close_script(u08 close_all)
{
int i;

   // close script file and un-nest a level if script is nested

   if(script_file == 0) return;

   if(close_all) {
      for(i=0; i<script_nest; i++) fclose(scripts[i].file);
      script_file = 0;
      script_pause = 0;
      script_nest = 0;
   }
   else if(script_nest) {
      fclose(script_file);
      --script_nest;
      strcpy(script_name, scripts[script_nest].name);
      script_file   = scripts[script_nest].file;
      script_line   = scripts[script_nest].line;
      script_col    = scripts[script_nest].col;
      script_err    = scripts[script_nest].err;
      script_fault  = scripts[script_nest].fault;
      script_pause  = scripts[script_nest].pause;
   }
   else {
     fclose(script_file);
     script_file  = 0;
     script_pause = 0;
   }
}

// Assembly:
movl %edi, %eax
movq 0x20cfef(%rip), %rdi    # 0x228eb8
testq %rdi, %rdi
je 0x1bfcd
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testb %al, %al
je 0x1bf22
leaq 0x20cd34(%rip), %rbx    # 0x228c18
xorl %r14d, %r14d
movslq 0x20cfc6(%rip), %rax    # 0x228eb4
cmpq %rax, %r14
jge 0x1bf07
movq (%rbx), %rdi
callq 0x9360
incq %r14
addq $0xa8, %rbx
jmp 0x1bee7
andq $0x0, 0x20cfa9(%rip)    # 0x228eb8
movb $0x0, 0x20cfba(%rip)    # 0x228ed0
andl $0x0, 0x20cf97(%rip)    # 0x228eb4
jmp 0x1bfc9
movl 0x20cf8c(%rip), %ebx    # 0x228eb4
callq 0x9360
testl %ebx, %ebx
je 0x1bfba
movslq 0x20cf78(%rip), %rax    # 0x228eb4
decq %rax
movl %eax, 0x20cf6f(%rip)    # 0x228eb4
imulq $0xa8, %rax, %rbx
leaq 0x20cc3d(%rip), %r14    # 0x228b90
leaq (%r14,%rbx), %rsi
leaq 0x20ced2(%rip), %rdi    # 0x228e30
callq 0x9330
movq 0x88(%rbx,%r14), %rax
movq %rax, 0x20cf46(%rip)    # 0x228eb8
movl 0x90(%rbx,%r14), %eax
movl %eax, 0x20cf40(%rip)    # 0x228ec0
movl 0x94(%rbx,%r14), %eax
movl %eax, 0x20cf36(%rip)    # 0x228ec4
movl 0x98(%rbx,%r14), %eax
movl %eax, 0x20cf2c(%rip)    # 0x228ec8
movl 0x9c(%rbx,%r14), %eax
movl %eax, 0x20cf22(%rip)    # 0x228ecc
movb 0xa0(%rbx,%r14), %al
movb %al, 0x20cf18(%rip)     # 0x228ed0
jmp 0x1bfc9
andq $0x0, 0x20cef6(%rip)    # 0x228eb8
movb $0x0, 0x20cf07(%rip)    # 0x228ed0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: open_script(char*)
int open_script(char *fn)
{
   // open a keyboard script file (they can be nested)

   if(script_file) { // nested script files
      if(script_nest < SCRIPT_NEST) {
         strcpy(scripts[script_nest].name, script_name);
         scripts[script_nest].file  = script_file;
         scripts[script_nest].line  = script_line;
         scripts[script_nest].col   = script_col;
         scripts[script_nest].fault = script_fault;
         scripts[script_nest].err   = script_err;
         scripts[script_nest].pause = script_pause;
         ++script_nest;
      }
      else {
         edit_error("Script files nested too deep");
         close_script(1);
         return 2;
      }
   }

   strncpy(script_name, fn, SCRIPT_LEN);
   script_file  = topen(fn, "r");
   script_line  = 1;
   script_col   = 0;
   script_fault = 0;
   script_pause = 0;
   skip_comment = 0;
   if(script_file) return 0;
   else            return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20ced2(%rip), %r15    # 0x228eb8
testq %r15, %r15
je 0x1c076
movslq 0x20cebe(%rip), %r14    # 0x228eb4
cmpq $0x3, %r14
jg 0x1c0d3
imulq $0xa8, %r14, %r12
leaq 0x20cb82(%rip), %r13    # 0x228b90
leaq (%r12,%r13), %rdi
leaq 0x20ce17(%rip), %rsi    # 0x228e30
callq 0x9330
movq %r15, 0x88(%r12,%r13)
movl 0x20ce94(%rip), %eax    # 0x228ec0
movl %eax, 0x90(%r12,%r13)
movl 0x20ce8a(%rip), %eax    # 0x228ec4
movl %eax, 0x94(%r12,%r13)
movl 0x20ce84(%rip), %eax    # 0x228ecc
movl %eax, 0x9c(%r12,%r13)
movl 0x20ce72(%rip), %eax    # 0x228ec8
movl %eax, 0x98(%r12,%r13)
movb 0x20ce6c(%rip), %al     # 0x228ed0
movb %al, 0xa0(%r12,%r13)
leal 0x1(%r14), %eax
movl %eax, 0x20ce3e(%rip)    # 0x228eb4
leaq 0x20cdb3(%rip), %rdi    # 0x228e30
movl $0x80, %edx
movq %rbx, %rsi
callq 0x9170
leaq 0xeec44(%rip), %rsi     # 0x10acd5
movq %rbx, %rdi
callq 0x9a22
andl $0x0, 0x20ce24(%rip)    # 0x228ec4
movq %rax, %rcx
andl $0x0, 0x20ce22(%rip)    # 0x228ecc
movq %rax, 0x20ce07(%rip)    # 0x228eb8
movl $0x1, 0x20ce05(%rip)    # 0x228ec0
xorl %eax, %eax
movb %al, 0x20ce0d(%rip)     # 0x228ed0
movb %al, 0x20ce08(%rip)     # 0x228ed1
xorl %eax, %eax
testq %rcx, %rcx
sete %al
jmp 0x1c0ea
leaq 0xd8bbd(%rip), %rdi     # 0xf4c97
callq 0x214df
pushq $0x1
popq %rdi
callq 0x1bec0
pushq $0x2
popq %rax
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/heather.cpp
// Function: get_script()
int get_script()
{
int i;

   // read a simulated keystroke from a script file
   i = fgetc(script_file);
   if(i < 0) {  // end of file
      close_script(0);
      return 0;
   }
   else if((i == 0x00) || (i == 0x01)) { // two byte cursor char
      i = fgetc(script_file);
      if(i < 0) {
         close_script(0);
         return 0;
      }
      i += 0x0100;
   }
   else if((skip_comment == 0) && (i == '~')) { // switch input to keyboard
      script_pause = 1;
      return 0;
   }

   if(i == 0x0A) i = 0x0D; // CR and LF are the same
   if(i == 0x0D) {         // end of line
      ++script_line;
      script_col = 0;
      skip_comment = 0;
   }
   else ++script_col;

   if(skip_comment) return 0;
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x20cdb2(%rip), %rdi    # 0x228eb8
callq 0x95f0
testl %eax, %eax
js 0x1c12b
cmpl $0x1, %eax
ja 0x1c136
movq 0x20cd9d(%rip), %rdi    # 0x228eb8
callq 0x95f0
testl %eax, %eax
js 0x1c12b
addl $0x100, %eax            # imm = 0x100
jmp 0x1c14f
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1bec0
jmp 0x1c187
cmpl $0x7e, %eax
jne 0x1c14f
cmpb $0x0, 0x20cd8f(%rip)    # 0x228ed1
jne 0x1c14f
movb $0x1, 0x20cd85(%rip)    # 0x228ed0
xorl %ebx, %ebx
jmp 0x1c187
cmpl $0xd, %eax
je 0x1c159
cmpl $0xa, %eax
jne 0x1c16d
incl 0x20cd61(%rip)          # 0x228ec0
movb $0x0, 0x20cd6b(%rip)    # 0x228ed1
xorl %ecx, %ecx
pushq $0xd
popq %rbx
jmp 0x1c181
movl 0x20cd51(%rip), %ecx    # 0x228ec4
incl %ecx
xorl %ebx, %ebx
cmpb $0x0, 0x20cd53(%rip)    # 0x228ed1
cmovel %eax, %ebx
movl %ecx, 0x20cd3d(%rip)    # 0x228ec4
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: process_script_file()
int process_script_file()
{
int i;

   if(script_fault) {  // error in script,  abort
      close_script(1);
      getting_string = 0;
      alarm_wait = 0;
      return 0;
   }
   else if(KBHIT()) {  // key pressed,  abort script
      i = edit_error("Script aborted...  key pressed.");
      close_script(1);
      getting_string = 0;
      alarm_wait = 0;
      return 0;
   }
   else if(alarm_wait && (alarm_time || alarm_date || egg_timer || egg_val)) { // script is waiting for an alarm to trigger
      return 0;
   }
   else {   // get keyboard command from the script file  // !!!!!! what about force_si_cmd?
      i = get_script();
      if(i) do_kbd(i);
      return i;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0x20cd2f(%rip)    # 0x228ecc
jne 0x1c1b4
callq 0xd1b9
testl %eax, %eax
je 0x1c1d6
leaq 0xd8b05(%rip), %rdi     # 0xf4cb4
callq 0x214df
pushq $0x1
popq %rdi
callq 0x1bec0
andw $0x0, 0x30d444(%rip)    # 0x329608
movb $0x0, 0x2dbd4f(%rip)    # 0x2f7f1a
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpb $0x0, 0x2dbd3d(%rip)    # 0x2f7f1a
je 0x1c207
xorl %ebx, %ebx
cmpl $0x0, 0x2dbd34(%rip)    # 0x2f7f1c
jne 0x1c1cd
cmpl $0x0, 0x2dbd3b(%rip)    # 0x2f7f2c
jne 0x1c1cd
cmpq $0x0, 0x2dbd0d(%rip)    # 0x2f7f08
jne 0x1c1cd
cmpq $0x0, 0x2dbd0b(%rip)    # 0x2f7f10
jne 0x1c1cd
callq 0x1c0f9
testl %eax, %eax
je 0x1c1cb
movl %eax, %ebx
movl %eax, %edi
callq 0x42caf
jmp 0x1c1cd
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: get_device_messages(int)
void get_device_messages(int serial_avail)
{
   // process any data from the various input devices

   if(serial_avail && (((rcvr_type == NO_RCVR) || (rcvr_type == TIDE_RCVR)) || com[RCVR_PORT].process_com || sim_file)) {  // we have receiver serial data to process
      get_rcvr_message();  // process the incoming GPS messages
      system_busy = 2;
   }
   process_extra_ports(1);  // process the extra devices
}

// Assembly:
testl %edi, %edi
je 0x1d57a
movq 0x1e52f2(%rip), %rax    # 0x2028d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1d605
cmpq $0x800000, %rax         # imm = 0x800000
je 0x1d605
cmpl $0x0, 0x2f26df(%rip)    # 0x30fcd4
jne 0x1d605
cmpq $0x0, 0x20adc1(%rip)    # 0x2283c0
je 0x1d57a
pushq %rbp
movq %rsp, %rbp
callq 0xaffcb
movb $0x2, 0x303a13(%rip)    # 0x321028
popq %rbp
jmp 0x1d57a
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: check_com_timer(unsigned int)
int check_com_timer(unsigned port)
{
double to;

   // see if no data from com port for last com_timeout msecs

   update_pwm();
   if(port >= NUM_COM_PORTS) return 0;

   to = com[port].last_com_time + com[port].com_timeout;
   if(to < this_msec) {  // com data lost
      com[port].last_com_time = this_msec;
      if(com[port].com_data_lost == DATA_LOSS_REINIT) com[port].com_data_lost = DATA_LOSS_NO_INIT;
      else                                            com[port].com_data_lost = DATA_LOSS_REINIT;
   }

   return com[port].com_data_lost;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0xc067d
xorl %eax, %eax
cmpl $0x12, %ebx
ja 0x1d691
movl %ebx, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x2daca1(%rip), %rcx    # 0x2f82e0
movsd 0x2248(%rax,%rcx), %xmm1
addsd 0x2238(%rax,%rcx), %xmm1
addq %rcx, %rax
movsd 0x2da10c(%rip), %xmm0   # 0x2f7768
ucomisd %xmm1, %xmm0
jbe 0x1d67e
movsd %xmm0, 0x2248(%rax)
cmpb $0x1, 0x2250(%rax)
jne 0x1d687
movb $0x2, 0x2250(%rax)
pushq $0x2
jmp 0x1d690
movzbl 0x2250(%rax), %eax
jmp 0x1d691
movb $0x1, 0x2250(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: recover_com(unsigned int)
int recover_com(unsigned port)
{
    // attempt to restart a port after a receive timeout

   if(port >= NUM_COM_PORTS) return (-1);         // bad port number
   if(com[port].user_disabled_com)  return (-2);  // disabled port
   if(com[port].com_running <= 0) return (-3);    // port not init'd
   if(com[port].com_data_lost != DATA_LOSS_REINIT) return (-4);  // not timeout out or recovery failed
   if(com[port].com_recover == 0) return (-5);    // com recovery disabled on the port
   if(com[port].com_port || com[port].usb_port || com[port].IP_addr[0]) ;
   else return (-6); // port not assigned to a device or IP address

   com[port].com_data_lost = DATA_LOSS_NO_INIT;  // prevents futile re-init attempts
   if(com[port].process_com) {
      init_com(port, 3);
      return 1;
   }
   else {
      com[port].process_com = 2;
      if(com[port].com_running) {
         init_com(port, 4);
         return 2;
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x12, %edi
jbe 0x1d6a7
pushq $-0x1
jmp 0x1d6c3
movl %edi, %eax
imulq $0x2260, %rax, %rcx     # imm = 0x2260
leaq 0x2dac29(%rip), %rax    # 0x2f82e0
cmpl $0x0, 0x2228(%rcx,%rax)
je 0x1d6cd
pushq $-0x2
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq %rcx, %rax
cmpl $0x0, 0x2230(%rax)
jle 0x1d713
cmpb $0x1, 0x2250(%rax)
jne 0x1d717
cmpl $0x0, 0x2254(%rax)
je 0x1d71b
cmpl $0x0, (%rax)
jne 0x1d6ff
cmpl $0x0, 0x4(%rax)
jne 0x1d6ff
cmpb $0x0, 0x10d(%rax)
je 0x1d733
movb $0x2, 0x2250(%rax)
cmpl $0x0, 0x2234(%rax)
je 0x1d71f
pushq $0x1
jmp 0x1d72b
pushq $-0x3
jmp 0x1d6c3
pushq $-0x4
jmp 0x1d6c3
pushq $-0x5
jmp 0x1d6c3
movl $0x2, 0x2234(%rax)
pushq $0x2
popq %rbx
callq 0xb30a
jmp 0x1d6c4
pushq $-0x6
jmp 0x1d6c3
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: sound_tick_clock()
void sound_tick_clock()
{
   // play the tick clock sounds

   if(minute_tick && (tick_clock & 0x02)) {
      if(minute_file) play_tune(MINUTE_FILE, 1); // minute tick sound
      else BEEP(16);
   }
   else if(tick_clock & 0x01) {
      if(seconds_file) play_tune(SECONDS_FILE, 1);
      else if(click_file) play_tune(CLICK_FILE, 1);
      else BEEP(17);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x2da679(%rip)    # 0x2f7f00
sete %cl
movb 0x2da65c(%rip), %al     # 0x2f7eec
testb $0x2, %al
sete %dl
orb %cl, %dl
je 0x1d89f
testb $0x1, %al
jne 0x1d8b1
popq %rbp
retq
cmpb $0x0, 0x2daa1b(%rip)    # 0x2f82c1
je 0x1d8c3
leaq 0xd5e68(%rip), %rdi     # 0xf3717
jmp 0x1d8de
cmpb $0x0, 0x2daa0a(%rip)    # 0x2f82c2
je 0x1d8ce
leaq 0xd5e69(%rip), %rdi     # 0xf372a
jmp 0x1d8de
movl $0x10, %edi
popq %rbp
jmp 0x9d23
cmpb $0x0, 0x2da9f3(%rip)    # 0x2f82c8
je 0x1d8e9
leaq 0xd5e27(%rip), %rdi     # 0xf3705
movl $0x1, %esi
popq %rbp
jmp 0x9c78
movl $0x11, %edi
jmp 0x1d8c8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: fine_tick_check()
void fine_tick_check()
{
   // This routine attempts to provide an audible tick clock where the ticks
   // occur the the "true" second instead of when the receiver time message
   // arrives.  It does this by having silly_clocks() set a triiger
   // variable (in milliseconds). When this number of milliseconds has elapsed
   // the tick sound(s) are played.  The trigger variable is checked in
   // wherever the serial port is polled for input characters.

   if(fine_tick_clock == 0) return;   // fine tick clock not active
   if(tick_clock == 0) return;        // singing clock not in tick clock mode
   if(fine_tick_msec < 0.0) return;   // trigger already used
   if(GetMsecs() < fine_tick_msec) return;  // trigger time not elasped

   fine_tick_msec = (-1.0);   // flag trigger has been used
   sound_tick_clock();
}

// Assembly:
cmpl $0x0, 0x2da5f9(%rip)    # 0x2f7ef0
je 0x1d928
cmpb $0x0, 0x2da5ec(%rip)    # 0x2f7eec
je 0x1d928
xorpd %xmm0, %xmm0
ucomisd 0x2da5ea(%rip), %xmm0   # 0x2f7ef8
ja 0x1d928
pushq %rbp
movq %rsp, %rbp
callq 0xad3f
movsd 0x2da5d7(%rip), %xmm1   # 0x2f7ef8
ucomisd %xmm0, %xmm1
popq %rbp
jbe 0x1d929
retq
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, 0x2da5be(%rip)    # 0x2f7ef8
jmp 0x1d87c
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: reset_com_timer(unsigned int)
void reset_com_timer(unsigned port)
{
   // reset the com port data loss timer

   update_pwm();
   if(port >= NUM_COM_PORTS) return;

   com[port].last_com_time = this_msec;
   com[port].com_data_lost = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0xc067d
cmpl $0x12, %ebx
ja 0x1d97a
movsd 0x2d9e0f(%rip), %xmm0   # 0x2f7768
movl %ebx, %eax
imulq $0x2260, %rax, %rax     # imm = 0x2260
leaq 0x2da977(%rip), %rcx    # 0x2f82e0
movsd %xmm0, 0x2248(%rax,%rcx)
movb $0x0, 0x2250(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: get_log_file()
void get_log_file()
{
int i;

   if(read_log[0]) {       // user specified a log file to read in
      first_key = ' ';
      i = reload_log(read_log, 1);
      if(i == 0) {         // log file found
         plot_review(0L);  // enter plot review mode to start plot at first point
         #ifdef ADEV_STUFF
            force_adev_redraw(5);    // and make sure adev tables are showing
         #endif
         pause_data = user_pause_data^1;
      }
      reset_first_key(1);
      prot_menu = 0;
      draw_plot(REFRESH_SCREEN);
   }
}

// Assembly:
cmpb $0x0, 0x209217(%rip)    # 0x226d60
je 0x1dba9
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x20, 0x20b3fd(%rip)   # 0x228f58
leaq 0x2091fe(%rip), %rdi    # 0x226d60
pushq $0x1
popq %rsi
callq 0xc7524
testl %eax, %eax
jne 0x1db8b
xorl %edi, %edi
callq 0x1b787
pushq $0x5
popq %rdi
callq 0xc7144
movb 0x1e76b2(%rip), %al     # 0x205235
xorb $0x1, %al
movb %al, 0x1e76a9(%rip)     # 0x205234
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x2591f
movb $0x0, 0x1e75bc(%rip)    # 0x205158
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x18cb0
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: clean_up()
void clean_up()
{
   // leave receiver in a nice stand-alone state
   #ifdef PRECISE_STUFF
      abort_precise_survey(1);  // shut down any surveys in progress,  save best position
   #endif

   if(rcvr_type == VENUS_RCVR) {
      set_venus_mode(2);  // !!!!!!! vvvvvv put receiver into binary output mode so we can auto_detect it next time
   }

   if(debug_file) {
      fclose(debug_file);
      debug_file = 0;
      debug_name[0] = 0;
   }

   if(luxor) set_batt_pwm(0);

   #ifdef PLM
     kill_pl_timer();
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x1
popq %rdi
callq 0xe5ebd
cmpq $0x80, 0x1e4d0f(%rip) # 0x2028d0
jne 0x1dbcb
pushq $0x2
popq %rdi
callq 0x5cd65
movq 0x20a7be(%rip), %rdi    # 0x228390
testq %rdi, %rdi
je 0x1dbeb
callq 0x9360
andq $0x0, 0x20a7ac(%rip)    # 0x228390
movb $0x0, 0x209e75(%rip)    # 0x227a60
cmpb $0x0, 0x20b34c(%rip)    # 0x228f3e
je 0x1dbfc
xorl %edi, %edi
popq %rbp
jmp 0x71025
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: show_term_screen(unsigned int)
void show_term_screen(unsigned port)
{
int row;
int col;
int c;
int left;

   // copy the teminal screen image buffer to the screen

   left = 0;
   erase_screen();
   for(row=0; row<term_rows; row++) {
      for(col=0; col<term_cols; col++) {
         c = term_screen[row][col];
         c &= 0xFF;
         if((col == term_col) && (row == term_row)) {  // blinking cursor
            if(blinker) dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, TERM_CURSOR, WHITE);  // header lines
            else        dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, TERM_CURSOR, BLACK);  // header lines
         }
         if(c == 0) break;

         if(row < term_header_lines) dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, WHITE);  // header lines
         else if(c & 0x80) {
            dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, YELLOW);   // user input chars
         }
         else dot_char((col+left)*TEXT_WIDTH, row*TEXT_HEIGHT, c&0x7F, GREEN);  // received chars
      }
   }
   refresh_page();

   reset_com_timer(port);
   term_changed = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, -0x2c(%rbp)
callq 0xe7d9
leaq 0x30ca15(%rip), %rbx    # 0x32a630
xorl %r13d, %r13d
pushq $0xf
popq %r14
movslq 0x30eb47(%rip), %rax    # 0x32c770
cmpq %rax, %r13
jge 0x1dd01
xorl %r12d, %r12d
movslq 0x30eb38(%rip), %rax    # 0x32c774
cmpq %rax, %r12
jge 0x1dcf2
movb (%rbx,%r12), %r15b
movl 0x20a7e5(%rip), %eax    # 0x228434
cmpq %rax, %r12
jne 0x1dc87
movl 0x20a7d6(%rip), %eax    # 0x228430
cmpq %rax, %r13
jne 0x1dc87
movl 0x30ebbb(%rip), %ecx    # 0x32c820
movl 0x1e4ba5(%rip), %edi    # 0x202810
imull %r12d, %edi
movl 0x1e4b9f(%rip), %esi    # 0x202814
imull %r13d, %esi
testl %ecx, %ecx
cmovnel %r14d, %ecx
pushq $0x5f
popq %rdx
callq 0xdb30
testb %r15b, %r15b
je 0x1dcf2
movslq 0x30eae9(%rip), %rax    # 0x32c77c
cmpq %rax, %r13
jge 0x1dcb9
movl 0x1e4b72(%rip), %edi    # 0x202810
imull %r12d, %edi
movl 0x1e4b6c(%rip), %esi    # 0x202814
imull %r13d, %esi
andb $0x7f, %r15b
movzbl %r15b, %edx
movl %r14d, %ecx
jmp 0x1dce5
movl 0x1e4b51(%rip), %edi    # 0x202810
imull %r12d, %edi
movl 0x1e4b4b(%rip), %esi    # 0x202814
imull %r13d, %esi
testb %r15b, %r15b
js 0x1dcda
movzbl %r15b, %edx
pushq $0xa
jmp 0x1dce4
andb $0x7f, %r15b
movzbl %r15b, %edx
pushq $0xe
popq %rcx
callq 0xdb30
incq %r12
jmp 0x1dc35
incq %r13
addq $0x85, %rbx
jmp 0x1dc22
callq 0xaa05
movl -0x2c(%rbp), %edi
callq 0x1d93f
andl $0x0, 0x30ea63(%rip)    # 0x32c778
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq