LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: next_q_point(long, int)
long next_q_point(long i, int stop_flag)
{
long j;
int wrap;

   // locate the next data point in the plot queue based upon the display
   // view interval

   plot_column += plot_mag;
   if((stop_flag == STOP_AT_PLOT_END) && (plot_column >= PLOT_WIDTH)) {  // we are at end of plot area
      plot_column -= plot_mag;
      return (-2L);
   }
   wrap = 0;

   if(slow_q_skips) { //!!! ineffcient way to step over multiple queue entries,  but bug resistant
      j = view_interval;
      while(j--) {
         if(++i == plot_q_in) return (-1L);
         while(i >= plot_q_size) i -= plot_q_size;
      }
   }
   else {  // more efficent way to do it,  but there might be bugs...
      if(i <= plot_q_in) {
         i += view_interval;
         if(i >= plot_q_in) return (-1L);
      }
      else if(i > plot_q_in) {
         i += view_interval;
         if(i <= plot_q_in) return (-1L);
      }
      while(i >= plot_q_size) {
         i -= plot_q_size;
         ++wrap;
      }
   }
   if(1 && wrap && (i >= plot_q_out)) return (-1L);
   if(i == plot_q_out) return (-1L);

   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x209f74(%rip), %eax    # 0x21b3cc
movl 0x209f72(%rip), %ecx    # 0x21b3d0
addl %eax, %ecx
movl %ecx, 0x209f66(%rip)    # 0x21b3cc
cmpl $0x1, %esi
jne 0x11485
cmpl 0x207413(%rip), %ecx    # 0x218884
jl 0x11485
movl %eax, 0x209f53(%rip)    # 0x21b3cc
movq $-0x2, %rax
jmp 0x11559
cmpb $0x0, 0x209f3a(%rip)    # 0x21b3c6
je 0x114df
movq 0x209f0b(%rip), %rax    # 0x21b3a0
testq %rax, %rax
je 0x114c8
movq 0x209e87(%rip), %rcx    # 0x21b328
movq 0x209e78(%rip), %rdx    # 0x21b320
leaq 0x1(%rdx), %rsi
leaq 0x1(%rdi), %r8
cmpq %rcx, %r8
je 0x11503
decq %rax
addq %rsi, %rdi
subq %rdx, %rdi
cmpq %rdx, %rdi
jge 0x114bb
testq %rax, %rax
jne 0x114ac
movq 0x209e61(%rip), %rdx    # 0x21b330
cmpq %rdx, %rdi
movq $-0x1, %rax
cmovneq %rdi, %rax
jmp 0x11559
movq 0x209e42(%rip), %rdx    # 0x21b328
movq 0x209eb3(%rip), %rcx    # 0x21b3a0
addq %rdi, %rcx
movq $-0x1, %rax
cmpq %rdi, %rdx
jge 0x1150c
cmpq %rdx, %rcx
jg 0x11511
jmp 0x11559
movq $-0x1, %rax
jmp 0x11559
cmpq %rdx, %rcx
jge 0x11559
movq 0x209e08(%rip), %rax    # 0x21b320
cmpq %rax, %rcx
jge 0x11529
movq 0x209e0c(%rip), %rdx    # 0x21b330
movq %rcx, %rdi
jmp 0x114cf
movq %rcx, %rdi
subq %rax, %rdi
cmpq %rax, %rdi
jge 0x1152c
cmpq %rax, %rcx
setl %al
movq 0x209def(%rip), %rdx    # 0x21b330
cmpq %rdx, %rdi
setl %cl
orb %al, %cl
movq $-0x1, %rax
cmpb $0x1, %cl
je 0x114cf
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: disp_filter_size()
long disp_filter_size()
{
DATA_SIZE show_time;

   // return the length of the display averaging filter

   if(filter_count < 0) {   // filter size based up display config
      show_time = (DATA_SIZE) (view_interval*queue_interval*PLOT_WIDTH);  // seconds per screen
show_time *= (DATA_SIZE) (0-filter_count);
      show_time /= plot_mag;
      show_time /= nav_rate;
      show_time /= PLOT_WIDTH;
      show_time += (DATA_SIZE) 0.5;
      if(show_time < 1.0) show_time = (DATA_SIZE) 1.0;
      if(show_time > PLOT_WIDTH) show_time = (DATA_SIZE) PLOT_WIDTH;

      return (long) show_time;
   }
   else {  // fixed filter size
      if(filter_count > PLOT_WIDTH) return PLOT_WIDTH;
      return filter_count;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x209f0a(%rip), %rcx    # 0x21b470
testq %rcx, %rcx
js 0x1157b
movslq 0x207312(%rip), %rax    # 0x218884
cmpq %rax, %rcx
cmovlq %rcx, %rax
popq %rbp
retq
movq 0x209e16(%rip), %rax    # 0x21b398
imulq 0x209e16(%rip), %rax    # 0x21b3a0
movslq 0x2072f3(%rip), %rdx    # 0x218884
imulq %rdx, %rax
cvtsi2sd %rax, %xmm0
negq %rcx
cvtsi2sd %rcx, %xmm1
cvtsi2sdl 0x209e26(%rip), %xmm2 # 0x21b3d0
mulsd %xmm0, %xmm1
divsd %xmm2, %xmm1
divsd 0x209d9e(%rip), %xmm1   # 0x21b358
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm1
addsd 0xf7a9b(%rip), %xmm1    # 0x109068
movsd 0xf7a9b(%rip), %xmm2    # 0x109070
maxsd %xmm1, %xmm2
minsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: filter_plot_q(long)
struct PLOT_Q filter_plot_q(long point)
{
long i;
long f_count;
int back_ok, center_ok, fwd_ok;

   if     (disp_filter_type == 'B') return back_filter(point);    // user forced filter type
   else if(disp_filter_type == 'C') return center_filter(point);
   else if(disp_filter_type == 'F') return forward_filter(point);

   f_count = disp_filter_size();

   back_ok = center_ok = fwd_ok = 1;

   i = point - f_count;
   if(i < 0) i += plot_q_size;
   if(i > plot_q_count) {  // too near the start of the plot to do a back filter
      back_ok = 0;
   }

   i = point - (f_count / 2);
   if(i < 0) i += plot_q_size;
   if(i > plot_q_count) {  // too near the start of the plot to do a center filter
      center_ok = 0;
   }

   i = point + f_count;
   if(i > plot_q_size) i -= plot_q_size;
   if(i > plot_q_count) {  // too near the end of the plot to do a forward filter
      fwd_ok = 0;
   }

   if(center_ok) {  // filter points each side of the point
      return center_filter(point);
   }
   else if(fwd_ok) {  // filter points after the point
      return forward_filter(point);
   }
   else if(back_ok) {  // filter points before the point
      return back_filter(point);
   }
   else {  // not enough data to do a proper filter
      return forward_filter(point);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20989e(%rip), %eax    # 0x21b478
cmpl $0x46, %eax
je 0x11c63
cmpl $0x43, %eax
je 0x11c70
cmpl $0x42, %eax
jne 0x11bfe
movq %rbx, %rdi
movq %r14, %rsi
callq 0x115e4
jmp 0x11c7b
callq 0x1155b
movq 0x209716(%rip), %rdx    # 0x21b320
movq 0x209727(%rip), %rcx    # 0x21b338
movq %rax, %rsi
shrq $0x3f, %rsi
addq %rax, %rsi
sarq %rsi
movq %r14, %rdi
subq %rsi, %rdi
movq %rdi, %rsi
sarq $0x3f, %rsi
andq %rdx, %rsi
addq %rdi, %rsi
cmpq %rcx, %rsi
jle 0x11c70
leaq (%rax,%r14), %rsi
xorl %edi, %edi
cmpq %rdx, %rsi
cmovgq %rdx, %rdi
subq %rdi, %rsi
cmpq %rcx, %rsi
jle 0x11c63
movq %r14, %rsi
subq %rax, %rsi
movq %rsi, %rax
sarq $0x3f, %rax
andq %rdx, %rax
addq %rsi, %rax
cmpq %rcx, %rax
jle 0x11bf1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x119e6
jmp 0x11c7b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x117ca
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: config_text()
void config_text()
{
int i;

   // text drawing stuff
   PLOT_TEXT_COL = (PLOT_COL / TEXT_WIDTH);
   PLOT_TEXT_ROW = (PLOT_ROW / TEXT_HEIGHT);

   MOUSE_COL = (PLOT_TEXT_COL)+2;
   MOUSE_ROW = ((PLOT_TEXT_ROW)-6-eofs);
   MOUSE_ROW -= ((TEXT_Y_MARGIN+TEXT_HEIGHT-1)/TEXT_HEIGHT);
   if((TEXT_HEIGHT == 16) && (SCREEN_HEIGHT <= SHORT_SCREEN)) --MOUSE_ROW;
   if(MOUSE_ROW < 0) MOUSE_ROW = 0;

   TEXT_COLS = ((SCREEN_WIDTH+TEXT_WIDTH-1)/TEXT_WIDTH);
   if(TEXT_COLS >= (int)sizeof(blanks)) TEXT_COLS = sizeof(blanks)-1;
   TEXT_ROWS = ((SCREEN_HEIGHT+TEXT_HEIGHT-1)/TEXT_HEIGHT);
   if(text_mode) MOUSE_ROW = TEXT_ROWS;

   EDIT_ROW = PLOT_TEXT_ROW+2;   // where to put the string input dialog
   if(SCREEN_HEIGHT <= TINY_HEIGHT) EDIT_ROW = PLOT_TEXT_ROW+1;  // piss3
   EDIT_COL = PLOT_TEXT_COL;

   if(text_mode) {
      EDIT_ROW = EDIT_COL = 0;
      PLOT_ROW += (TEXT_HEIGHT*3);
      PLOT_TEXT_ROW = 100;
   }

   for(i=0; i<TEXT_COLS; i++) blanks[i] = ' ';
   blanks[TEXT_COLS] = 0;
}

// Assembly:
movl 0x206bf7(%rip), %eax    # 0x218880
movl 0x206b80(%rip), %r8d    # 0x218810
cltd
idivl %r8d
movl %eax, %ecx
movl %eax, 0x206bf0(%rip)    # 0x21888c
movl 0x206bda(%rip), %edi    # 0x21887c
movl 0x206b6b(%rip), %r9d    # 0x218814
movl %edi, %eax
cltd
idivl %r9d
movl %eax, %esi
movl %eax, 0x206bd9(%rip)    # 0x218890
leal 0x2(%rcx), %eax
movl %eax, 0x206aec(%rip)    # 0x2187ac
leal -0x1(,%r9,2), %eax
cltd
idivl %r9d
addl 0x22d26e(%rip), %eax    # 0x23ef40
negl %eax
addl %esi, %eax
addl $-0x6, %eax
movl %eax, 0x206ac9(%rip)    # 0x2187a8
cmpl $0x10, %r9d
sete %dl
movl 0x206b17(%rip), %r10d   # 0x218804
cmpl $0x259, %r10d           # imm = 0x259
setl %r11b
andb %dl, %r11b
movzbl %r11b, %edx
subl %edx, %eax
testb %dl, %dl
jne 0x11d09
testl %eax, %eax
jns 0x11d16
xorl %edx, %edx
testl %eax, %eax
cmovgl %eax, %edx
movl %edx, 0x206a92(%rip)    # 0x2187a8
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x206ade(%rip), %eax    # 0x218800
addl %r8d, %eax
decl %eax
cltd
idivl %r8d
movl %eax, %r8d
movl $0x200, %ebx            # imm = 0x200
cmpl %ebx, %eax
cmovll %eax, %ebx
movl %ebx, 0x206aca(%rip)    # 0x218808
leal (%r9,%r10), %eax
decl %eax
cltd
idivl %r9d
movl %eax, 0x206abe(%rip)    # 0x21880c
cmpl $0x0, 0x206a83(%rip)    # 0x2187d8
je 0x11d79
movl %eax, 0x206a4b(%rip)    # 0x2187a8
leal (%r9,%r9,2), %eax
addl %edi, %eax
movl %eax, 0x206b13(%rip)    # 0x21887c
movl $0x64, 0x206b1d(%rip)   # 0x218890
xorl %esi, %esi
xorl %ecx, %ecx
jmp 0x11d8a
xorl %eax, %eax
cmpl $0x1e1, %r10d           # imm = 0x1E1
setl %al
subl %eax, %esi
addl $0x2, %esi
movl %esi, 0x32d87c(%rip)    # 0x33f60c
movl %ecx, 0x32d87a(%rip)    # 0x33f610
testl %r8d, %r8d
jle 0x11dae
movl %ebx, %edx
leaq 0x32a26c(%rip), %rdi    # 0x33c010
movl $0x20, %esi
callq 0x91a0
movslq %ebx, %rax
leaq 0x32a258(%rip), %rcx    # 0x33c010
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: scale_plot_row()
int scale_plot_row()
{
   // adjust plot row for scaled up text size
   if(use_vc_fonts) {
      PLOT_ROW = (PLOT_ROW * vc_font_scale) / 100;
if(vc_font_scale < 100) PLOT_ROW += TEXT_HEIGHT*2;  // piss
      config_text();
      vidstr(0,0, WHITE, " ");
   }
   return PLOT_ROW;
}

// Assembly:
cmpl $0x0, 0x211776(%rip)    # 0x223540
je 0x11e2a
movl 0x211772(%rip), %ecx    # 0x223544
movl 0x206aa4(%rip), %eax    # 0x21887c
imull %ecx, %eax
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
movl %eax, 0x206a85(%rip)    # 0x21887c
cmpl $0x63, %ecx
jg 0x11e0b
movl 0x206a12(%rip), %ecx    # 0x218814
leal (%rax,%rcx,2), %eax
movl %eax, 0x206a71(%rip)    # 0x21887c
pushq %rbp
movq %rsp, %rbp
callq 0x11c83
leaq 0x110d39(%rip), %rcx    # 0x122b54
xorl %edi, %edi
xorl %esi, %esi
movl $0xf, %edx
callq 0xe787
popq %rbp
movl 0x206a4c(%rip), %eax    # 0x21887c
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: config_undersized()
void config_undersized()
{
   // setup for 640x480 screen
   if(user_font_size > 12) user_font_size = 12;

   HORIZ_MAJOR = 30;
   HORIZ_MINOR = 5;
   VERT_MAJOR = 20;
   VERT_MINOR = 4;
   COUNT_SCALE = (VERT_MAJOR/2);

   if(rcvr_type == NO_RCVR) {  // size of the analog watch area
      AZEL_SIZE = LLA_SIZE = (SCREEN_WIDTH / 4); // piss (160);
   }

   if(user_set_plot_row == 0) {
      if(user_font_size && (user_font_size <= 8)) PLOT_ROW = SCREEN_HEIGHT-VERT_MAJOR*8;
      else PLOT_ROW = SCREEN_HEIGHT-VERT_MAJOR*6;
      scale_plot_row();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb 0x206a1d(%rip), %al     # 0x218858
cmpb $0xd, %al
jb 0x11e48
movb $0xc, 0x206a12(%rip)    # 0x218858
movb $0xc, %al
movl $0x1e, 0x206a22(%rip)   # 0x218874
movl $0x5, 0x206a1c(%rip)    # 0x218878
movl $0x14, 0x206a06(%rip)   # 0x21886c
movl $0x4, 0x206a00(%rip)    # 0x218870
movl $0xa, 0x206a2e(%rip)    # 0x2188a8
cmpq $0x400, 0x206a4b(%rip) # imm = 0x400
jne 0x11ea4
movl 0x206973(%rip), %ecx    # 0x218800
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x2, %edx
movl %edx, 0x3293fa(%rip)    # 0x33b298
movl %edx, 0x3294e8(%rip)    # 0x33b38c
cmpl $0x0, 0x2116a1(%rip)    # 0x22354c
je 0x11eaf
popq %rbp
retq
decb %al
cmpb $0x8, %al
movl $0xffffff60, %eax       # imm = 0xFFFFFF60
movl $0xffffff88, %ecx       # imm = 0xFFFFFF88
cmovbl %eax, %ecx
addl 0x20693e(%rip), %ecx    # 0x218804
movl %ecx, 0x2069b0(%rip)    # 0x21887c
popq %rbp
jmp 0x11dc3
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: config_small()
void config_small()
{
   // setup for 800x600 screen
   if(user_set_plot_row == 0) {
      PLOT_ROW = (400+8);
      scale_plot_row();
   }

   FILTER_ROW = 17;
   FILTER_COL = INFO_COL;

   COUNT_SCALE = (VERT_MAJOR/2);

   AZEL_SIZE = LLA_SIZE = (160);       // size of the az/el map area

   if(TEXT_HEIGHT >= 16) eofs = 0;
}

// Assembly:
cmpl $0x0, 0x211673(%rip)    # 0x22354c
jne 0x11eef
pushq %rbp
movq %rsp, %rbp
movl $0x198, 0x206993(%rip)  # imm = 0x198
callq 0x11dc3
popq %rbp
movl $0x11, 0x2068a7(%rip)   # 0x2187a0
movl 0x20689d(%rip), %eax    # 0x21879c
movl %eax, 0x20689f(%rip)    # 0x2187a4
movl 0x206961(%rip), %eax    # 0x21886c
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x20698e(%rip)    # 0x2188a8
movl $0xa0, %eax
movl %eax, 0x329373(%rip)    # 0x33b298
movl %eax, 0x329461(%rip)    # 0x33b38c
cmpl $0x10, 0x2068e2(%rip)   # 0x218814
jl 0x11f3e
movl $0x0, 0x22d002(%rip)    # 0x23ef40
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: config_zoom()
void config_zoom()
{
   if(zoom_screen == 0) return;
   if(plot_signals) return;
   if(plot_watch) return;
   if(plot_digital_clock) return;
   if(plot_azel) return;
   if(plot_lla && (zoom_screen == 'L')) return;

   if(text_mode) cancel_zoom(3);
   if(zoom_screen == 'L') cancel_zoom(4);
//zzzzzzz   zoom_lla = 0;
}

// Assembly:
movb 0x2f9e0c(%rip), %al     # 0x30c7a8
testb %al, %al
je 0x129fd
cmpb $0x0, 0x208a6e(%rip)    # 0x21b415
jne 0x129fd
cmpb $0x0, 0x208a58(%rip)    # 0x21b408
jne 0x129fd
cmpb $0x0, 0x208a2c(%rip)    # 0x21b3e5
jne 0x129fd
cmpb $0x0, 0x208a51(%rip)    # 0x21b413
jne 0x129fd
cmpb $0x4c, %al
jne 0x129d1
cmpb $0x0, 0x3288e1(%rip)    # 0x33b2b0
jne 0x129fd
cmpl $0x0, 0x205e00(%rip)    # 0x2187d8
je 0x129ef
pushq %rbp
movq %rsp, %rbp
movl $0x3, %edi
callq 0x2754a
movb 0x2f9dba(%rip), %al     # 0x30c7a8
popq %rbp
cmpb $0x4c, %al
jne 0x129fd
movl $0x4, %edi
jmp 0x2754a
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: scale_temp(double)
DATA_SIZE scale_temp(double t)
{
double x;

   // convert degrees C into user specified measurement system
   x = (double) t;
   if     (DEG_SCALE == 'C') ;
   else if(DEG_SCALE == 'D') x = (100.0-x) * 1.5;
   else if(DEG_SCALE == 'E') x = (x * (21.0 / 40.0)) + 7.5;
   else if(DEG_SCALE == 'F') x = (x * 1.8) + 32.0;
   else if(DEG_SCALE == 'H') x = (x - 20.0) / 10.0;   // degrees Hilton (as in Paris Hilton)
   else if(DEG_SCALE == 'N') x = x * 0.33F;
   else if(DEG_SCALE == 'O') x = (x * (21.0 / 40.0)) + 7.5;
   else if(DEG_SCALE == 'R') x = (x + 273.15) * 1.8;
   else if(DEG_SCALE == 'K') x = x + 273.15;

   return (DATA_SIZE) x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x2f9dd1(%rip), %eax    # 0x30cfa5
addl $-0x44, %eax
cmpl $0xe, %eax
ja 0x13264
leaq 0xf6201(%rip), %rcx     # 0x1093e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
mulsd 0xf5e90(%rip), %xmm0    # 0x109088
addsd 0xf5e90(%rip), %xmm0    # 0x109090
jmp 0x13264
addsd 0xf5e6e(%rip), %xmm0    # 0x109078
jmp 0x13264
movsd 0xf5e4c(%rip), %xmm1    # 0x109060
subsd %xmm0, %xmm1
mulsd 0xf5e98(%rip), %xmm1    # 0x1090b8
movapd %xmm1, %xmm0
jmp 0x13264
mulsd 0xf5e6a(%rip), %xmm0    # 0x109098
jmp 0x13264
addsd 0xf5e40(%rip), %xmm0    # 0x109078
mulsd 0xf5e40(%rip), %xmm0    # 0x109080
jmp 0x13264
mulsd 0xf5e36(%rip), %xmm0    # 0x109080
addsd 0xf5e5e(%rip), %xmm0    # 0x1090b0
jmp 0x13264
addsd 0xf5e44(%rip), %xmm0    # 0x1090a0
divsd 0xf5e44(%rip), %xmm0    # 0x1090a8
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x131c9
movl 0x2f9a11(%rip), %eax    # 0x30cc88
decl %eax
cmpl $0x5, %eax
jae 0x13290
movl %eax, %eax
leaq 0xf6345(%rip), %rcx     # 0x1095cc
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x132d4
cmpq $0x80000, 0x205635(%rip) # imm = 0x80000
jne 0x132a6
leaq 0xf70a8(%rip), %rsi     # 0x10a34c
jmp 0x132d4
movsd %xmm0, -0x10(%rbp)
callq 0x5f6cb
movsd -0x10(%rbp), %xmm0
cmpl $0x0, 0x2f9f90(%rip)    # 0x30d24c
leaq 0xf7089(%rip), %rsi     # 0x10a34c
leaq 0xf708c(%rip), %rcx     # 0x10a356
cmovneq %rcx, %rsi
testl %eax, %eax
cmoveq %rcx, %rsi
movsbl 0x2f9cca(%rip), %ecx    # 0x30cfa5
leaq 0x32cf7e(%rip), %rbx    # 0x340260
movq %rbx, %rdi
movl $0x1, %edx
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f9c88(%rip), %rax    # 0x30cfa8
cmpb $0x66, (%rax)
jne 0x13344
mulsd 0xf5d93(%rip), %xmm0    # 0x1090c0
leaq 0x32d02c(%rip), %rdi    # 0x340360
leaq 0xf74e6(%rip), %rsi     # 0x10a821
leaq 0x116da5(%rip), %rdx    # 0x12a0e7
jmp 0x13359
leaq 0x32d015(%rip), %rdi    # 0x340360
leaq 0xf74cf(%rip), %rsi     # 0x10a821
leaq 0x121bf0(%rip), %rdx    # 0x134f49
movb $0x1, %al
callq 0x9060
leaq 0x32cff9(%rip), %rax    # 0x340360
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x207f29(%rip), %ecx    # 0x21b2a0
testb $0x1, %cl
movl $0x3e, %eax
movl $0x5d, %r9d
cmovel %eax, %r9d
movl $0x3c, %eax
movl $0x5b, %r8d
cmovel %eax, %r8d
movsd 0xf5cc8(%rip), %xmm1    # 0x109068
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movsd 0x207fa8(%rip), %xmm1   # 0x21b358
cvttpd2dq %xmm1, %xmm2
movslq %eax, %r10
cvtdq2pd %xmm2, %xmm2
testb $0x2, %cl
jne 0x13413
ucomisd %xmm2, %xmm1
jne 0x1341b
jp 0x1341b
cmpl $0x3b, %eax
jle 0x13438
cmpl $0xe0f, %eax            # imm = 0xE0F
ja 0x13463
movabsq $-0x7777777777777777, %rcx # imm = 0x8888888888888889
movq %r10, %rax
mulq %rcx
movq %rdx, %rcx
shrq $0x5, %rcx
imulq $0x3c, %rcx, %rax
subq %rax, %r10
leaq 0x32d063(%rip), %rdi    # 0x340460
leaq 0xf6f6f(%rip), %rsi     # 0x10a373
movl %r8d, %edx
movq %r10, %r8
xorl %eax, %eax
callq 0x9060
jmp 0x13456
ucomisd %xmm2, %xmm1
jne 0x1341b
jnp 0x13438
leaq 0x32d03e(%rip), %rdi    # 0x340460
leaq 0xf6f37(%rip), %rsi     # 0x10a360
movl %r8d, %edx
movl %r9d, %ecx
movb $0x1, %al
callq 0x9060
jmp 0x13456
leaq 0x32d021(%rip), %rdi    # 0x340460
leaq 0xf6f24(%rip), %rsi     # 0x10a36a
movl %r8d, %edx
movq %r10, %rcx
movl %r9d, %r8d
xorl %eax, %eax
callq 0x9060
leaq 0x32d003(%rip), %rax    # 0x340460
addq $0x10, %rsp
popq %rbp
retq
movq %r10, %rax
shrq $0x4, %rax
movabsq $0x91a2b3c4d5e6f81, %rcx # imm = 0x91A2B3C4D5E6F81
mulq %rcx
movq %rdx, %rcx
shrq $0x3, %rcx
movabsq $-0x7777777777777777, %rdx # imm = 0x8888888888888889
movq %r10, %rax
mulq %rdx
movq %rdx, %r11
shrq $0x5, %r11
movabsq $0x888888888888889, %rdx # imm = 0x888888888888889
movq %r11, %rax
mulq %rdx
shrq %rdx
imulq $0x3c, %rdx, %rax
imulq $0x3c, %r11, %rdx
subq %rax, %r11
subq %rdx, %r10
movl %r9d, (%rsp)
leaq 0x32cf9f(%rip), %rdi    # 0x340460
leaq 0xf6eb8(%rip), %rsi     # 0x10a380
movl %r8d, %edx
movq %r11, %r8
movq %r10, %r9
xorl %eax, %eax
callq 0x9060
jmp 0x13456
// File: /workspace/github_cpp_makefile_star2_O3/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 0x204c87(%rip), %rax    # 0x2188d0
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x13c67
cmpl $0xb, %edi
ja 0x13ca8
movl $0x1, %eax
movl $0xc03, %ecx            # imm = 0xC03
btl %edi, %ecx
jb 0x13caa
jmp 0x13ca8
movl 0x2f95cb(%rip), %ecx    # 0x30d238
testl %ecx, %ecx
setne %dl
cmpl $0x37, %ecx
setne %cl
testb %cl, %dl
jne 0x13c90
cmpl $0x0, 0x2f8dcd(%rip)    # 0x30ca50
je 0x13c90
testl %edi, %edi
jne 0x13ca8
movl $0x1, %eax
jmp 0x13caa
cmpq $0x1000000, %rax        # imm = 0x1000000
sete %cl
cmpl $0x1, %edi
sete %dl
movl $0x1, %eax
testb %cl, %dl
jne 0x13caa
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x226d95(%rip)    # 0x23ef58
je 0x181c6
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0xf035
cmpb $0x0, 0x31ee42(%rip)    # 0x33701a
jne 0x181ec
cmpb $0x0, 0x31ee37(%rip)    # 0x337018
jne 0x181ec
cmpb $0x0, 0x31ee2f(%rip)    # 0x337019
je 0x181f1
callq 0x72683
cmpl $0x0, 0x327b70(%rip)    # 0x33fd68
jne 0x1822f
cmpq $0x400, 0x2006cb(%rip) # imm = 0x400
je 0x1822f
callq 0x16e97
cmpl $0x0, 0x2005c5(%rip)    # 0x2187d8
jne 0x1822f
movzbl 0x2f458c(%rip), %eax    # 0x30c7a8
cmpl $0x50, %eax
je 0x18225
testl %eax, %eax
jne 0x1822f
callq 0x1730e
callq 0x17613
popq %rbp
jmp 0x17eb5
// File: /workspace/github_cpp_makefile_star2_O3/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 0xf0ee7(%rip), %xmm2    # 0x109128
movsd 0xf0ee7(%rip), %xmm3    # 0x109130
movsd 0xf0ee7(%rip), %xmm4    # 0x109138
movsd 0xf0e4f(%rip), %xmm5    # 0x1090a8
movsd 0xf0edf(%rip), %xmm6    # 0x109140
ucomisd %xmm0, %xmm2
jae 0x182a1
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jae 0x182a5
movapd %xmm2, %xmm1
mulsd %xmm3, %xmm1
ucomisd %xmm0, %xmm1
jae 0x182a5
movapd %xmm2, %xmm1
mulsd %xmm4, %xmm1
ucomisd %xmm0, %xmm1
jae 0x182a5
mulsd %xmm5, %xmm2
ucomisd %xmm2, %xmm6
jae 0x18261
movapd %xmm0, %xmm1
jmp 0x182a5
movapd %xmm2, %xmm1
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2002e3(%rip), %xmm1 # 0x21886c
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl %edi, %eax
movl 0x2002fb(%rip), %ebx    # 0x218894
movl %ebx, %ecx
subl %edx, %ecx
jle 0x185b1
movl %ebx, %edi
negl %edi
cmpl %edi, %edx
jle 0x185c0
addl 0x2002cf(%rip), %ecx    # 0x21887c
movl %ecx, %ebx
jmp 0x185cf
orb $0x1, 0x202e1f(%rip)    # 0x21b3d7
movl 0x2002be(%rip), %ebx    # 0x21887c
jmp 0x185cf
orb $0x2, 0x202e10(%rip)    # 0x21b3d7
addl %ebx, %ebx
addl 0x2002ad(%rip), %ebx    # 0x21887c
cmpb $0x0, 0x327f8e(%rip)    # 0x340564
movl 0x2002a4(%rip), %ecx    # 0x218880
je 0x185f3
addl 0x202de8(%rip), %ecx    # 0x21b3cc
movzbl %sil, %edx
movl %ecx, %edi
movl %ebx, %esi
callq 0xe657
jmp 0x18610
movl 0x327f67(%rip), %edi    # 0x340560
addl %ecx, %edi
addl 0x202dcb(%rip), %ecx    # 0x21b3cc
movzbl %sil, %r8d
movl %eax, %esi
movl %ecx, %edx
movl %ebx, %ecx
callq 0xe38a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1fda66(%rip) # imm = 0x20000
jne 0x1ae76
movl $0x0, 0x2f193a(%rip)    # 0x30c7b0
pushq %rbp
movq %rsp, %rbp
movl $0x4, %edi
callq 0x27479
cmpq $0x20000, 0x1fda41(%rip) # imm = 0x20000
jne 0x1ae9d
movb $0x44, 0x2f1910(%rip)   # 0x30c7a8
jmp 0x1af7a
movb $0x4c, 0x2f1904(%rip)   # 0x30c7a8
movzbl 0x320429(%rip), %eax    # 0x33b2d4
movl %eax, 0x2f18fb(%rip)    # 0x30c7ac
movb $0x1, 0x32041c(%rip)    # 0x33b2d4
movl $0x1, %edi
callq 0x3ab43
cmpb $0x0, 0x32040b(%rip)    # 0x33b2d4
je 0x1af6b
cmpb $0x0, 0x2f2fc2(%rip)    # 0x30de98
jne 0x1af6b
movsd 0x2f20ec(%rip), %xmm0   # 0x30cfd0
movsd %xmm0, 0x320404(%rip)   # 0x33b2f0
movsd 0x2f20e4(%rip), %xmm1   # 0x30cfd8
movsd %xmm1, 0x3203fc(%rip)   # 0x33b2f8
movsd 0x2f20dc(%rip), %xmm2   # 0x30cfe0
movsd %xmm2, 0x3203f4(%rip)   # 0x33b300
movl $0xffffffff, 0x3203f2(%rip) # imm = 0xFFFFFFFF
cmpl $0x0, 0x320423(%rip)    # 0x33b340
je 0x1af29
movsd 0x3203e9(%rip), %xmm0   # 0x33b310
jmp 0x1af41
movsd %xmm0, 0x3203df(%rip)   # 0x33b310
movsd %xmm1, 0x3203df(%rip)   # 0x33b318
movsd %xmm2, 0x3203df(%rip)   # 0x33b320
callq 0x9710
movsd %xmm0, 0x2f207a(%rip)   # 0x30cfc8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1af6b
jp 0x1af6b
movabsq $0x3f50624dd2f1a9fc, %rax # imm = 0x3F50624DD2F1A9FC
movq %rax, 0x2f205d(%rip)    # 0x30cfc8
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl $0x3, %esi
callq 0xfad64
movl $0x71, %edi
popq %rbp
jmp 0xcf89
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b44a
movl %edi, %eax
leaq 0x1ffed8(%rip), %rcx    # 0x21b2b0
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
setne %dl
movl 0x1fffe8(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1b44a
movslq %eax, %rsi
movq 0x1ffe77(%rip), %rax    # 0x21b278
movq %rax, 0x1ffe90(%rip)    # 0x21b298
movl 0x1fd476(%rip), %eax    # 0x218884
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movslq %edx, %rax
imulq 0x1fff7e(%rip), %rax    # 0x21b3a0
cqto
idivq %rsi
movq %rcx, %rdi
subq %rax, %rdi
xorl %eax, %eax
cmpq 0x1ffefa(%rip), %rcx    # 0x21b330
jge 0x1b43f
movq 0x1ffee1(%rip), %rax    # 0x21b320
addq %rax, %rdi
xorl %esi, %esi
popq %rbp
jmp 0x113ce
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1ffb2d(%rip)    # 0x21b258
setne %cl
movl 0x1ffc9c(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1b786
movslq %eax, %rcx
cmpq $0x1, 0x1ffc55(%rip)    # 0x21b3a0
sete %al
movq 0x1ffc43(%rip), %rsi    # 0x21b398
testq %rsi, %rsi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1b788
movq 0x1ffc4f(%rip), %rdx    # 0x21b3b8
testq %rdx, %rdx
jne 0x1b797
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl 0x1fd0f9(%rip)          # 0x218874
cltq
cqto
idivq %rsi
movl %eax, %edx
jmp 0x1b797
popq %rbp
retq
movl $0x0, 0x1fd10a(%rip)    # 0x21889c
movl $0x1, %edx
movq %rdx, 0x1ffc02(%rip)    # 0x21b3a0
movq 0x1ffad3(%rip), %rsi    # 0x21b278
movq %rsi, 0x1ffb04(%rip)    # 0x21b2b0
movl 0x1fd0d2(%rip), %eax    # 0x218884
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
movslq %edi, %rax
imulq %rdx, %rax
cqto
idivq %rcx
movl %esi, %edi
subl %eax, %edi
xorl %eax, %eax
cmpq 0x1ffb5c(%rip), %rsi    # 0x21b330
jge 0x1b7dc
movl 0x1ffb44(%rip), %eax    # 0x21b320
addl %eax, %edi
movl $0x1, %esi
popq %rbp
jmp 0x113ce
// File: /workspace/github_cpp_makefile_star2_O3/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 0x220726(%rip)          # 0x23cd41
movq 0x1fed16(%rip), %rcx    # 0x21b338
cmpq %rdi, %rcx
jle 0x1c635
testq %rdi, %rdi
jns 0x1c671
movl $0x9, %edi
xorl %ebx, %ebx
jmp 0x1c669
movslq 0x1fed94(%rip), %rsi    # 0x21b3d0
testq %rsi, %rsi
je 0x1c65b
movslq 0x1fc230(%rip), %rax    # 0x218878
imulq 0x1fed50(%rip), %rax    # 0x21b3a0
cqto
idivq %rsi
subq %rax, %rcx
movq %rcx, %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
cmovgq %rdi, %rbx
movl $0x8, %edi
callq 0x9d78
movq %rbx, %rdi
movq %rdi, 0x2206d0(%rip)    # 0x23cd48
movb $0x1, 0x2206c1(%rip)    # 0x23cd40
movq %rdi, 0x1fecc2(%rip)    # 0x21b348
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x197ae
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1fe98f(%rip)    # 0x21b3a0
jne 0x1ca66
movq 0x1fe97e(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca66
movsd 0x1fe931(%rip), %xmm0   # 0x21b358
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1ca33
jnp 0x1ca66
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl 0x1fbe34(%rip)          # 0x218874
cltq
cqto
idivq %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
cltq
movq %rax, 0x1fe93c(%rip)    # 0x21b3a0
jmp 0x1ca91
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x1fbe28(%rip)    # 0x21889c
movq $0x1, 0x1fe921(%rip) # 0x21b3a0
movl $0x8, %edi
callq 0xcf89
movq 0x1fe910(%rip), %rax    # 0x21b3a0
popq %rbp
testq %rax, %rax
jg 0x1caa1
movq $0x1, 0x1fe8ff(%rip) # 0x21b3a0
movq $0x0, 0x1fe90c(%rip) # 0x21b3b8
jmp 0xfa97
// File: /workspace/github_cpp_makefile_star2_O3/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, 0x1fe90f(%rip)    # 0x21b3c7
jne 0x1cb5b
pushq %rbp
movq %rsp, %rbp
movl $0x9, %edi
callq 0xcf89
movl 0x1fbd2e(%rip), %eax    # 0x218800
movl 0x1fbd9c(%rip), %ecx    # 0x218874
cltd
idivl %ecx
movl %eax, 0x1fbdbb(%rip)    # 0x21889c
cmpq $0x1, 0x1fe8b7(%rip)    # 0x21b3a0
sete %al
movq 0x1fe8a5(%rip), %rsi    # 0x21b398
testq %rsi, %rsi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1cb19
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivl %ecx
cltq
cqto
idivq %rsi
movq %rax, 0x1fe889(%rip)    # 0x21b3a0
jmp 0x1cb3f
movl $0x0, 0x1fbd79(%rip)    # 0x21889c
movq $0x1, 0x1fe872(%rip) # 0x21b3a0
movl $0xa, %edi
callq 0xcf89
movq 0x1fe861(%rip), %rax    # 0x21b3a0
testq %rax, %rax
popq %rbp
jg 0x1cb50
movq $0x1, 0x1fe850(%rip) # 0x21b3a0
movq $0x0, 0x1fe85d(%rip) # 0x21b3b8
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x321cd0(%rip), %rdi    # 0x33e850
callq 0x9340
movl $0x3, 0x32273d(%rip)    # 0x33f2cc
callq 0x17eb5
callq 0xab54
movl $0xe, %edi
callq 0x9d78
callq 0xd5aa
movq 0x154311(%rip), %rdi    # 0x170ec0
callq 0x95c0
cmpb $0x4b, 0x2efbed(%rip)   # 0x30c7a8
jne 0x1cbc2
callq 0x1c461
callq 0xa80b
mulsd 0xec469(%rip), %xmm0    # 0x109038
addsd 0xec481(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f09b9(%rip)   # 0x30d598
movl 0x323463(%rip), %eax    # 0x340048
cmpl %eax, 0x323459(%rip)    # 0x340044
je 0x1cba3
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpl $0xf, %eax
cmovll %ecx, %edx
movl %edx, 0x32344a(%rip)    # 0x340048
movl $0xf, %edi
popq %rbp
jmp 0x9d78
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1fbcc0(%rip), %rax    # 0x2188d0
cmpl $0x0, 0x1fe601(%rip)    # 0x21b218
je 0x1cc1a
retq
movl $0x20, 0x222334(%rip)   # 0x23ef58
cmpl $0x0, 0x31a3f9(%rip)    # 0x337024
jne 0x1cc19
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movabsq $0x101b465000, %rcx     # imm = 0x101B465000
testq %rcx, %rax
setne %al
testl %edi, %edi
sete %bl
orb %al, %bl
callq 0xd5aa
movq 0x15426a(%rip), %rdi    # 0x170ec0
callq 0x95c0
cmpb $0x4b, 0x2efb46(%rip)   # 0x30c7a8
je 0x1cc6d
cmpl $0x0, 0x3239b1(%rip)    # 0x34061c
je 0x1cc72
callq 0x1c461
callq 0xa80b
mulsd 0xec3b9(%rip), %xmm0    # 0x109038
addsd 0xec3d1(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f0909(%rip)   # 0x30d598
movl 0x3233af(%rip), %eax    # 0x340044
cmpl 0x3233ad(%rip), %eax    # 0x340048
jne 0x1ccdd
testb %bl, %bl
jne 0x1ccd0
cmpl $0x0, 0x30902c(%rip)    # 0x325cd4
jne 0x1cccb
cmpq $0x0, 0x22170e(%rip)    # 0x23e3c0
jne 0x1cccb
movq 0x1fbc15(%rip), %rax    # 0x2188d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1cccb
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1ccd0
callq 0x1cce4
cmpl $0x0, 0x31a34d(%rip)    # 0x337024
je 0x1cc4a
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movb 0x1fe52c(%rip), %bl     # 0x21b21c
movb $0x2, 0x1fe525(%rip)    # 0x21b21c
movb $0x1, 0x31a32a(%rip)    # 0x337028
movl 0x22224c(%rip), %eax    # 0x23ef50
orl 0x31a31a(%rip), %eax    # 0x337024
jne 0x1cd95
cmpl $0x0, 0x308fbd(%rip)    # 0x325cd4
jne 0x1cd3a
cmpq $0x0, 0x22169f(%rip)    # 0x23e3c0
jne 0x1cd3a
movq 0x1fbba6(%rip), %rax    # 0x2188d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1cd3a
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1cd95
movl $0xa, %edi
callq 0xb9ad
testl %eax, %eax
je 0x1cd95
callq 0xd5aa
movq 0x15416c(%rip), %rdi    # 0x170ec0
callq 0x95c0
callq 0xc0e87
callq 0x1e5c3
movq 0x1fbb66(%rip), %rax    # 0x2188d0
cmpq $0x1000, %rax           # imm = 0x1000
sete %cl
cmpl $0x4e, 0x1fe26e(%rip)   # 0x21afe8
sete %dl
testb %dl, %cl
jne 0x1cd95
cmpq $0x40000, %rax          # imm = 0x40000
je 0x1cd95
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x1ccfe
movl $0xa, %edi
callq 0x1e66a
movb %bl, 0x1fe477(%rip)     # 0x21b21c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xd5aa
movq 0x154104(%rip), %rdi    # 0x170ec0
callq 0x95c0
callq 0xa80b
mulsd 0xec26a(%rip), %xmm0    # 0x109038
addsd 0xec282(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f07ba(%rip)   # 0x30d598
movl 0x323264(%rip), %eax    # 0x340048
cmpl %eax, 0x32325a(%rip)    # 0x340044
je 0x1ce1f
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpl $0xf, %eax
cmovll %ecx, %edx
movl %edx, 0x32324b(%rip)    # 0x340048
movslq %edx, %rax
leaq 0x3231f9(%rip), %rcx    # 0x340000
cmpl $0x1b, (%rcx,%rax,4)
jne 0x1ce1f
leaq 0xedde1(%rip), %rsi     # 0x10abf5
movl $0x1a0a, %edi           # imm = 0x1A0A
popq %rbp
jmp 0xb424
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x222066(%rip), %rdi    # 0x23eeb8
testq %rdi, %rdi
je 0x1cf61
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x22204c(%rip), %ebx    # 0x23eeb4
testb %al, %al
je 0x1ceb9
testl %ebx, %ebx
jle 0x1ce98
leaq 0x221da1(%rip), %rbx    # 0x23ec18
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x9370
incq %r14
movslq 0x222028(%rip), %rax    # 0x23eeb4
addq $0xa8, %rbx
cmpq %rax, %r14
jl 0x1ce7a
movq $0x0, 0x222015(%rip) # 0x23eeb8
movb $0x0, 0x222026(%rip)    # 0x23eed0
movl $0x0, 0x222000(%rip)    # 0x23eeb4
jmp 0x1cf5d
callq 0x9370
testl %ebx, %ebx
je 0x1cf4b
movslq 0x221fe7(%rip), %rax    # 0x23eeb4
decq %rax
movl %eax, 0x221fde(%rip)    # 0x23eeb4
imulq $0xa8, %rax, %rbx
leaq 0x221cac(%rip), %r14    # 0x23eb90
leaq (%r14,%rbx), %rsi
leaq 0x221f41(%rip), %rdi    # 0x23ee30
callq 0x9340
movq 0x88(%rbx,%r14), %rax
movq %rax, 0x221fb5(%rip)    # 0x23eeb8
movl 0x90(%rbx,%r14), %eax
movl %eax, 0x221faf(%rip)    # 0x23eec0
movl 0x94(%rbx,%r14), %eax
movl %eax, 0x221fa5(%rip)    # 0x23eec4
movl 0x98(%rbx,%r14), %eax
movl %eax, 0x221f9b(%rip)    # 0x23eec8
movl 0x9c(%rbx,%r14), %eax
movl %eax, 0x221f91(%rip)    # 0x23eecc
movb 0xa0(%rbx,%r14), %al
movb %al, 0x221f87(%rip)     # 0x23eed0
jmp 0x1cf5d
movq $0x0, 0x221f62(%rip) # 0x23eeb8
movb $0x0, 0x221f73(%rip)    # 0x23eed0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x221f3e(%rip), %r15    # 0x23eeb8
testq %r15, %r15
je 0x1d00a
movslq 0x221f2a(%rip), %r14    # 0x23eeb4
cmpq $0x3, %r14
jg 0x1d065
imulq $0xa8, %r14, %r12
leaq 0x221bee(%rip), %r13    # 0x23eb90
leaq (%r12,%r13), %rdi
leaq 0x221e83(%rip), %rsi    # 0x23ee30
callq 0x9340
movq %r15, 0x88(%r12,%r13)
movl 0x221f00(%rip), %eax    # 0x23eec0
movl %eax, 0x90(%r12,%r13)
movl 0x221ef6(%rip), %eax    # 0x23eec4
movl %eax, 0x94(%r12,%r13)
movl 0x221ef0(%rip), %eax    # 0x23eecc
movl %eax, 0x9c(%r12,%r13)
movl 0x221ede(%rip), %eax    # 0x23eec8
movl %eax, 0x98(%r12,%r13)
movb 0x221ed8(%rip), %al     # 0x23eed0
movb %al, 0xa0(%r12,%r13)
leal 0x1(%r14), %eax
movl %eax, 0x221eaa(%rip)    # 0x23eeb4
leaq 0x221e1f(%rip), %rdi    # 0x23ee30
movl $0x80, %edx
movq %rbx, %rsi
callq 0x9170
leaq 0x103d68(%rip), %rsi    # 0x120d8d
movq %rbx, %rdi
callq 0x9a47
movq %rax, %rcx
movq %rax, 0x221e81(%rip)    # 0x23eeb8
movl $0x1, 0x221e7f(%rip)    # 0x23eec0
xorl %eax, %eax
movl %eax, 0x221e7b(%rip)    # 0x23eec4
movl %eax, 0x221e7d(%rip)    # 0x23eecc
movb %al, 0x221e7b(%rip)     # 0x23eed0
movb %al, 0x221e76(%rip)     # 0x23eed1
xorl %eax, %eax
testq %rcx, %rcx
sete %al
jmp 0x1d080
leaq 0xedbb0(%rip), %rdi     # 0x10ac1c
callq 0x23027
movl $0x1, %edi
callq 0x1ce49
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq