LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x209e9b(%rip), %rcx    # 0x21b470
testq %rcx, %rcx
js 0x115ea
movslq 0x2072a3(%rip), %rax    # 0x218884
cmpq %rax, %rcx
cmovlq %rcx, %rax
popq %rbp
retq
movq 0x209da7(%rip), %rax    # 0x21b398
imulq 0x209da7(%rip), %rax    # 0x21b3a0
movslq 0x207284(%rip), %rdx    # 0x218884
imulq %rdx, %rax
cvtsi2sd %rax, %xmm0
negq %rcx
cvtsi2sd %rcx, %xmm1
cvtsi2sdl 0x209db7(%rip), %xmm2 # 0x21b3d0
mulsd %xmm0, %xmm1
divsd %xmm2, %xmm1
divsd 0x209d2f(%rip), %xmm1   # 0x21b358
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm1
addsd 0xf7a2c(%rip), %xmm1    # 0x109068
movsd 0xf7a2c(%rip), %xmm2    # 0x109070
maxsd %xmm1, %xmm2
minsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x209821(%rip), %eax    # 0x21b478
cmpl $0x46, %eax
je 0x11ce0
cmpl $0x43, %eax
je 0x11ced
cmpl $0x42, %eax
jne 0x11c7b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11653
jmp 0x11cf8
callq 0x115ca
movq 0x209699(%rip), %rdx    # 0x21b320
movq 0x2096aa(%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 0x11ced
leaq (%rax,%r14), %rsi
xorl %edi, %edi
cmpq %rdx, %rsi
cmovgq %rdx, %rdi
subq %rdi, %rsi
cmpq %rcx, %rsi
jle 0x11ce0
movq %r14, %rsi
subq %rax, %rsi
movq %rsi, %rax
sarq $0x3f, %rax
andq %rdx, %rax
addq %rsi, %rax
cmpq %rcx, %rax
jle 0x11c6e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11a5e
jmp 0x11cf8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11846
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x206b7a(%rip), %eax    # 0x218880
movl 0x206b03(%rip), %r8d    # 0x218810
cltd
idivl %r8d
movl %eax, %ecx
movl %eax, 0x206b73(%rip)    # 0x21888c
movl 0x206b5d(%rip), %esi    # 0x21887c
movl 0x206aee(%rip), %r9d    # 0x218814
movl %esi, %eax
cltd
idivl %r9d
movl %eax, %edi
movl %eax, 0x206b5c(%rip)    # 0x218890
leal 0x2(%rcx), %eax
movl %eax, 0x206a6f(%rip)    # 0x2187ac
leal -0x1(,%r9,2), %eax
cltd
idivl %r9d
addl 0x22d1f1(%rip), %eax    # 0x23ef40
negl %eax
addl %edi, %eax
addl $-0x6, %eax
movl %eax, 0x206a4c(%rip)    # 0x2187a8
cmpl $0x10, %r9d
sete %dl
movl 0x206a9a(%rip), %r10d   # 0x218804
cmpl $0x259, %r10d           # imm = 0x259
setl %r11b
andb %dl, %r11b
cmpb $0x1, %r11b
jne 0x11d86
decl %eax
movl %eax, 0x206a22(%rip)    # 0x2187a8
cmpl $0x0, 0x206a1b(%rip)    # 0x2187a8
jns 0x11d99
movl $0x0, 0x206a0f(%rip)    # 0x2187a8
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x206a5b(%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, 0x206a47(%rip)    # 0x218808
leal (%r9,%r10), %eax
decl %eax
cltd
idivl %r9d
movl %eax, 0x206a3b(%rip)    # 0x21880c
cmpl $0x0, 0x206a00(%rip)    # 0x2187d8
je 0x11e06
movl %eax, 0x2069c8(%rip)    # 0x2187a8
xorl %eax, %eax
movl %eax, 0x32d828(%rip)    # 0x33f610
movl %eax, 0x32d81e(%rip)    # 0x33f60c
leal (%r9,%r9,2), %eax
addl %esi, %eax
movl %eax, 0x206a82(%rip)    # 0x21887c
movl $0x64, 0x206a8c(%rip)   # 0x218890
jmp 0x11e23
xorl %eax, %eax
cmpl $0x1e1, %r10d           # imm = 0x1E1
setl %al
subl %eax, %edi
addl $0x2, %edi
movl %edi, 0x32d7ef(%rip)    # 0x33f60c
movl %ecx, 0x32d7ed(%rip)    # 0x33f610
testl %r8d, %r8d
jle 0x11e3b
movl %ebx, %edx
leaq 0x32a1df(%rip), %rdi    # 0x33c010
movl $0x20, %esi
callq 0x91a0
movslq %ebx, %rax
leaq 0x32a1cb(%rip), %rcx    # 0x33c010
movb $0x0, (%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x2116e9(%rip)    # 0x223540
je 0x11eb7
movl 0x2116e5(%rip), %ecx    # 0x223544
movl 0x206a17(%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, 0x2069f8(%rip)    # 0x21887c
cmpl $0x63, %ecx
jg 0x11e98
movl 0x206985(%rip), %ecx    # 0x218814
leal (%rax,%rcx,2), %eax
movl %eax, 0x2069e4(%rip)    # 0x21887c
pushq %rbp
movq %rsp, %rbp
callq 0x11d00
leaq 0x110bcc(%rip), %rcx    # 0x122a74
xorl %edi, %edi
xorl %esi, %esi
movl $0xf, %edx
callq 0xe7d0
popq %rbp
movl 0x2069bf(%rip), %eax    # 0x21887c
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpb $0xd, 0x20698f(%rip)    # 0x218858
jb 0x11ed2
movb $0xc, 0x206986(%rip)    # 0x218858
movl $0x1e, 0x206998(%rip)   # 0x218874
movl $0x5, 0x206992(%rip)    # 0x218878
movl $0x14, 0x20697c(%rip)   # 0x21886c
movl $0x4, 0x206976(%rip)    # 0x218870
movl $0xa, 0x2069a4(%rip)    # 0x2188a8
cmpq $0x400, 0x2069c1(%rip) # imm = 0x400
jne 0x11f2e
movl 0x2068e9(%rip), %eax    # 0x218800
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x2, %ecx
movl %ecx, 0x329370(%rip)    # 0x33b298
movl %ecx, 0x32945e(%rip)    # 0x33b38c
cmpl $0x0, 0x211617(%rip)    # 0x22354c
je 0x11f39
popq %rbp
retq
movb 0x206919(%rip), %al     # 0x218858
decb %al
cmpb $0x8, %al
movl $0xffffff60, %eax       # imm = 0xFFFFFF60
movl $0xffffff88, %ecx       # imm = 0xFFFFFF88
cmovbl %eax, %ecx
addl 0x2068ae(%rip), %ecx    # 0x218804
movl %ecx, 0x206920(%rip)    # 0x21887c
popq %rbp
jmp 0x11e50
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x2115e3(%rip)    # 0x22354c
jne 0x11f7f
pushq %rbp
movq %rsp, %rbp
movl $0x198, 0x206903(%rip)  # imm = 0x198
callq 0x11e50
popq %rbp
movl $0x11, 0x206817(%rip)   # 0x2187a0
movl 0x20680d(%rip), %eax    # 0x21879c
movl %eax, 0x20680f(%rip)    # 0x2187a4
movl 0x2068d1(%rip), %eax    # 0x21886c
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x2068fe(%rip)    # 0x2188a8
movl $0xa0, %eax
movl %eax, 0x3292e3(%rip)    # 0x33b298
movl %eax, 0x3293d1(%rip)    # 0x33b38c
cmpl $0x10, 0x206852(%rip)   # 0x218814
jl 0x11fce
movl $0x0, 0x22cf72(%rip)    # 0x23ef40
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2f9d1e(%rip), %al     # 0x30c7a8
testb %al, %al
je 0x12aea
cmpb $0x0, 0x208980(%rip)    # 0x21b415
jne 0x12aea
cmpb $0x0, 0x20896a(%rip)    # 0x21b408
jne 0x12aea
cmpb $0x0, 0x20893e(%rip)    # 0x21b3e5
jne 0x12aea
cmpb $0x0, 0x208963(%rip)    # 0x21b413
jne 0x12aea
cmpb $0x4c, %al
jne 0x12abf
cmpb $0x0, 0x3287f3(%rip)    # 0x33b2b0
jne 0x12aea
cmpl $0x0, 0x205d12(%rip)    # 0x2187d8
je 0x12ad7
pushq %rbp
movq %rsp, %rbp
movl $0x3, %edi
callq 0x277f5
popq %rbp
cmpb $0x4c, 0x2f9cca(%rip)   # 0x30c7a8
jne 0x12aea
movl $0x4, %edi
jmp 0x277f5
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2f9d3c(%rip), %eax    # 0x30cfa5
addl $-0x44, %eax
cmpl $0xe, %eax
ja 0x132f9
leaq 0xf615c(%rip), %rcx     # 0x1093d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
mulsd 0xf5dfb(%rip), %xmm0    # 0x109088
addsd 0xf5dfb(%rip), %xmm0    # 0x109090
jmp 0x132f9
addsd 0xf5dd9(%rip), %xmm0    # 0x109078
jmp 0x132f9
movsd 0xf5db7(%rip), %xmm1    # 0x109060
subsd %xmm0, %xmm1
mulsd 0xf5e03(%rip), %xmm1    # 0x1090b8
movapd %xmm1, %xmm0
jmp 0x132f9
mulsd 0xf5dd5(%rip), %xmm0    # 0x109098
jmp 0x132f9
addsd 0xf5dab(%rip), %xmm0    # 0x109078
mulsd 0xf5dab(%rip), %xmm0    # 0x109080
jmp 0x132f9
mulsd 0xf5da1(%rip), %xmm0    # 0x109080
addsd 0xf5dc9(%rip), %xmm0    # 0x1090b0
jmp 0x132f9
addsd 0xf5daf(%rip), %xmm0    # 0x1090a0
divsd 0xf5daf(%rip), %xmm0    # 0x1090a8
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1325e
movl 0x2f997c(%rip), %eax    # 0x30cc88
decl %eax
cmpl $0x5, %eax
jae 0x13325
movl %eax, %eax
leaq 0xf62a0(%rip), %rcx     # 0x1095bc
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x13369
cmpq $0x80000, 0x2055a0(%rip) # imm = 0x80000
jne 0x1333b
leaq 0xf7003(%rip), %rsi     # 0x10a33c
jmp 0x13369
movsd %xmm0, -0x10(%rbp)
callq 0x5f743
movsd -0x10(%rbp), %xmm0
cmpl $0x0, 0x2f9efb(%rip)    # 0x30d24c
leaq 0xf6fe4(%rip), %rsi     # 0x10a33c
leaq 0xf6fe7(%rip), %rcx     # 0x10a346
cmovneq %rcx, %rsi
testl %eax, %eax
cmoveq %rcx, %rsi
movsbl 0x2f9c35(%rip), %ecx    # 0x30cfa5
leaq 0x32cee9(%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_O1/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 0x207e9a(%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 0xf5c39(%rip), %xmm1    # 0x109068
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movsd 0x207f19(%rip), %xmm1   # 0x21b358
cvttpd2dq %xmm1, %xmm2
movslq %eax, %r10
cvtdq2pd %xmm2, %xmm2
testb $0x2, %cl
jne 0x134a2
ucomisd %xmm2, %xmm1
jne 0x134aa
jp 0x134aa
cmpl $0x3b, %eax
jle 0x134c7
cmpl $0xe0f, %eax            # imm = 0xE0F
jg 0x134f2
movabsq $-0x7777777777777777, %rcx # imm = 0x8888888888888889
movq %r10, %rax
mulq %rcx
movq %rdx, %rcx
shrq $0x5, %rcx
imulq $0x3c, %rcx, %rax
subq %rax, %r10
leaq 0x32cfd4(%rip), %rdi    # 0x340460
leaq 0xf6ed0(%rip), %rsi     # 0x10a363
movl %r8d, %edx
movq %r10, %r8
xorl %eax, %eax
callq 0x9060
jmp 0x134e5
ucomisd %xmm2, %xmm1
jne 0x134aa
jnp 0x134c7
leaq 0x32cfaf(%rip), %rdi    # 0x340460
leaq 0xf6e98(%rip), %rsi     # 0x10a350
movl %r8d, %edx
movl %r9d, %ecx
movb $0x1, %al
callq 0x9060
jmp 0x134e5
leaq 0x32cf92(%rip), %rdi    # 0x340460
leaq 0xf6e85(%rip), %rsi     # 0x10a35a
movl %r8d, %edx
movq %r10, %rcx
movl %r9d, %r8d
xorl %eax, %eax
callq 0x9060
leaq 0x32cf74(%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 0x32cf10(%rip), %rdi    # 0x340460
leaq 0xf6e19(%rip), %rsi     # 0x10a370
movl %r8d, %edx
movq %r11, %r8
movq %r10, %r9
xorl %eax, %eax
callq 0x9060
jmp 0x134e5
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32bbfb(%rip), %rdx    # 0x33f850
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 0x13c8a
jnp 0x13cb9
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_O1/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 0x204bf8(%rip), %rax    # 0x2188d0
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x13cf6
cmpl $0xb, %edi
ja 0x13d37
movl $0x1, %eax
movl $0xc03, %ecx            # imm = 0xC03
btl %edi, %ecx
jb 0x13d39
jmp 0x13d37
movl 0x2f953c(%rip), %ecx    # 0x30d238
testl %ecx, %ecx
setne %dl
cmpl $0x37, %ecx
setne %cl
testb %cl, %dl
jne 0x13d1f
cmpl $0x0, 0x2f8d3e(%rip)    # 0x30ca50
je 0x13d1f
testl %edi, %edi
jne 0x13d37
movl $0x1, %eax
jmp 0x13d39
cmpq $0x1000000, %rax        # imm = 0x1000000
sete %cl
cmpl $0x1, %edi
sete %dl
movl $0x1, %eax
testb %cl, %dl
jne 0x13d39
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x226dd2(%rip)    # 0x23ef58
je 0x18189
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0xf0ad
cmpb $0x0, 0x31ee7f(%rip)    # 0x33701a
jne 0x181af
cmpb $0x0, 0x31ee74(%rip)    # 0x337018
jne 0x181af
cmpb $0x0, 0x31ee6c(%rip)    # 0x337019
je 0x181b4
callq 0x727c3
cmpl $0x0, 0x327bad(%rip)    # 0x33fd68
jne 0x181f2
cmpq $0x400, 0x200708(%rip) # imm = 0x400
je 0x181f2
callq 0x16e85
cmpl $0x0, 0x200602(%rip)    # 0x2187d8
jne 0x181f2
movzbl 0x2f45c9(%rip), %eax    # 0x30c7a8
cmpl $0x50, %eax
je 0x181e8
testl %eax, %eax
jne 0x181f2
callq 0x172f5
callq 0x175e0
popq %rbp
jmp 0x17e7f
// File: /workspace/github_cpp_makefile_star2_O1/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 0xf0f24(%rip), %xmm2    # 0x109128
movsd 0xf0f24(%rip), %xmm3    # 0x109130
movsd 0xf0f24(%rip), %xmm4    # 0x109138
movsd 0xf0e8c(%rip), %xmm5    # 0x1090a8
movsd 0xf0f1c(%rip), %xmm6    # 0x109140
ucomisd %xmm0, %xmm2
jae 0x18264
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
ucomisd %xmm0, %xmm1
jae 0x18268
movapd %xmm2, %xmm1
mulsd %xmm3, %xmm1
ucomisd %xmm0, %xmm1
jae 0x18268
movapd %xmm2, %xmm1
mulsd %xmm4, %xmm1
ucomisd %xmm0, %xmm1
jae 0x18268
mulsd %xmm5, %xmm2
ucomisd %xmm2, %xmm6
jae 0x18224
movapd %xmm0, %xmm1
jmp 0x18268
movapd %xmm2, %xmm1
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2002f3(%rip), %xmm1 # 0x21886c
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl %edi, %eax
movl 0x20030b(%rip), %ebx    # 0x218894
movl %ebx, %ecx
subl %edx, %ecx
jle 0x185a1
movl %ebx, %edi
negl %edi
cmpl %edi, %edx
jle 0x185b0
addl 0x2002df(%rip), %ecx    # 0x21887c
movl %ecx, %ebx
jmp 0x185bf
orb $0x1, 0x202e2f(%rip)    # 0x21b3d7
movl 0x2002ce(%rip), %ebx    # 0x21887c
jmp 0x185bf
orb $0x2, 0x202e20(%rip)    # 0x21b3d7
addl %ebx, %ebx
addl 0x2002bd(%rip), %ebx    # 0x21887c
cmpb $0x0, 0x327f9e(%rip)    # 0x340564
movl 0x2002b4(%rip), %ecx    # 0x218880
je 0x185e3
addl 0x202df8(%rip), %ecx    # 0x21b3cc
movzbl %sil, %edx
movl %ecx, %edi
movl %ebx, %esi
callq 0xe6a0
jmp 0x18600
movl 0x327f77(%rip), %edi    # 0x340560
addl %ecx, %edi
addl 0x202ddb(%rip), %ecx    # 0x21b3cc
movzbl %sil, %r8d
movl %eax, %esi
movl %ecx, %edx
movl %ebx, %ecx
callq 0xe3c3
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x1fda64(%rip) # imm = 0x20000
jne 0x1ae78
movl $0x0, 0x2f1938(%rip)    # 0x30c7b0
pushq %rbp
movq %rsp, %rbp
movl $0x4, %edi
callq 0x27724
cmpq $0x20000, 0x1fda3f(%rip) # imm = 0x20000
jne 0x1ae9f
movb $0x44, 0x2f190e(%rip)   # 0x30c7a8
jmp 0x1af7a
movb $0x4c, 0x2f1902(%rip)   # 0x30c7a8
movzbl 0x320427(%rip), %eax    # 0x33b2d4
movl %eax, 0x2f18f9(%rip)    # 0x30c7ac
movb $0x1, 0x32041a(%rip)    # 0x33b2d4
movl $0x1, %edi
callq 0x3aabf
cmpb $0x0, 0x320409(%rip)    # 0x33b2d4
je 0x1af6b
cmpb $0x0, 0x2f2fc0(%rip)    # 0x30de98
jne 0x1af6b
movsd 0x2f20ea(%rip), %xmm0   # 0x30cfd0
movsd %xmm0, 0x320402(%rip)   # 0x33b2f0
movsd 0x2f20e2(%rip), %xmm1   # 0x30cfd8
movsd %xmm1, 0x3203fa(%rip)   # 0x33b2f8
movsd 0x2f20da(%rip), %xmm2   # 0x30cfe0
movsd %xmm2, 0x3203f2(%rip)   # 0x33b300
movl $0xffffffff, 0x3203f0(%rip) # imm = 0xFFFFFFFF
cmpl $0x0, 0x320421(%rip)    # 0x33b340
jne 0x1af39
movsd %xmm0, 0x3203e7(%rip)   # 0x33b310
movsd %xmm1, 0x3203e7(%rip)   # 0x33b318
movsd %xmm2, 0x3203e7(%rip)   # 0x33b320
movsd 0x3203cf(%rip), %xmm0   # 0x33b310
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 0xfa611
movl $0x71, %edi
popq %rbp
jmp 0xcf81
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1b42b
movl %edi, %eax
leaq 0x1ffef7(%rip), %rcx    # 0x21b2b0
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
setne %dl
movl 0x200007(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1b42b
movslq %eax, %rsi
movq 0x1ffe96(%rip), %rax    # 0x21b278
movq %rax, 0x1ffeaf(%rip)    # 0x21b298
movl 0x1fd495(%rip), %eax    # 0x218884
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movslq %edx, %rax
imulq 0x1fff9d(%rip), %rax    # 0x21b3a0
cqto
idivq %rsi
movq %rcx, %rdi
subq %rax, %rdi
xorl %eax, %eax
cmpq 0x1fff19(%rip), %rcx    # 0x21b330
jge 0x1b420
movq 0x1fff00(%rip), %rax    # 0x21b320
addq %rax, %rdi
xorl %esi, %esi
popq %rbp
jmp 0x11461
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x1ffb56(%rip)    # 0x21b258
setne %cl
movl 0x1ffcc5(%rip), %eax    # 0x21b3d0
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1b75f
movslq %eax, %rcx
cmpq $0x1, 0x1ffc7e(%rip)    # 0x21b3a0
sete %al
movq 0x1ffc6c(%rip), %rsi    # 0x21b398
testq %rsi, %rsi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1b761
movq 0x1ffc78(%rip), %rdx    # 0x21b3b8
testq %rdx, %rdx
jne 0x1b770
movslq 0x1fd128(%rip), %rdi    # 0x218874
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivq %rdi
cqto
idivq %rsi
movl %eax, %edx
jmp 0x1b770
popq %rbp
retq
movl $0x0, 0x1fd131(%rip)    # 0x21889c
movl $0x1, %edx
movq %rdx, 0x1ffc29(%rip)    # 0x21b3a0
movq 0x1ffafa(%rip), %rsi    # 0x21b278
movq %rsi, 0x1ffb2b(%rip)    # 0x21b2b0
movl 0x1fd0f9(%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 0x1ffb83(%rip), %rsi    # 0x21b330
jge 0x1b7b5
movl 0x1ffb6b(%rip), %eax    # 0x21b320
addl %eax, %edi
movl $0x1, %esi
popq %rbp
jmp 0x11461
// File: /workspace/github_cpp_makefile_star2_O1/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 0x220763(%rip)          # 0x23cd41
movq 0x1fed53(%rip), %rcx    # 0x21b338
cmpq %rdi, %rcx
jle 0x1c5f8
testq %rdi, %rdi
jns 0x1c634
movl $0x9, %edi
xorl %ebx, %ebx
jmp 0x1c62c
movslq 0x1fedd1(%rip), %rsi    # 0x21b3d0
testq %rsi, %rsi
je 0x1c61e
movslq 0x1fc26d(%rip), %rax    # 0x218878
imulq 0x1fed8d(%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 0x9d80
movq %rbx, %rdi
movq %rdi, 0x22070d(%rip)    # 0x23cd48
movb $0x1, 0x2206fe(%rip)    # 0x23cd40
movq %rdi, 0x1fecff(%rip)    # 0x21b348
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x19792
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x1fe9cc(%rip)    # 0x21b3a0
jne 0x1ca2b
movq 0x1fe9bb(%rip), %rcx    # 0x21b398
testq %rcx, %rcx
jle 0x1ca2b
movsd 0x1fe96e(%rip), %xmm0   # 0x21b358
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1c9f6
jnp 0x1ca2b
movslq 0x1fbe77(%rip), %rsi    # 0x218874
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivq %rsi
cqto
idivq %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
cltq
movq %rax, 0x1fe977(%rip)    # 0x21b3a0
jmp 0x1ca4f
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x1fbe63(%rip)    # 0x21889c
movq $0x1, 0x1fe95c(%rip) # 0x21b3a0
movl $0x8, %edi
callq 0xcf81
popq %rbp
cmpq $0x0, 0x1fe949(%rip)    # 0x21b3a0
jg 0x1ca64
movq $0x1, 0x1fe93c(%rip) # 0x21b3a0
movq $0x0, 0x1fe949(%rip) # 0x21b3b8
jmp 0xfb1a
// File: /workspace/github_cpp_makefile_star2_O1/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, 0x1fe94c(%rip)    # 0x21b3c7
jne 0x1cb1c
pushq %rbp
movq %rsp, %rbp
movl $0x9, %edi
callq 0xcf81
movl 0x1fbd6b(%rip), %eax    # 0x218800
movslq 0x1fbdd8(%rip), %rcx    # 0x218874
cltd
idivl %ecx
movl %eax, 0x1fbdf7(%rip)    # 0x21889c
cmpq $0x1, 0x1fe8f3(%rip)    # 0x21b3a0
sete %al
movq 0x1fe8e1(%rip), %rsi    # 0x21b398
testq %rsi, %rsi
setg %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x1cadc
movl $0xe10, %eax            # imm = 0xE10
xorl %edx, %edx
idivq %rcx
cqto
idivq %rsi
movq %rax, 0x1fe8c6(%rip)    # 0x21b3a0
jmp 0x1cafb
movl $0x0, 0x1fbdb6(%rip)    # 0x21889c
movq $0x1, 0x1fe8af(%rip) # 0x21b3a0
movl $0xa, %edi
callq 0xcf81
cmpq $0x0, 0x1fe89d(%rip)    # 0x21b3a0
popq %rbp
jg 0x1cb11
movq $0x1, 0x1fe88f(%rip) # 0x21b3a0
movq $0x0, 0x1fe89c(%rip) # 0x21b3b8
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x321d0f(%rip), %rdi    # 0x33e850
callq 0x9340
movl $0x3, 0x32277c(%rip)    # 0x33f2cc
callq 0x17e7f
callq 0xab5f
movl $0xe, %edi
callq 0x9d80
callq 0xd5c9
movq 0x154350(%rip), %rdi    # 0x170ec0
callq 0x95c0
cmpb $0x4b, 0x2efc2c(%rip)   # 0x30c7a8
jne 0x1cb83
callq 0x1c406
callq 0xa826
mulsd 0xec4a8(%rip), %xmm0    # 0x109038
addsd 0xec4c0(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f09f8(%rip)   # 0x30d598
movl 0x3234a2(%rip), %eax    # 0x340048
cmpl %eax, 0x323498(%rip)    # 0x340044
je 0x1cb64
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpl $0xf, %eax
cmovll %ecx, %edx
movl %edx, 0x323489(%rip)    # 0x340048
movl $0xf, %edi
popq %rbp
jmp 0x9d80
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1fbcff(%rip), %rax    # 0x2188d0
cmpl $0x0, 0x1fe640(%rip)    # 0x21b218
je 0x1cbdb
retq
movl $0x20, 0x222373(%rip)   # 0x23ef58
cmpl $0x0, 0x31a438(%rip)    # 0x337024
jne 0x1cbda
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 0xd5c9
movq 0x1542a9(%rip), %rdi    # 0x170ec0
callq 0x95c0
cmpb $0x4b, 0x2efb85(%rip)   # 0x30c7a8
je 0x1cc2e
cmpl $0x0, 0x3239f0(%rip)    # 0x34061c
je 0x1cc33
callq 0x1c406
callq 0xa826
mulsd 0xec3f8(%rip), %xmm0    # 0x109038
addsd 0xec410(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f0948(%rip)   # 0x30d598
movl 0x3233ee(%rip), %eax    # 0x340044
cmpl 0x3233ec(%rip), %eax    # 0x340048
jne 0x1cc9e
testb %bl, %bl
jne 0x1cc91
cmpl $0x0, 0x30906b(%rip)    # 0x325cd4
jne 0x1cc8c
cmpq $0x0, 0x22174d(%rip)    # 0x23e3c0
jne 0x1cc8c
movq 0x1fbc54(%rip), %rax    # 0x2188d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1cc8c
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1cc91
callq 0x1cca5
cmpl $0x0, 0x31a38c(%rip)    # 0x337024
je 0x1cc0b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x1fe56b(%rip), %bl     # 0x21b21c
movb $0x2, 0x1fe564(%rip)    # 0x21b21c
movb $0x1, 0x31a369(%rip)    # 0x337028
movl 0x22228b(%rip), %eax    # 0x23ef50
orl 0x31a359(%rip), %eax    # 0x337024
jne 0x1cd56
cmpl $0x0, 0x308ffc(%rip)    # 0x325cd4
jne 0x1ccfb
cmpq $0x0, 0x2216de(%rip)    # 0x23e3c0
jne 0x1ccfb
movq 0x1fbbe5(%rip), %rax    # 0x2188d0
cmpq $0x400, %rax            # imm = 0x400
je 0x1ccfb
cmpq $0x800000, %rax         # imm = 0x800000
jne 0x1cd56
movl $0xa, %edi
callq 0xb9c3
testl %eax, %eax
je 0x1cd56
callq 0xd5c9
movq 0x1541ab(%rip), %rdi    # 0x170ec0
callq 0x95c0
callq 0xc08a9
callq 0x1e5f9
movq 0x1fbba5(%rip), %rax    # 0x2188d0
cmpq $0x1000, %rax           # imm = 0x1000
sete %cl
cmpl $0x4e, 0x1fe2ad(%rip)   # 0x21afe8
sete %dl
testb %dl, %cl
jne 0x1cd56
cmpq $0x40000, %rax          # imm = 0x40000
je 0x1cd56
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x1ccbf
movl $0xa, %edi
callq 0x1e6a0
movb %bl, 0x1fe4b6(%rip)     # 0x21b21c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd5c9
movq 0x154143(%rip), %rdi    # 0x170ec0
callq 0x95c0
callq 0xa826
mulsd 0xec2a9(%rip), %xmm0    # 0x109038
addsd 0xec2c1(%rip), %xmm0    # 0x109058
movsd %xmm0, 0x2f07f9(%rip)   # 0x30d598
movl 0x3232a3(%rip), %eax    # 0x340048
cmpl %eax, 0x323299(%rip)    # 0x340044
je 0x1cde0
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpl $0xf, %eax
cmovll %ecx, %edx
movl %edx, 0x32328a(%rip)    # 0x340048
movslq %edx, %rax
leaq 0x323238(%rip), %rcx    # 0x340000
cmpl $0x1b, (%rcx,%rax,4)
jne 0x1cde0
leaq 0xede10(%rip), %rsi     # 0x10abe5
movl $0x1a0a, %edi           # imm = 0x1A0A
popq %rbp
jmp 0xb425
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2220a5(%rip), %rdi    # 0x23eeb8
testq %rdi, %rdi
je 0x1cf22
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x22208b(%rip), %ebx    # 0x23eeb4
testb %al, %al
je 0x1ce7a
testl %ebx, %ebx
jle 0x1ce59
leaq 0x221de0(%rip), %rbx    # 0x23ec18
xorl %r14d, %r14d
movq (%rbx), %rdi
callq 0x9370
incq %r14
movslq 0x222067(%rip), %rax    # 0x23eeb4
addq $0xa8, %rbx
cmpq %rax, %r14
jl 0x1ce3b
movq $0x0, 0x222054(%rip) # 0x23eeb8
movb $0x0, 0x222065(%rip)    # 0x23eed0
movl $0x0, 0x22203f(%rip)    # 0x23eeb4
jmp 0x1cf1e
callq 0x9370
testl %ebx, %ebx
je 0x1cf0c
movslq 0x222026(%rip), %rax    # 0x23eeb4
decq %rax
movl %eax, 0x22201d(%rip)    # 0x23eeb4
imulq $0xa8, %rax, %rbx
leaq 0x221ceb(%rip), %r14    # 0x23eb90
leaq (%r14,%rbx), %rsi
leaq 0x221f80(%rip), %rdi    # 0x23ee30
callq 0x9340
movq 0x88(%rbx,%r14), %rax
movq %rax, 0x221ff4(%rip)    # 0x23eeb8
movl 0x90(%rbx,%r14), %eax
movl %eax, 0x221fee(%rip)    # 0x23eec0
movl 0x94(%rbx,%r14), %eax
movl %eax, 0x221fe4(%rip)    # 0x23eec4
movl 0x98(%rbx,%r14), %eax
movl %eax, 0x221fda(%rip)    # 0x23eec8
movl 0x9c(%rbx,%r14), %eax
movl %eax, 0x221fd0(%rip)    # 0x23eecc
movb 0xa0(%rbx,%r14), %al
movb %al, 0x221fc6(%rip)     # 0x23eed0
jmp 0x1cf1e
movq $0x0, 0x221fa1(%rip) # 0x23eeb8
movb $0x0, 0x221fb2(%rip)    # 0x23eed0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x221f7d(%rip), %r15    # 0x23eeb8
testq %r15, %r15
je 0x1cfcb
movslq 0x221f69(%rip), %r14    # 0x23eeb4
cmpq $0x3, %r14
jg 0x1d026
imulq $0xa8, %r14, %r12
leaq 0x221c2d(%rip), %r13    # 0x23eb90
leaq (%r12,%r13), %rdi
leaq 0x221ec2(%rip), %rsi    # 0x23ee30
callq 0x9340
movq %r15, 0x88(%r12,%r13)
movl 0x221f3f(%rip), %eax    # 0x23eec0
movl %eax, 0x90(%r12,%r13)
movl 0x221f35(%rip), %eax    # 0x23eec4
movl %eax, 0x94(%r12,%r13)
movl 0x221f2f(%rip), %eax    # 0x23eecc
movl %eax, 0x9c(%r12,%r13)
movl 0x221f1d(%rip), %eax    # 0x23eec8
movl %eax, 0x98(%r12,%r13)
movb 0x221f17(%rip), %al     # 0x23eed0
movb %al, 0xa0(%r12,%r13)
leal 0x1(%r14), %eax
movl %eax, 0x221ee9(%rip)    # 0x23eeb4
leaq 0x221e5e(%rip), %rdi    # 0x23ee30
movl $0x80, %edx
movq %rbx, %rsi
callq 0x9170
leaq 0x103cc7(%rip), %rsi    # 0x120cad
movq %rbx, %rdi
callq 0x9a4d
movq %rax, %rcx
movq %rax, 0x221ec0(%rip)    # 0x23eeb8
movl $0x1, 0x221ebe(%rip)    # 0x23eec0
xorl %eax, %eax
movl %eax, 0x221eba(%rip)    # 0x23eec4
movl %eax, 0x221ebc(%rip)    # 0x23eecc
movb %al, 0x221eba(%rip)     # 0x23eed0
movb %al, 0x221eb5(%rip)     # 0x23eed1
xorl %eax, %eax
testq %rcx, %rcx
sete %al
jmp 0x1d041
leaq 0xedbdf(%rip), %rdi     # 0x10ac0c
callq 0x2326e
movl $0x1, %edi
callq 0x1ce0a
movl $0x2, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x221e5b(%rip), %rdi    # 0x23eeb8
callq 0x95f0
testl %eax, %eax
js 0x1d082
cmpl $0x1, %eax
ja 0x1d08d
movq 0x221e46(%rip), %rdi    # 0x23eeb8
callq 0x95f0
testl %eax, %eax
js 0x1d082
addl $0x100, %eax            # imm = 0x100
jmp 0x1d0a6
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x1ce0a
jmp 0x1d0e1
cmpl $0x7e, %eax
jne 0x1d0a6
cmpb $0x0, 0x221e38(%rip)    # 0x23eed1
jne 0x1d0a6
movb $0x1, 0x221e2e(%rip)    # 0x23eed0
xorl %ebx, %ebx
jmp 0x1d0e1
cmpl $0xa, %eax
movl $0xd, %ecx
cmovnel %eax, %ecx
cmpl $0xd, %ecx
jne 0x1d0cf
incl 0x221e04(%rip)          # 0x23eec0
movl $0x0, 0x221dfe(%rip)    # 0x23eec4
movb $0x0, 0x221e04(%rip)    # 0x23eed1
jmp 0x1d0d5
incl 0x221def(%rip)          # 0x23eec4
xorl %ebx, %ebx
cmpb $0x0, 0x221df3(%rip)    # 0x23eed1
cmovel %ecx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq