LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jkingan[P]ladyheather/heather.cpp
// Function: center_vstring(int, int, int, char*)
void center_vstring(int row, int scale, int color, char *s)
{
int col;
int len;
int i;

   // draw a scaled vector graphics text string that is centered on the screen

   i = VCHAR_SCALE;
   VCHAR_SCALE = scale;

   len = strlen(s);
   col = ((SCREEN_WIDTH-((VCHAR_W*VCHAR_SCALE)*len)) / TEXT_WIDTH) / 2;
   vchar_string(row, col, color, s);

   VCHAR_SCALE = i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movl 0x271071(%rip), %eax    # 0x28271c
movl %eax, -0x24(%rbp)
movl -0x8(%rbp), %eax
movl %eax, 0x271065(%rip)    # 0x28271c
movq -0x18(%rbp), %rdi
callq 0x9120
movl %eax, -0x20(%rbp)
movl 0x266317(%rip), %eax    # 0x2779e0
movl 0x27104d(%rip), %ecx    # 0x28271c
shll $0x3, %ecx
imull -0x20(%rbp), %ecx
subl %ecx, %eax
cltd
idivl 0x266311(%rip)          # 0x2779f0
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x1c(%rbp)
movl -0x4(%rbp), %edi
movl -0x1c(%rbp), %esi
movl -0xc(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl %al, %edx
callq 0x11590
movl -0x24(%rbp), %eax
movl %eax, 0x271014(%rip)    # 0x28271c
addq $0x30, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heather.cpp
// Function: erase_help()
void erase_help()
{
   // erase the help area on the screen

   if(text_mode) {
      erase_screen();
      return;
   }
   erase_rectangle(PLOT_LEFT,PLOT_ROW, SCREEN_WIDTH-PLOT_LEFT,SCREEN_HEIGHT-PLOT_ROW);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x26620d(%rip)    # 0x2779b8
je 0x117b4
callq 0x117e0
jmp 0x117d6
movl 0x2662a2(%rip), %esi    # 0x277a5c
movl 0x266220(%rip), %edx    # 0x2779e0
subl $0x0, %edx
movl 0x26621b(%rip), %ecx    # 0x2779e4
subl 0x26628d(%rip), %ecx    # 0x277a5c
xorl %edi, %edi
callq 0xf250
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: erase_screen()
void erase_screen()
{
   // erase the screen
   erase_rectangle(0,0, SCREEN_WIDTH,SCREEN_HEIGHT);
   show_touch_kbd(0);
   lla_showing = 0;
   ms_row = ms_col = 0;

   #ifdef PRECISE_STUFF
      plot_lla_axes(10);
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x2661f6(%rip), %edx    # 0x2779e0
movl 0x2661f4(%rip), %ecx    # 0x2779e4
xorl %esi, %esi
movl %esi, %edi
callq 0xf250
xorl %edi, %edi
callq 0x11970
movl $0x0, 0x388c96(%rip)    # 0x39a4a0
movl $0x0, 0x35a15c(%rip)    # 0x36b970
movl $0x0, 0x35a14e(%rip)    # 0x36b96c
movl $0xa, %edi
callq 0x12bcc0
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: erase_lla()
void erase_lla()
{
   // erase the lat/lon scattergram area on the screen

   if(text_mode) return;
   if(zoom_screen == 'P');
   else if(zoom_screen) return;

   erase_rectangle(LLA_COL,LLA_ROW, LLA_SIZE,LLA_SIZE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x26617d(%rip)    # 0x2779b8
je 0x1183f
jmp 0x11877
movzbl 0x35a142(%rip), %eax    # 0x36b988
cmpl $0x50, %eax
jne 0x1184d
jmp 0x1185a
cmpb $0x0, 0x35a134(%rip)    # 0x36b988
je 0x11858
jmp 0x11877
jmp 0x1185a
movl 0x388c2c(%rip), %edi    # 0x39a48c
movl 0x388c22(%rip), %esi    # 0x39a488
movl 0x388c0c(%rip), %edx    # 0x39a478
movl 0x388c06(%rip), %ecx    # 0x39a478
callq 0xf250
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: erase_azel(int)
void erase_azel(int why)
{
   // erase the satellite map area on the screen

   if((zoom_screen == 0) && ((AZEL_ROW+AZEL_SIZE) >= PLOT_ROW)) {  // az/el map is in the normal plot window
      erase_rectangle(PLOT_COL+PLOT_WIDTH,AZEL_ROW, SCREEN_WIDTH-(PLOT_COL+PLOT_WIDTH),AZEL_SIZE);
   }
   else {
      erase_rectangle(AZEL_COL,AZEL_ROW, AZEL_SIZE,AZEL_SIZE);
   }

   azel_erased = 1;
   azel_grid_color = GREY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movzbl 0x35a0a6(%rip), %eax    # 0x36b988
cmpl $0x0, %eax
jne 0x1192e
movl 0x388c83(%rip), %eax    # 0x39a570
addl 0x388c79(%rip), %eax    # 0x39a56c
cmpl 0x266163(%rip), %eax    # 0x277a5c
jl 0x1192e
movl 0x26615f(%rip), %edi    # 0x277a60
addl 0x26615d(%rip), %edi    # 0x277a64
movl 0x388c63(%rip), %esi    # 0x39a570
movl 0x2660cd(%rip), %edx    # 0x2779e0
movl 0x266147(%rip), %eax    # 0x277a60
addl 0x266145(%rip), %eax    # 0x277a64
subl %eax, %edx
movl 0x388c45(%rip), %ecx    # 0x39a56c
callq 0xf250
jmp 0x1194b
movl 0x388c40(%rip), %edi    # 0x39a574
movl 0x388c36(%rip), %esi    # 0x39a570
movl 0x388c2c(%rip), %edx    # 0x39a56c
movl 0x388c26(%rip), %ecx    # 0x39a56c
callq 0xf250
movl $0x1, 0x388c27(%rip)    # 0x39a57c
movl $0x8, 0x388c29(%rip)    # 0x39a588
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: show_last_mouse_x(int)
void show_last_mouse_x(int color)
{
  // highlight what column the mouse was last in the plot area at

  if(first_key) return;
  if(text_mode) return;
  if(zoom_screen && (zoom_screen != 'P')) return;

  if(last_plot_tick >= 1) {  // erase the old tick mark
     line(PLOT_COL+last_plot_tick-1,PLOT_ROW+0, PLOT_COL+last_plot_tick+1,PLOT_ROW+0, WHITE); // lmq
     line(PLOT_COL+last_plot_tick-1,PLOT_ROW-1, PLOT_COL+last_plot_tick+1,PLOT_ROW-1, BLACK); // lmq
     last_plot_tick = (-1);
  }

  if(last_plot_mouse_x < 1) return;
  if(last_plot_mouse_x == last_plot_tick) return;

  line(PLOT_COL+last_plot_mouse_x-1,PLOT_ROW+0, PLOT_COL+last_plot_mouse_x+1,PLOT_ROW+0, color); // lmq
  line(PLOT_COL+last_plot_mouse_x-1,PLOT_ROW-1, PLOT_COL+last_plot_mouse_x+1,PLOT_ROW-1, color); // lmq
  last_plot_tick = last_plot_mouse_x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x28c596(%rip)    # 0x29e138
je 0x11ba9
jmp 0x11cfc
cmpl $0x0, 0x265e08(%rip)    # 0x2779b8
je 0x11bb7
jmp 0x11cfc
cmpb $0x0, 0x359dca(%rip)    # 0x36b988
je 0x11bd1
movzbl 0x359dc1(%rip), %eax    # 0x36b988
cmpl $0x50, %eax
je 0x11bd1
jmp 0x11cfc
cmpl $0x1, 0x26885c(%rip)    # 0x27a434
jl 0x11c57
movl 0x265e80(%rip), %edi    # 0x277a60
addl 0x26884e(%rip), %edi    # 0x27a434
subl $0x1, %edi
movl 0x265e6d(%rip), %esi    # 0x277a5c
addl $0x0, %esi
movl 0x265e68(%rip), %edx    # 0x277a60
addl 0x268836(%rip), %edx    # 0x27a434
addl $0x1, %edx
movl 0x265e55(%rip), %ecx    # 0x277a5c
addl $0x0, %ecx
movl $0xf, %r8d
callq 0x109c0
movl 0x265e45(%rip), %edi    # 0x277a60
addl 0x268813(%rip), %edi    # 0x27a434
subl $0x1, %edi
movl 0x265e32(%rip), %esi    # 0x277a5c
subl $0x1, %esi
movl 0x265e2d(%rip), %edx    # 0x277a60
addl 0x2687fb(%rip), %edx    # 0x27a434
addl $0x1, %edx
movl 0x265e1a(%rip), %ecx    # 0x277a5c
subl $0x1, %ecx
xorl %r8d, %r8d
callq 0x109c0
movl $0xffffffff, 0x2687dd(%rip) # imm = 0xFFFFFFFF
cmpl $0x1, 0x2687d2(%rip)    # 0x27a430
jge 0x11c65
jmp 0x11cfc
movl 0x2687c5(%rip), %eax    # 0x27a430
cmpl 0x2687c3(%rip), %eax    # 0x27a434
jne 0x11c78
jmp 0x11cfc
movl 0x265de2(%rip), %edi    # 0x277a60
addl 0x2687ac(%rip), %edi    # 0x27a430
subl $0x1, %edi
movl 0x265dcf(%rip), %esi    # 0x277a5c
addl $0x0, %esi
movl 0x265dca(%rip), %edx    # 0x277a60
addl 0x268794(%rip), %edx    # 0x27a430
addl $0x1, %edx
movl 0x265db7(%rip), %ecx    # 0x277a5c
addl $0x0, %ecx
movl -0x4(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
movl 0x265da6(%rip), %edi    # 0x277a60
addl 0x268770(%rip), %edi    # 0x27a430
subl $0x1, %edi
movl 0x265d93(%rip), %esi    # 0x277a5c
subl $0x1, %esi
movl 0x265d8e(%rip), %edx    # 0x277a60
addl 0x268758(%rip), %edx    # 0x27a430
addl $0x1, %edx
movl 0x265d7b(%rip), %ecx    # 0x277a5c
subl $0x1, %ecx
movl -0x4(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
movl 0x26873a(%rip), %eax    # 0x27a430
movl %eax, 0x268738(%rip)    # 0x27a434
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: erase_plot(int)
void erase_plot(int full_plot)
{
   // erase the plot area on the screen
   //   if full_plot < 0 and plots are disabled, erase the full screen
   //   if full_plot = 0 erase only the graph area
   //   if full_plot > 0 erase the whole plot area

   if(text_mode) return;

   if(((rcvr_type == NO_RCVR) || no_plots) && (full_plot < 0)) {
      erase_screen();
      return;
   }

   if(full_plot < 0) ;
   else if(rcvr_type == NO_RCVR) return;
   else if(no_plots) return;

   if(zoom_screen == 'P');
   else if(zoom_screen) return;

   if(PLOT_COL > PLOT_LEFT) {
      erase_rectangle(PLOT_LEFT,PLOT_ROW, PLOT_COL-PLOT_LEFT,SCREEN_HEIGHT-PLOT_ROW);
   }

   erase_rectangle(PLOT_COL,PLOT_ROW, PLOT_WIDTH,SCREEN_HEIGHT-PLOT_ROW);

   // erase area to the right of the plot area
   if(full_plot && ((PLOT_COL+PLOT_WIDTH) < SCREEN_WIDTH)) {
      erase_rectangle(PLOT_COL+PLOT_WIDTH,PLOT_ROW, SCREEN_WIDTH-(PLOT_COL+PLOT_WIDTH),SCREEN_HEIGHT-PLOT_ROW);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x265c96(%rip)    # 0x2779b8
je 0x11d29
jmp 0x11e38
cmpq $0x400, 0x265d7c(%rip) # imm = 0x400
je 0x11d3f
cmpl $0x0, 0x38d20b(%rip)    # 0x39ef48
je 0x11d4f
cmpl $0x0, -0x4(%rbp)
jge 0x11d4f
callq 0x117e0
jmp 0x11e38
cmpl $0x0, -0x4(%rbp)
jge 0x11d57
jmp 0x11d7b
cmpq $0x400, 0x265d4e(%rip) # imm = 0x400
jne 0x11d69
jmp 0x11e38
cmpl $0x0, 0x38d1d8(%rip)    # 0x39ef48
je 0x11d77
jmp 0x11e38
jmp 0x11d79
jmp 0x11d7b
movzbl 0x359c06(%rip), %eax    # 0x36b988
cmpl $0x50, %eax
jne 0x11d89
jmp 0x11d99
cmpb $0x0, 0x359bf8(%rip)    # 0x36b988
je 0x11d97
jmp 0x11e38
jmp 0x11d99
cmpl $0x0, 0x265cc0(%rip)    # 0x277a60
jle 0x11dc4
movl 0x265cb4(%rip), %esi    # 0x277a5c
movl 0x265cb2(%rip), %edx    # 0x277a60
subl $0x0, %edx
movl 0x265c2d(%rip), %ecx    # 0x2779e4
subl 0x265c9f(%rip), %ecx    # 0x277a5c
xorl %edi, %edi
callq 0xf250
movl 0x265c96(%rip), %edi    # 0x277a60
movl 0x265c8c(%rip), %esi    # 0x277a5c
movl 0x265c8e(%rip), %edx    # 0x277a64
movl 0x265c08(%rip), %ecx    # 0x2779e4
subl 0x265c7a(%rip), %ecx    # 0x277a5c
callq 0xf250
cmpl $0x0, -0x4(%rbp)
je 0x11e38
movl 0x265c6d(%rip), %eax    # 0x277a60
addl 0x265c6b(%rip), %eax    # 0x277a64
cmpl 0x265be1(%rip), %eax    # 0x2779e0
jge 0x11e38
movl 0x265c59(%rip), %edi    # 0x277a60
addl 0x265c57(%rip), %edi    # 0x277a64
movl 0x265c49(%rip), %esi    # 0x277a5c
movl 0x265bc7(%rip), %edx    # 0x2779e0
movl 0x265c41(%rip), %eax    # 0x277a60
addl 0x265c3f(%rip), %eax    # 0x277a64
subl %eax, %edx
movl 0x265bb7(%rip), %ecx    # 0x2779e4
subl 0x265c29(%rip), %ecx    # 0x277a5c
callq 0xf250
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heather.cpp
// Function: get_pixel(int, int)
u08 get_pixel(COORD x,COORD y)
{
unsigned long pixel;
int i;

   // gets a pixel from the current screen image

   SWAPXY(x,y);

#ifdef WIN_VFX
   if(stage == 0) return 0;

   VFX_io_done = 1;
   pixel = (unsigned long) VFX_pixel_read(stage, x,y) & 0xFFFF;
   for(i=0; i<16; i++) {  // convert screen value to color code
      if(((u32) pixel) == (palette[i]&0xFFFF)) return i;
   }
#endif

#ifdef USE_X11
   // X11 uses the screen capture image buffer

   if(capture_image == 0) return 0;

   pixel = XGetPixel(capture_image, x,y);
   for(i=0; i<16; i++) {  // convert screen value to color code
      if(pixel == palette[i]) return i;
   }
#endif

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, 0x265bb3(%rip)    # 0x277a08
je 0x11e7e
movl -0xc(%rbp), %eax
movl %eax, 0x265bac(%rip)    # 0x277a0c
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
movl 0x265ba0(%rip), %eax    # 0x277a0c
movl %eax, -0x8(%rbp)
movl 0x265b6f(%rip), %eax    # 0x2779e4
subl $0x1, %eax
subl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
cmpq $0x0, 0x38d2aa(%rip)    # 0x39f130
jne 0x11e8e
movb $0x0, -0x1(%rbp)
jmp 0x11ee9
movq 0x38d29b(%rip), %rax    # 0x39f130
movq 0x68(%rax), %rax
movq 0x38d290(%rip), %rdi    # 0x39f130
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq *%rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x10, -0x1c(%rbp)
jge 0x11ee5
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rdx
leaq 0x1be298(%rip), %rcx    # 0x1d0160
movl (%rcx,%rdx,4), %ecx
cmpq %rcx, %rax
jne 0x11ed8
movl -0x1c(%rbp), %eax
movb %al, -0x1(%rbp)
jmp 0x11ee9
jmp 0x11eda
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x11eb3
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: draw_circle(int, int, int, int, int)
void draw_circle(int x,int y, int r, int color, int fill)
{
   // draw a filled or hollow circle on the screen

   SWAPXY(x,y);

   #ifdef WIN_VFX
      if(stage == 0) return;

      if(fill) VFX_ellipse_fill(stage, x,y, r,r, palette[color]);
      else     VFX_ellipse_draw(stage, x,y, r,r, palette[color]);
   #endif

   #ifdef USE_SDL
      if(fill)  filledCircleColor(display,x,y,r, get_sdl_color(color));
      circleColor(display,x,y,r, get_sdl_color(color));
   #endif

   #ifdef USE_X11
      if(display == 0) return;

      r *= 2;
      x = x - (r/2);  // upper left corner of bounding box
      y = y - (r/2);
      set_x11_color(color);
      if(fill) XFillArc(display,win,gc, x,y, r,r, 0,(360*64));
      else     XDrawArc(display,win,gc, x,y, r,r, 0,(360*64));
      flush_x11();
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
cmpl $0x0, 0x265ae9(%rip)    # 0x277a08
je 0x11f48
movl -0x8(%rbp), %eax
movl %eax, 0x265ae2(%rip)    # 0x277a0c
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl 0x265ad6(%rip), %eax    # 0x277a0c
movl %eax, -0x4(%rbp)
movl 0x265aa5(%rip), %eax    # 0x2779e4
subl $0x1, %eax
subl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
cmpq $0x0, 0x1be150(%rip)    # 0x1d00a0
jne 0x11f57
jmp 0x12029
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0xc(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x8(%rbp)
movl -0x10(%rbp), %eax
movzbl %al, %edi
callq 0xf280
cmpl $0x0, -0x14(%rbp)
je 0x11fe6
movq 0x1be0f3(%rip), %rdi    # 0x1d00a0
movq 0x1be0fc(%rip), %rsi    # 0x1d00b0
movq 0x1be105(%rip), %rdx    # 0x1d00c0
movl -0x4(%rbp), %ecx
movl -0x8(%rbp), %r8d
movl -0xc(%rbp), %r9d
movl -0xc(%rbp), %eax
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x5a00, 0x10(%rsp)     # imm = 0x5A00
callq 0x95f0
jmp 0x12024
movq 0x1be0b3(%rip), %rdi    # 0x1d00a0
movq 0x1be0bc(%rip), %rsi    # 0x1d00b0
movq 0x1be0c5(%rip), %rdx    # 0x1d00c0
movl -0x4(%rbp), %ecx
movl -0x8(%rbp), %r8d
movl -0xc(%rbp), %r9d
movl -0xc(%rbp), %eax
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x5a00, 0x10(%rsp)     # imm = 0x5A00
callq 0x9270
callq 0xdfe0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heather.cpp
// Function: draw_rectangle(int, int, int, int, int)
void draw_rectangle(int x,int y, int width,int height, int color)
{
   // draw a rectangle outline

   line(x,y,              x+width,y,        color);
   line(x+width,y,        x+width,y+height, color);
   line(x+width,y+height, x,y+height,       color);
   line(x,y+height,       x,y,              color);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
addl -0xc(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x14(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
movl -0x4(%rbp), %edi
addl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
addl -0xc(%rbp), %edx
movl -0x8(%rbp), %ecx
addl -0x10(%rbp), %ecx
movl -0x14(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
movl -0x4(%rbp), %edi
addl -0xc(%rbp), %edi
movl -0x8(%rbp), %esi
addl -0x10(%rbp), %esi
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
addl -0x10(%rbp), %ecx
movl -0x14(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
addl -0x10(%rbp), %esi
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x14(%rbp), %eax
movzbl %al, %r8d
callq 0x109c0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: fill_rectangle(int, int, int, int, int)
void fill_rectangle(int x,int y, int width,int height, int color)
{
   // fill a rectangle on the screen with color

   #ifdef WIN_VFX
      if(stage == 0) return;
      SWAPXY(x,y);
      SWAP(width,height);
      if(rotate_screen) width = 0-width;

      VFX_io_done = 1;
      VFX_rectangle_fill(stage, x,y, x+width,y+height, LD_DRAW, palette[color]);
   #endif

   #ifdef USE_X11
      if(display == 0) return;
      SWAPXY(x,y);
      SWAP(width,height);
      if(rotate_screen) {
         x -= width;
      }

      set_x11_color(color);
      XFillRectangle(display,win,gc, x,y, width+1,height+1);
      flush_x11();
   #endif

   #ifdef USE_SDL
      SDL_Rect r;
      r.x = x;
      r.y = y;
      r.w = width;
      r.h = height;
      //set_sdl_color(BLACK);
      //SDL_RenderFillRect(ne_renderer, &r);
      SDL_FillRect(display, &r, palette[BLACK]);
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
cmpq $0x0, 0x1bdfb0(%rip)    # 0x1d00a0
jne 0x120f7
jmp 0x1219e
cmpl $0x0, 0x26590a(%rip)    # 0x277a08
je 0x12127
movl -0x8(%rbp), %eax
movl %eax, 0x265903(%rip)    # 0x277a0c
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movl 0x2658f7(%rip), %eax    # 0x277a0c
movl %eax, -0x4(%rbp)
movl 0x2658c6(%rip), %eax    # 0x2779e4
subl $0x1, %eax
subl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, 0x2658da(%rip)    # 0x277a08
je 0x12148
movl -0x10(%rbp), %eax
movl %eax, 0x2658d3(%rip)    # 0x277a0c
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl 0x2658c7(%rip), %eax    # 0x277a0c
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x2658b9(%rip)    # 0x277a08
je 0x1215c
movl -0xc(%rbp), %ecx
movl -0x4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x14(%rbp), %eax
movzbl %al, %edi
callq 0xf280
movq 0x1bdf32(%rip), %rdi    # 0x1d00a0
movq 0x1bdf3b(%rip), %rsi    # 0x1d00b0
movq 0x1bdf44(%rip), %rdx    # 0x1d00c0
movl -0x4(%rbp), %ecx
movl -0x8(%rbp), %r8d
movl -0xc(%rbp), %r9d
addl $0x1, %r9d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
callq 0x9190
callq 0xdfe0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: edit_cmap(int, int, int, int)
void edit_cmap(int color, int r, int g, int b)
{
   // change a palette color map entry

   if(color < 0) return;
   if(color > 15) return;

   if(r < 0) r = 0;
   if(g < 0) g = 0;
   if(b < 0) b = 0;
   if(r > 255) r = 255;
   if(g > 255) g = 255;
   if(b > 255) b = 255;

   cmap[color].r = r;
   cmap[color].g = g;
   cmap[color].b = b;

   setup_palette();
   need_redraw = 8878;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x121cf
jmp 0x12287
cmpl $0xf, -0x4(%rbp)
jle 0x121da
jmp 0x12287
cmpl $0x0, -0x8(%rbp)
jge 0x121e7
movl $0x0, -0x8(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x121f4
movl $0x0, -0xc(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x12201
movl $0x0, -0x10(%rbp)
cmpl $0xff, -0x8(%rbp)
jle 0x12211
movl $0xff, -0x8(%rbp)
cmpl $0xff, -0xc(%rbp)
jle 0x12221
movl $0xff, -0xc(%rbp)
cmpl $0xff, -0x10(%rbp)
jle 0x12231
movl $0xff, -0x10(%rbp)
movl -0x8(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x1ad241(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x1ad22a(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x10(%rbp), %ecx
movslq -0x4(%rbp), %rdx
leaq 0x1ad212(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
callq 0xf0c0
movl $0x22ae, 0x26579d(%rip) # imm = 0x22AE
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: get_bgr_palette(int)
u32 get_bgr_palette(int i)
{
u32 color;

   // return BGR color palette table entry i

   color = cmap[i].b;
   color <<= 16;
   color |= ((u32) cmap[i].g) << 8;
   color |= cmap[i].r;
   return color;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1ad1de(%rip), %rax    # 0x1bf480
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
shll $0x10, %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1ad1bd(%rip), %rax    # 0x1bf480
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
shll $0x8, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1ad19f(%rip), %rax    # 0x1bf480
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: change_palette(char*)
void change_palette(char *s)
{
int r,g,b;
int i;
int n;

   // change a color palette table BGR entry

   if(s == 0) return;

   n = sscanf(s, "%d %d %d %d", &i, &r,&g,&b);
   if(n != 4) {
      edit_error("Must specify four value: COLOR R G B");
      return;
   }
   if((i < 0) || (i > 15)) {
      edit_error("COLOR value must be 0 .. 15");
      return;
   }
   if((r < 0) || (r > 255)) {
      edit_error("RED value must be 0 .. 255");
      return;
   }
   if((g < 0) || (g > 255)) {
      edit_error("GREEN value must be 0 .. 255");
      return;
   }
   if((b < 0) || (b > 255)) {
      edit_error("BLUE value must be 0 .. 255");
      return;
   }

   cmap[i].r = r;
   cmap[i].g = g;
   cmap[i].b = b;

   setup_palette();
   need_redraw = 8899;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x12408
jmp 0x12511
movq -0x8(%rbp), %rdi
leaq 0x15d572(%rip), %rsi    # 0x16f985
leaq -0x18(%rbp), %rdx
leaq -0xc(%rbp), %rcx
leaq -0x10(%rbp), %r8
leaq -0x14(%rbp), %r9
movb $0x0, %al
callq 0x9370
movl %eax, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
je 0x12444
leaq 0x15da48(%rip), %rdi    # 0x16fe82
callq 0x30d60
jmp 0x12511
cmpl $0x0, -0x18(%rbp)
jl 0x12450
cmpl $0xf, -0x18(%rbp)
jle 0x12461
leaq 0x15da50(%rip), %rdi    # 0x16fea7
callq 0x30d60
jmp 0x12511
cmpl $0x0, -0xc(%rbp)
jl 0x12470
cmpl $0xff, -0xc(%rbp)
jle 0x12481
leaq 0x15da4c(%rip), %rdi    # 0x16fec3
callq 0x30d60
jmp 0x12511
cmpl $0x0, -0x10(%rbp)
jl 0x12490
cmpl $0xff, -0x10(%rbp)
jle 0x1249e
leaq 0x15da47(%rip), %rdi    # 0x16fede
callq 0x30d60
jmp 0x12511
cmpl $0x0, -0x14(%rbp)
jl 0x124ad
cmpl $0xff, -0x14(%rbp)
jle 0x124bb
leaq 0x15da47(%rip), %rdi    # 0x16fefb
callq 0x30d60
jmp 0x12511
movl -0xc(%rbp), %ecx
movslq -0x18(%rbp), %rdx
leaq 0x1acfb7(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
movslq -0x18(%rbp), %rdx
leaq 0x1acfa0(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %ecx
movslq -0x18(%rbp), %rdx
leaq 0x1acf88(%rip), %rax    # 0x1bf480
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
callq 0xf0c0
movl $0x22c3, 0x265513(%rip) # imm = 0x22C3
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: dump_dword(unsigned int)
void dump_dword(u32 d)
{
   dump_byte(d);
   dump_byte(d>>8);
   dump_byte(d>>16);
   dump_byte(d>>24);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movzbl %al, %edi
callq 0x12520
movl -0x4(%rbp), %eax
shrl $0x8, %eax
movzbl %al, %edi
callq 0x12520
movl -0x4(%rbp), %eax
shrl $0x10, %eax
movzbl %al, %edi
callq 0x12520
movl -0x4(%rbp), %eax
shrl $0x18, %eax
movzbl %al, %edi
callq 0x12520
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: redraw_screen()
void redraw_screen()
{
   // redraw everything on the screen
   if(first_key) {  // we are showing a keyboard menu show hold off on the redraw
      return;
   }

   need_redraw = 0;
   last_plot_tick = (-1);

   precise_survey_done = 0;
   if((check_precise_posn == 0) && (precision_survey == 0) && (show_fixes == 0)) {
      plot_lla = 0;
////  if(doing_survey == 0) plot_lla = 0;
   }

   erase_screen();
   show_log_state();
//!!!!! request_rcvr_info(202);
   request_version();
   if(plot_azel) update_azel = 1;

   draw_plot(REFRESH_SCREEN);  // redraw the plot area
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x28b64d(%rip)    # 0x29e138
je 0x12aef
jmp 0x12b5e
movl $0x0, 0x264f2b(%rip)    # 0x277a24
movl $0xffffffff, 0x267931(%rip) # imm = 0xFFFFFFFF
movb $0x0, 0x35a570(%rip)    # 0x36d07a
movzbl 0x3879af(%rip), %eax    # 0x39a4c0
cmpl $0x0, %eax
jne 0x12b35
movzbl 0x35a55b(%rip), %eax    # 0x36d078
cmpl $0x0, %eax
jne 0x12b35
movzbl 0x38798b(%rip), %eax    # 0x39a4b4
cmpl $0x0, %eax
jne 0x12b35
movb $0x0, 0x38795b(%rip)    # 0x39a490
callq 0x117e0
callq 0x10ae40
callq 0x8b430
cmpb $0x0, 0x267aa8(%rip)    # 0x27a5f3
je 0x12b54
movb $0x1, 0x267aa0(%rip)    # 0x27a5f4
movl $0x1, %edi
callq 0x24e80
popq %rbp
retq
// File: jkingan[P]ladyheather/heather.cpp
// Function: hide_kbd(int)
void hide_kbd(int why)
{
   // turn off the touch screen keyboard display
   if(zoom_screen != 'K') return;  // keyboard already off

   getting_string = 0;
   need_redraw = 3399;
   reset_first_key(2);

   if(0) {   // remove the keyboard from the screen
      add_kbd('Z');  // simulate keystrokes (interfers with clearing plot markers
      add_kbd('N');  // since this resets "last_was_mark")
   }
   else {            // remove keyboard without key strokes
      remove_zoom();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movzbl 0x358b46(%rip), %eax    # 0x36b988
cmpl $0x4b, %eax
je 0x12e49
jmp 0x12e6b
movw $0x0, 0x38b996(%rip)    # 0x39e7e8
movl $0xd47, 0x264bc8(%rip)  # imm = 0xD47
movl $0x2, %edi
callq 0x37780
callq 0x319b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: find_endian()
void find_endian(void)
{
u08 s[2];
u16 v;

   // determine the system byte ordering (and adjust for receiver message
   // byte ordering)

   s[0] = 0x34;
   s[1] = 0x12;
   v = *((u16 *) (void *) &s[0]);
   v &= 0xFFFF;
   if((v&0xFFFF) != (0x1234&0xFFFF)) ENDIAN = 1;
   else ENDIAN = 0;  // intel byte ordering

   if(LOW_BYTE_FIRST) {  // receiver messages use little endian format
      ENDIAN ^= 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb $0x34, -0x2(%rbp)
movb $0x12, -0x1(%rbp)
movw -0x2(%rbp), %ax
movw %ax, -0x4(%rbp)
movzwl -0x4(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, -0x4(%rbp)
movzwl -0x4(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
cmpl $0x1234, %eax           # imm = 0x1234
je 0x130fa
movb $0x1, 0x2648bc(%rip)    # 0x2779b4
jmp 0x13101
movb $0x0, 0x2648b3(%rip)    # 0x2779b4
movq 0x2649a8(%rip), %rax    # 0x277ab0
andq $0x400904, %rax         # imm = 0x400904
cmpq $0x0, %rax
je 0x13124
movzbl 0x264899(%rip), %eax    # 0x2779b4
xorl $0x1, %eax
movb %al, 0x264890(%rip)     # 0x2779b4
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: end_log()
void end_log()
{
   // close out the log file if it is open

   if(log_file == 0) return;

   if(log_comments) {
      sprintf(log_text, "#");
      write_log_comment(1);
      write_log_comment(1);
   }

   if(com_errors) {
      printf("*** %lu COM PORT ERRORS!!!\n", (unsigned long) com_errors);
      sprintf(log_text, "#*** %lu COM PORT ERRORS!!!", (unsigned long) com_errors);
      write_log_comment(1);
   }
   if(math_errors) {
      printf("*** %lu MATH ERRORS!!!\n", (unsigned long) math_errors);
      sprintf(log_text, "#*** %lu MATH ERRORS!!!", (unsigned long) math_errors);
      write_log_comment(1);
   }
   if(1 || bad_packets) {
      printf("%lu Rvcr packets processed.  %lu bad packets.\n", (unsigned long) packet_count, (unsigned long) bad_packets);
      sprintf(log_text, "#*** %lu Rcvr packets processed.  %lu bad packets.", (unsigned long) packet_count, (unsigned long) bad_packets);
      write_log_comment(1);
   }

   close_log_file();  // close the log file
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x28a404(%rip)    # 0x29d540
jne 0x13143
jmp 0x13253
cmpb $0x0, 0x28a4aa(%rip)    # 0x29d5f4
je 0x13175
leaq 0x2899ed(%rip), %rdi    # 0x29cb40
leaq 0x15ec42(%rip), %rsi    # 0x171d9c
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movl $0x1, %edi
callq 0x10cbe0
cmpl $0x0, 0x383078(%rip)    # 0x3961f4
je 0x131bb
movl 0x383070(%rip), %eax    # 0x3961f4
movl %eax, %esi
leaq 0x15ce39(%rip), %rdi    # 0x16ffc6
movb $0x0, %al
callq 0x9030
movl 0x38305a(%rip), %eax    # 0x3961f4
movl %eax, %edx
leaq 0x28999d(%rip), %rdi    # 0x29cb40
leaq 0x15ce38(%rip), %rsi    # 0x16ffe2
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
cmpl $0x0, 0x28afaa(%rip)    # 0x29e16c
je 0x13201
movl 0x28afa2(%rip), %eax    # 0x29e16c
movl %eax, %esi
leaq 0x15ce2b(%rip), %rdi    # 0x16fffe
movb $0x0, %al
callq 0x9030
movl 0x28af8c(%rip), %eax    # 0x29e16c
movl %eax, %edx
leaq 0x289957(%rip), %rdi    # 0x29cb40
leaq 0x15ce26(%rip), %rsi    # 0x170016
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
movl 0x28af4d(%rip), %eax    # 0x29e154
movl %eax, %esi
movl 0x28af59(%rip), %eax    # 0x29e168
movl %eax, %edx
leaq 0x15ce16(%rip), %rdi    # 0x17002e
movb $0x0, %al
callq 0x9030
movl 0x28af2f(%rip), %eax    # 0x29e154
movl %eax, %edx
movl 0x28af3b(%rip), %eax    # 0x29e168
movl %eax, %ecx
leaq 0x28990a(%rip), %rdi    # 0x29cb40
leaq 0x15ce20(%rip), %rsi    # 0x17005d
movb $0x0, %al
callq 0x9060
movl $0x1, %edi
callq 0x10cbe0
callq 0x10d3a0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: free_fft()
void free_fft()
{
#ifdef FFT_STUFF
   if(tsignal) free(tsignal);
   if(fft_out) free(fft_out);
   if(w) free(w);
   if(cf) free(cf);

   tsignal = 0;
   fft_out = 0;
   w = 0;
   cf = 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x38bd14(%rip)    # 0x39ef80
je 0x1327a
movq 0x38bd0b(%rip), %rdi    # 0x39ef80
callq 0x9450
cmpq $0x0, 0x38bd16(%rip)    # 0x39ef98
je 0x13290
movq 0x38bd0d(%rip), %rdi    # 0x39ef98
callq 0x9450
cmpq $0x0, 0x38bcf0(%rip)    # 0x39ef88
je 0x132a6
movq 0x38bce7(%rip), %rdi    # 0x39ef88
callq 0x9450
cmpq $0x0, 0x38bce2(%rip)    # 0x39ef90
je 0x132bc
movq 0x38bcd9(%rip), %rdi    # 0x39ef90
callq 0x9450
movq $0x0, 0x38bcb9(%rip) # 0x39ef80
movq $0x0, 0x38bcc6(%rip) # 0x39ef98
movq $0x0, 0x38bcab(%rip) # 0x39ef88
movq $0x0, 0x38bca8(%rip) # 0x39ef90
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: free_adev_queues()
void free_adev_queues()
{
   // release the adev queue memory
   if(pps_adev_q) {
      free(pps_adev_q);
      pps_adev_q = 0;
   }

   if(osc_adev_q) {
      free(osc_adev_q);
      osc_adev_q = 0;
   }

   if(chc_adev_q) {
      free(chc_adev_q);
      chc_adev_q = 0;
   }

   if(chd_adev_q) {
      free(chd_adev_q);
      chd_adev_q = 0;
   }

   adev_q_allocated = 0;
   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x2889d4(%rip)    # 0x29bd00
je 0x13345
movq 0x2889cb(%rip), %rdi    # 0x29bd00
callq 0x9450
movq $0x0, 0x2889bb(%rip) # 0x29bd00
cmpq $0x0, 0x288a03(%rip)    # 0x29bd50
je 0x13366
movq 0x2889fa(%rip), %rdi    # 0x29bd50
callq 0x9450
movq $0x0, 0x2889ea(%rip) # 0x29bd50
cmpq $0x0, 0x288a32(%rip)    # 0x29bda0
je 0x13387
movq 0x288a29(%rip), %rdi    # 0x29bda0
callq 0x9450
movq $0x0, 0x288a19(%rip) # 0x29bda0
cmpq $0x0, 0x288a61(%rip)    # 0x29bdf0
je 0x133a8
movq 0x288a58(%rip), %rdi    # 0x29bdf0
callq 0x9450
movq $0x0, 0x288a48(%rip) # 0x29bdf0
movl $0x0, 0x288b0e(%rip)    # 0x29bec0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: replace_plot_q(long)
void replace_plot_q(long i)
{
struct PLOT_Q q0, q1, q2;
int j;

   // replace a plot queue point's data with the average of the adjacent points

   q0 = get_plot_q(i-1);
   q1 = get_plot_q(i);
   q2 = get_plot_q(i+1);
   for(j=0; j<NUM_PLOTS+DERIVED_PLOTS; j++) {
      q1.data[j] = q0.data[j];  // replace with previous point's data
//    q1.data[j] = (q0.data[j] + q2.data[j]) / (DATA_SIZE) 2.0;  // replace with average of adjacent points
//    q1.data[j] = q2.data[j];  // replace with next point's data
   }
   put_plot_q(i, q1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
subq $0x1, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x133f0
leaq -0xb8(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movq -0x8(%rbp), %rsi
leaq -0x380(%rbp), %rdi
callq 0x133f0
leaq -0x168(%rbp), %rdi
leaq -0x380(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movq -0x8(%rbp), %rsi
addq $0x1, %rsi
leaq -0x430(%rbp), %rdi
callq 0x133f0
leaq -0x218(%rbp), %rdi
leaq -0x430(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movl $0x0, -0x21c(%rbp)
cmpl $0x14, -0x21c(%rbp)
jge 0x137b3
movslq -0x21c(%rbp), %rax
movsd -0xa8(%rbp,%rax,8), %xmm0
movslq -0x21c(%rbp), %rax
movsd %xmm0, -0x158(%rbp,%rax,8)
movl -0x21c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x21c(%rbp)
jmp 0x13779
movq -0x8(%rbp), %rax
movq %rax, -0x4e8(%rbp)
leaq -0x4e0(%rbp), %rdi
leaq -0x168(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movq %rsp, %rdi
movl $0x16, %ecx
leaq -0x4e0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x4e8(%rbp), %rdi
callq 0x13680
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: deglitch_queue_point()
void deglitch_queue_point()
{
   // replace a plot queue mouse point data with the average of the adjacent points

   if(mouse_plot_valid) {
      replace_plot_q(last_plot_glitch);
      ++last_plot_glitch;
      need_redraw = 5832;
   }
   else {
      BEEP(7);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x266c2d(%rip)    # 0x27a438
je 0x13837
movq 0x266c4c(%rip), %rdi    # 0x27a460
callq 0x136e0
movq 0x266c40(%rip), %rax    # 0x27a460
addq $0x1, %rax
movq %rax, 0x266c35(%rip)    # 0x27a460
movl $0x16c8, 0x2641ef(%rip) # imm = 0x16C8
jmp 0x13841
movl $0x7, %edi
callq 0x9ec0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: clear_plot_entry(long)
void clear_plot_entry(long i)
{
struct PLOT_Q q;
int j;

   // clear out the data in a plot queue entry

// for(j=0; j<NUM_PLOTS; j++) q.data[j] = (DATA_SIZE) 0.0;  // derived_plots OK
   for(j=0; j<NUM_PLOTS+DERIVED_PLOTS; j++) q.data[j] = (DATA_SIZE) 0.0;  // derived_plots OK

   q.sat_flags = 0;
   q.q_jd = 0.0;

   put_plot_q(i, q);

   if(i) {   // clear q entry marker, if set
      for(j=0; j<MAX_MARKER; j++) {
         if(mark_q_entry[j] == i) mark_q_entry[j] = 0;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movl $0x0, -0xbc(%rbp)
cmpl $0x14, -0xbc(%rbp)
jge 0x13f76
movslq -0xbc(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, -0xa8(%rbp,%rax,8)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x13f49
movw $0x0, -0xb8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movq %rsp, %rdi
movl $0x16, %ecx
leaq -0x170(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x178(%rbp), %rdi
callq 0x13680
cmpq $0x0, -0x8(%rbp)
je 0x14028
movl $0x0, -0xbc(%rbp)
cmpl $0xa, -0xbc(%rbp)
jge 0x14026
movslq -0xbc(%rbp), %rcx
leaq 0x26649d(%rip), %rax    # 0x27a490
movq (%rax,%rcx,8), %rax
cmpq -0x8(%rbp), %rax
jne 0x14013
movslq -0xbc(%rbp), %rcx
leaq 0x266485(%rip), %rax    # 0x27a490
movq $0x0, (%rax,%rcx,8)
jmp 0x14015
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x13fdc
jmp 0x14028
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: alloc_plot()
void alloc_plot()
{
long i;

   // allocate memory for the plot data queue

   free_plot();
   if(plot_q) return; // plot queue memory already allocated

   plot_q = (struct PLOT_Q *) calloc(plot_q_size+1L, sizeof(struct PLOT_Q));
   if(plot_q == 0) i = 0;
   else            i = 1;

   if(plot_q == 0) {
      sprintf(out, "Could not allocate %lu x %lu byte plot queue",
                    (unsigned long) (plot_q_size+1L), (unsigned long) sizeof(struct PLOT_Q));
      error_exit(51, out);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x133c0
cmpq $0x0, 0x26630b(%rip)    # 0x27a4f0
je 0x141e9
jmp 0x14261
movq 0x266310(%rip), %rdi    # 0x27a500
addq $0x1, %rdi
movl $0xb0, %esi
callq 0x9230
movq %rax, 0x2662eb(%rip)    # 0x27a4f0
cmpq $0x0, 0x2662e3(%rip)    # 0x27a4f0
jne 0x14219
movq $0x0, -0x8(%rbp)
jmp 0x14221
movq $0x1, -0x8(%rbp)
cmpq $0x0, 0x2662c7(%rip)    # 0x27a4f0
jne 0x14261
movq 0x2662ce(%rip), %rdx    # 0x27a500
addq $0x1, %rdx
leaq 0x3871c3(%rip), %rdi    # 0x39b400
leaq 0x15bff2(%rip), %rsi    # 0x170236
movl $0xb0, %ecx
movb $0x0, %al
callq 0x9060
movl $0x33, %edi
leaq 0x3871a4(%rip), %rsi    # 0x39b400
callq 0xc050
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: alloc_gif()
void alloc_gif()
{
#ifdef GIF_FILES
long i;

   // allocate memory for the .GIF file encoder

   if(hash_table) {  // memory alrady allocated
      free_gif();
   }

   hash_table = (unsigned long *) calloc(HT_SIZE+1L, sizeof (unsigned long));
   if(hash_table == 0) i = 0;
   else                i = 1;

   if(hash_table == 0) {
      sprintf(out, "Could not allocate %lu x %lud byte GIF hash table",
                    (unsigned long) (HT_SIZE+1L), (unsigned long) sizeof (unsigned long));
      error_exit(52, out);
   }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x266278(%rip)    # 0x27a4f8
je 0x14287
callq 0x132f0
movl $0x2001, %edi           # imm = 0x2001
movl $0x8, %esi
callq 0x9230
movq %rax, 0x26625b(%rip)    # 0x27a4f8
cmpq $0x0, 0x266253(%rip)    # 0x27a4f8
jne 0x142b1
movq $0x0, -0x8(%rbp)
jmp 0x142b9
movq $0x1, -0x8(%rbp)
cmpq $0x0, 0x266237(%rip)    # 0x27a4f8
jne 0x142f3
leaq 0x387136(%rip), %rdi    # 0x39b400
leaq 0x15bf92(%rip), %rsi    # 0x170263
movl $0x2001, %edx           # imm = 0x2001
movl $0x8, %ecx
movb $0x0, %al
callq 0x9060
movl $0x34, %edi
leaq 0x387112(%rip), %rsi    # 0x39b400
callq 0xc050
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: alloc_fft()
void alloc_fft()
{
#ifdef FFT_STUFF
long i;

   // allocate memory for the FFT routine
   free_fft();
   if(max_fft_len == 0) max_fft_len = 1024;

   if(tsignal == 0) {
      i = sizeof(float);
      i *= (max_fft_len+2);
      tsignal = (float *) (void *) calloc(i, 1);
   }
   if(fft_out == 0) {
      i = sizeof(COMPLEX);
      i *= (max_fft_len/2+2);
      fft_out = (COMPLEX *) (void *) calloc(i, 1);
   }
   if(w == 0) {
      i = sizeof(COMPLEX);
      i *= (max_fft_len/2+2);
      w = (COMPLEX *) (void *) calloc(i, 1);
   }
   if(cf == 0) {
      i = sizeof(COMPLEX);
      i *= (max_fft_len/2+2);
      cf = (COMPLEX *) (void *) calloc(i, 1);
   }
   if((tsignal == 0) || (fft_out == 0) || (w == 0) || (cf == 0)) {
      sprintf(out, "Could not allocate FFT tables");
      error_exit(53, out);
   }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x13260
cmpq $0x0, 0x38ac43(%rip)    # 0x39ef58
jne 0x14322
movq $0x400, 0x38ac36(%rip) # imm = 0x400
cmpq $0x0, 0x38ac56(%rip)    # 0x39ef80
jne 0x1435d
movq $0x4, -0x8(%rbp)
movq 0x38ac1d(%rip), %rax    # 0x39ef58
addq $0x2, %rax
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9230
movq %rax, 0x38ac23(%rip)    # 0x39ef80
cmpq $0x0, 0x38ac33(%rip)    # 0x39ef98
jne 0x143a2
movq $0x8, -0x8(%rbp)
movq 0x38abe2(%rip), %rax    # 0x39ef58
movl $0x2, %ecx
cqto
idivq %rcx
addq $0x2, %rax
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9230
movq %rax, 0x38abf6(%rip)    # 0x39ef98
cmpq $0x0, 0x38abde(%rip)    # 0x39ef88
jne 0x143e7
movq $0x8, -0x8(%rbp)
movq 0x38ab9d(%rip), %rax    # 0x39ef58
movl $0x2, %ecx
cqto
idivq %rcx
addq $0x2, %rax
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9230
movq %rax, 0x38aba1(%rip)    # 0x39ef88
cmpq $0x0, 0x38aba1(%rip)    # 0x39ef90
jne 0x1442c
movq $0x8, -0x8(%rbp)
movq 0x38ab58(%rip), %rax    # 0x39ef58
movl $0x2, %ecx
cqto
idivq %rcx
addq $0x2, %rax
imulq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9230
movq %rax, 0x38ab64(%rip)    # 0x39ef90
cmpq $0x0, 0x38ab4c(%rip)    # 0x39ef80
je 0x14454
cmpq $0x0, 0x38ab5a(%rip)    # 0x39ef98
je 0x14454
cmpq $0x0, 0x38ab40(%rip)    # 0x39ef88
je 0x14454
cmpq $0x0, 0x38ab3e(%rip)    # 0x39ef90
jne 0x1447a
leaq 0x386fa5(%rip), %rdi    # 0x39b400
leaq 0x15be33(%rip), %rsi    # 0x170295
movb $0x0, %al
callq 0x9060
movl $0x35, %edi
leaq 0x386f8b(%rip), %rsi    # 0x39b400
callq 0xc050
addq $0x10, %rsp
popq %rbp
retq
// File: jkingan[P]ladyheather/heather.cpp
// Function: alloc_memory()
void alloc_memory()
{
   printf("\nInitializing memory...");

//!!!! alloc_adev();
   alloc_plot();
   alloc_gif();
   alloc_fft();

   reset_queues(RESET_ALL_QUEUES, 1000);

   printf("\nDone...\n\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x15be28(%rip), %rdi    # 0x1702b3
movb $0x0, %al
callq 0x9030
callq 0x141d0
callq 0x14270
callq 0x14300
movl $0x7, %edi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x144c0
leaq 0x15be14(%rip), %rdi    # 0x1702cb
movb $0x0, %al
callq 0x9030
popq %rbp
retq
// File: jkingan[P]ladyheather/heather.cpp
// Function: new_queue(int, int)
void new_queue(int queue_type, int why)
{
   // flush the queue contents and start up a new data capture
//sprintf(debug_text, "new queue:%04x  why:%d", queue_type, why);
   reset_queues(queue_type, why);
   log_loaded = 0;
   if(need_view_auto && (view_all_data == 2)) ;
   else end_review(1);
   redraw_screen();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x144c0
movb $0x0, 0x2887ca(%rip)    # 0x29d5da
cmpl $0x0, 0x265789(%rip)    # 0x27a5a0
je 0x14e27
movzbl 0x265785(%rip), %eax    # 0x27a5a5
cmpl $0x2, %eax
jne 0x14e27
jmp 0x14e31
movl $0x1, %edi
callq 0x14e40
callq 0x12ae0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heather.cpp
// Function: end_review(unsigned char)
void end_review(u08 draw_flag)
{
   // exit plot review mode
   review_mode = 0;
   review = plot_q_count;

   plot_start = plot_q_in - (((PLOT_WIDTH - PLOT_SCROLL)*view_interval)/(long)plot_mag) - plot_q_out;
   if(plot_start < 0) {
       if(plot_q_full) {
          plot_start += plot_q_size;
          if(plot_start < 0) plot_start = 0;
       }
       else plot_start = 0;
   }

//!!!!- pause_data = 0;
   restore_plot_config();
   if(draw_flag) draw_plot(REFRESH_SCREEN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movb $0x0, 0x2870cb(%rip)    # 0x29bf20
movq 0x2656bc(%rip), %rax    # 0x27a518
movq %rax, 0x2870c5(%rip)    # 0x29bf28
movq 0x26569e(%rip), %rax    # 0x27a508
movq %rax, -0x10(%rbp)
movl 0x262bf0(%rip), %eax    # 0x277a64
subl 0x262bfe(%rip), %eax    # 0x277a78
cltq
imulq 0x2656fc(%rip), %rax    # 0x27a580
movslq 0x265725(%rip), %rcx    # 0x27a5b0
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
subq 0x26566f(%rip), %rax    # 0x27a510
movq %rax, 0x265680(%rip)    # 0x27a528
cmpq $0x0, 0x265678(%rip)    # 0x27a528
jge 0x14ef4
cmpb $0x0, 0x265667(%rip)    # 0x27a520
je 0x14ee7
movq 0x26563e(%rip), %rax    # 0x27a500
addq 0x26565f(%rip), %rax    # 0x27a528
movq %rax, 0x265658(%rip)    # 0x27a528
cmpq $0x0, 0x265650(%rip)    # 0x27a528
jge 0x14ee5
movq $0x0, 0x265643(%rip) # 0x27a528
jmp 0x14ef2
movq $0x0, 0x265636(%rip) # 0x27a528
jmp 0x14ef4
callq 0x1212f0
cmpb $0x0, -0x1(%rbp)
je 0x14f09
movl $0x1, %edi
callq 0x24e80
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heather.cpp
// Function: find_event(long, unsigned short)
long find_event(long i, u16 flags)
{
struct PLOT_Q q;
long count;

   // locate the next holdover event or time sequence error in the plot queue
   if(i < 0) return (-1);  // should never happen

   count = 0;
   while(i >= plot_q_size) i -= plot_q_size;  // !!! perhaps we should return (-1)

   while(i != plot_q_in) {  // skip over leading queue entries that match the flags
      q = get_plot_q(i);
      if((q.sat_flags & flags) == 0) break;
      ++i;
      if(i >= plot_q_size) i = 0;       // wrap the queue
      if(++count > plot_q_count) break; // prevent run-away loop
   }
   if(i == plot_q_in) {  // event not found
      return i;
   }

   count = 0;
   while(i != plot_q_in) {  // find the next occurance of the event
      q = get_plot_q(i);
      if((q.sat_flags & flags) != 0) break;
      ++i;
      if(i >= plot_q_size) i = 0;
      if(++count > plot_q_count) break;
   }

   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0x14f3a
movq $-0x1, -0x8(%rbp)
jmp 0x150ad
movq $0x0, -0xd0(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x2655b0(%rip), %rax    # 0x27a500
jl 0x14f66
movq 0x2655a7(%rip), %rcx    # 0x27a500
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x14f45
jmp 0x14f68
movq -0x10(%rbp), %rax
cmpq 0x265595(%rip), %rax    # 0x27a508
je 0x14ff4
movq -0x10(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x133f0
leaq -0xc8(%rbp), %rdi
leaq -0x180(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movzwl -0xc8(%rbp), %eax
movzwl -0x12(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x14fb1
jmp 0x14ff4
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x265538(%rip), %rax    # 0x27a500
jl 0x14fd2
movq $0x0, -0x10(%rbp)
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
cmpq 0x26552d(%rip), %rax    # 0x27a518
jle 0x14fef
jmp 0x14ff4
jmp 0x14f68
movq -0x10(%rbp), %rax
cmpq 0x265509(%rip), %rax    # 0x27a508
jne 0x1500e
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x150ad
movq $0x0, -0xd0(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x2654e4(%rip), %rax    # 0x27a508
je 0x150a5
movq -0x10(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0x133f0
leaq -0xc8(%rbp), %rdi
leaq -0x230(%rbp), %rsi
movl $0xb0, %edx
callq 0x92c0
movzwl -0xc8(%rbp), %eax
movzwl -0x12(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x15062
jmp 0x150a5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x265487(%rip), %rax    # 0x27a500
jl 0x15083
movq $0x0, -0x10(%rbp)
movq -0xd0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xd0(%rbp)
cmpq 0x26547c(%rip), %rax    # 0x27a518
jle 0x150a0
jmp 0x150a5
jmp 0x15019
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw (%rax,%rax)