// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: show_plot_grid()
void show_plot_grid()
{
int x, y;
int color;
int col;
int j;
int top_adev_row;
int adev_decade_width;  // HORIZ_MAJOR divisions per decade

   if(bin_scale == 8) adev_decade_width = 4;  // 1-2-4-8 decades
   else if(bin_scale == 1) adev_decade_width = 1;  // 1 per decade
//   else if(bin_scale == 2) adev_decade_width = 4;  // 1 per octave
   else adev_decade_width = 3;  // 1-2-5 decades

   if(rcvr_type == NO_RCVR) return;
   top_adev_row = SCREEN_HEIGHT;


   for(x=0; x<PLOT_WIDTH; x++) {  // draw vertical features
      col = PLOT_COL + x;
      if((x % HORIZ_MAJOR) == 0) {  // major tick marks
         dot(col, PLOT_ROW+1, WHITE);               // along top horizontal axis
         dot(col, PLOT_ROW+2, WHITE);
         dot(col, PLOT_ROW+3, WHITE);

         dot(col, PLOT_ROW+PLOT_HEIGHT-2, WHITE);   // along bottom horizontal axis
         dot(col, PLOT_ROW+PLOT_HEIGHT-3, WHITE);
         dot(col, PLOT_ROW+PLOT_HEIGHT-4, WHITE);

         for(j=0; j<=PLOT_CENTER; j+=VERT_MAJOR) {
            dot(col,   PLOT_ROW+PLOT_CENTER+j-1, WHITE);  // + at intersections
            dot(col,   PLOT_ROW+PLOT_CENTER+j,   WHITE);
            dot(col,   PLOT_ROW+PLOT_CENTER+j+1, WHITE);
            if(col > PLOT_COL) dot(col-1, PLOT_ROW+PLOT_CENTER+j,WHITE);
            dot(col+1, PLOT_ROW+PLOT_CENTER+j,   WHITE);

            dot(col,  PLOT_ROW+PLOT_CENTER-j-1, WHITE);  // + at intersections
            dot(col,  PLOT_ROW+PLOT_CENTER-j,   WHITE);
            dot(col,  PLOT_ROW+PLOT_CENTER-j+1, WHITE);
            if(col > PLOT_COL) dot(col-1,PLOT_ROW+PLOT_CENTER-j, WHITE);
            dot(col+1,PLOT_ROW+PLOT_CENTER-j,    WHITE);
         }

         color = GREY;  // WHITE;
         if(plot_adev_data) {
            if((x % (HORIZ_MAJOR*adev_decade_width)) == 0) color = CYAN;  // ADEV 1-2-5 bins
         }

         for(j=VERT_MINOR; j<=PLOT_CENTER; j+=VERT_MINOR) {
            dot(col, PLOT_ROW+PLOT_CENTER+j, color);
            dot(col, PLOT_ROW+PLOT_CENTER-j, color);
         }
      }
      else if((x % HORIZ_MINOR) == 0) {  // minor tick marks
         dot(col, PLOT_ROW+1, WHITE);
         dot(col, PLOT_ROW+PLOT_CENTER, GREY);  // center line tick marks
         dot(col, PLOT_ROW+PLOT_HEIGHT-2, WHITE);

         if(plot_adev_data) color = CYAN;  // subtly highlight ADEV decades
         else               color = GREY;

         for(j=VERT_MAJOR; j<=PLOT_CENTER; j+=VERT_MAJOR) {
            dot(col, PLOT_ROW+PLOT_CENTER+j, color);
            dot(col, PLOT_ROW+PLOT_CENTER-j, color);
            if((PLOT_ROW+PLOT_CENTER-j) < top_adev_row) {
               if(color == CYAN) top_adev_row = (PLOT_ROW+PLOT_CENTER-j);
            }
            if(SCREEN_HEIGHT > SHORT_SCREEN) {
               if(plot_adev_data && (color != CYAN)) color = CYAN;
               else color = GREY;  // WHITE;
            }
            else if(zoom_screen == 'P') {
               if(plot_adev_data && (color != CYAN)) color = CYAN;
               else color = GREY;  // WHITE;
            }
            else {
               dot(col, PLOT_ROW+PLOT_CENTER, color);
            }
         }
      }
   }

   for(y=0; y<=PLOT_CENTER; y++) {  // draw horizontal features
      if((y % VERT_MAJOR) == 0) {
         if((HIGHLIGHT_REF == 0) || (y != 0)) {
            dot(PLOT_COL+1,              PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+1,              PLOT_ROW+PLOT_CENTER-y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-1, PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-1, PLOT_ROW+PLOT_CENTER-y, WHITE);
            dot(PLOT_COL+2,              PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+2,              PLOT_ROW+PLOT_CENTER-y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-2, PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-2, PLOT_ROW+PLOT_CENTER-y, WHITE);
            dot(PLOT_COL+3,              PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+3,              PLOT_ROW+PLOT_CENTER-y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-3, PLOT_ROW+PLOT_CENTER+y, WHITE);
            dot(PLOT_COL+PLOT_WIDTH-1-3, PLOT_ROW+PLOT_CENTER-y, WHITE);
         }
      }
      else if((y % VERT_MINOR) == 0) {
         dot(PLOT_COL+1,             PLOT_ROW+PLOT_CENTER+y,  WHITE);
         dot(PLOT_COL+1,             PLOT_ROW+PLOT_CENTER-y,  WHITE);
         dot(PLOT_COL+PLOT_WIDTH-1-1,PLOT_ROW+PLOT_CENTER+y,  WHITE);
         dot(PLOT_COL+PLOT_WIDTH-1-1,PLOT_ROW+PLOT_CENTER-y,  WHITE);
      }
   }

   // draw plot border
   draw_rectangle(PLOT_COL,PLOT_ROW+1, PLOT_WIDTH-1,PLOT_HEIGHT-1-1, WHITE);

   if(HIGHLIGHT_REF) {   // highlight plot center reference line with > ,,, < markers
      mark_row(PLOT_CENTER);
   }

   label_adev_grid(top_adev_row);  // label the ADEV grid lines if adevs being shown
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x225652(%rip), %eax    # 0x23cc7c
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
leal 0x1(,%rcx,2), %ecx
cmpl $0x8, %eax
movl $0x4, %eax
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
cmpq $0x400, 0x20127e(%rip) # imm = 0x400
jne 0x17663
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x20119b(%rip), %edi    # 0x218804
movl 0x201215(%rip), %edx    # 0x218884
testl %edx, %edx
jle 0x17a7c
xorl %ecx, %ecx
movl 0x201200(%rip), %r15d   # 0x218880
addl %ecx, %r15d
movl %ecx, %eax
cltd
idivl 0x2011e8(%rip)          # 0x218874
testl %edx, %edx
movl %ecx, -0x30(%rbp)
je 0x17710
movl %ecx, %eax
cltd
idivl 0x2011dc(%rip)          # 0x218878
testl %edx, %edx
jne 0x17a69
movl %edi, %r14d
movl 0x2011cf(%rip), %esi    # 0x21887c
incl %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x2011d2(%rip), %esi    # 0x218894
addl 0x2011b4(%rip), %esi    # 0x21887c
movl %r15d, %edi
movl $0x8, %edx
callq 0xe657
movl 0x2011a1(%rip), %eax    # 0x21887c
movl 0x2011a7(%rip), %ecx    # 0x218888
leal (%rax,%rcx), %esi
addl $-0x2, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201172(%rip), %ebx    # 0x21886c
movl 0x201194(%rip), %esi    # 0x218894
cmpl %esi, %ebx
jle 0x17999
movl %r14d, %edi
jmp 0x17a69
movl %edi, -0x2c(%rbp)
movl 0x201163(%rip), %esi    # 0x21887c
incl %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x20114e(%rip), %esi    # 0x21887c
addl $0x2, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201138(%rip), %esi    # 0x21887c
addl $0x3, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201122(%rip), %eax    # 0x21887c
movl 0x201128(%rip), %ecx    # 0x218888
leal (%rax,%rcx), %esi
addl $-0x2, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201103(%rip), %eax    # 0x21887c
movl 0x201109(%rip), %ecx    # 0x218888
leal (%rax,%rcx), %esi
addl $-0x3, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x2010e4(%rip), %eax    # 0x21887c
movl 0x2010ea(%rip), %ecx    # 0x218888
leal (%rax,%rcx), %esi
addl $-0x4, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x2010dd(%rip), %esi    # 0x218894
testl %esi, %esi
js 0x17916
leal -0x1(%r15), %r12d
leal 0x1(%r15), %r13d
xorl %r14d, %r14d
xorl %ebx, %ebx
movl 0x2010aa(%rip), %eax    # 0x21887c
addl %ebx, %esi
addl %eax, %esi
decl %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201091(%rip), %esi    # 0x21887c
addl %ebx, %esi
addl 0x2010a1(%rip), %esi    # 0x218894
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x20108e(%rip), %eax    # 0x218894
movl 0x201070(%rip), %ecx    # 0x21887c
addl %ebx, %ecx
leal (%rax,%rcx), %esi
incl %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
cmpl 0x201059(%rip), %r15d   # 0x218880
jle 0x17844
movl 0x20104d(%rip), %esi    # 0x21887c
addl %ebx, %esi
addl 0x20105d(%rip), %esi    # 0x218894
movl %r12d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x201032(%rip), %esi    # 0x21887c
addl %ebx, %esi
addl 0x201042(%rip), %esi    # 0x218894
movl %r13d, %edi
movl $0xf, %edx
callq 0xe657
movl %ebx, %esi
notl %esi
addl 0x201013(%rip), %esi    # 0x21887c
addl 0x201025(%rip), %esi    # 0x218894
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x200ffa(%rip), %esi    # 0x21887c
addl %r14d, %esi
addl 0x201009(%rip), %esi    # 0x218894
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x200ff6(%rip), %eax    # 0x218894
movl 0x200fd8(%rip), %ecx    # 0x21887c
addl %r14d, %ecx
leal (%rax,%rcx), %esi
incl %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
cmpl 0x200fc0(%rip), %r15d   # 0x218880
jle 0x178de
movl 0x200fb4(%rip), %esi    # 0x21887c
addl %r14d, %esi
addl 0x200fc3(%rip), %esi    # 0x218894
movl %r12d, %edi
movl $0xf, %edx
callq 0xe657
addl 0x200f97(%rip), %r14d   # 0x21887c
addl 0x200fa8(%rip), %r14d   # 0x218894
movl %r13d, %edi
movl %r14d, %esi
movl $0xf, %edx
callq 0xe657
addl 0x200f6a(%rip), %ebx    # 0x21886c
movl %ebx, %r14d
negl %r14d
movl 0x200f86(%rip), %esi    # 0x218894
cmpl %esi, %ebx
jle 0x177cc
cmpb $0x0, 0x203abc(%rip)    # 0x21b3d9
je 0x1793e
movl 0x200f4f(%rip), %ecx    # 0x218874
imull -0x34(%rbp), %ecx
movl -0x30(%rbp), %eax
cltd
idivl %ecx
xorl %eax, %eax
testl %edx, %edx
sete %al
leal (%rax,%rax,2), %eax
addl $0x8, %eax
jmp 0x17940
movb $0x8, %al
movl -0x2c(%rbp), %edi
movl 0x200f27(%rip), %ebx    # 0x218870
cmpl %esi, %ebx
jg 0x17a69
movzbl %al, %r14d
addl %ebx, %esi
addl 0x200f1f(%rip), %esi    # 0x21887c
movl %r15d, %edi
movl %r14d, %edx
callq 0xe657
movl 0x200f0e(%rip), %esi    # 0x21887c
subl %ebx, %esi
addl 0x200f1e(%rip), %esi    # 0x218894
movl %r15d, %edi
movl %r14d, %edx
callq 0xe657
addl 0x200ee9(%rip), %ebx    # 0x218870
movl 0x200f07(%rip), %esi    # 0x218894
cmpl %esi, %ebx
jle 0x17955
movl -0x2c(%rbp), %edi
jmp 0x17a69
xorl %eax, %eax
cmpb $0x0, 0x203a37(%rip)    # 0x21b3d9
setne %al
leal (%rax,%rax,2), %r12d
addl $0x8, %r12d
movl 0x200ec9(%rip), %ecx    # 0x21887c
movl %r14d, %edi
movl %edi, %r13d
addl %ebx, %esi
addl %ecx, %esi
movzbl %r12b, %r14d
movl %r15d, %edi
movl %r14d, %edx
callq 0xe657
movl 0x200eaa(%rip), %esi    # 0x21887c
subl %ebx, %esi
addl 0x200eba(%rip), %esi    # 0x218894
movl %r15d, %edi
movl %r14d, %edx
callq 0xe657
movl 0x200e91(%rip), %ecx    # 0x21887c
movl 0x200ea3(%rip), %esi    # 0x218894
leal (%rsi,%rcx), %eax
movl %eax, %edi
subl %ebx, %edi
cmpl %r13d, %edi
cmovgel %r13d, %edi
cmpl $0xb, %r12d
cmovnel %r13d, %edi
cmpl $0x259, 0x200df3(%rip)  # imm = 0x259
jge 0x17a1c
cmpb $0x50, 0x2f4d8e(%rip)   # 0x30c7a8
jne 0x17a3c
xorl %eax, %eax
cmpl $0xb, %r12d
setne %al
cmpb $0x0, 0x2039ad(%rip)    # 0x21b3d9
leal 0x8(%rax,%rax,2), %r12d
movl $0x8, %eax
cmovel %eax, %r12d
jmp 0x17a5b
movl %edi, %r13d
movl %r15d, %edi
movl %eax, %esi
movl %r14d, %edx
callq 0xe657
movl %r13d, %edi
movl 0x200e27(%rip), %ecx    # 0x21887c
movl 0x200e39(%rip), %esi    # 0x218894
addl 0x200e0b(%rip), %ebx    # 0x21886c
cmpl %esi, %ebx
jle 0x179b6
movl -0x30(%rbp), %ecx
incl %ecx
movl 0x200e10(%rip), %edx    # 0x218884
cmpl %edx, %ecx
jl 0x17679
movl %edi, %ebx
movl 0x200e10(%rip), %esi    # 0x218894
testl %esi, %esi
js 0x17ccc
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %r14d, %eax
cltd
idivl 0x200dd0(%rip)          # 0x21886c
testl %edx, %edx
je 0x17ad2
movl %r14d, %eax
cltd
idivl 0x200dc6(%rip)          # 0x218870
testl %edx, %edx
jne 0x17cad
movl 0x200dc8(%rip), %edi    # 0x218880
incl %edi
movl $0xfffffffe, %r15d      # imm = 0xFFFFFFFE
movl $0x1, %r12d
leaq 0x200daf(%rip), %rax    # 0x21887c
jmp 0x17c29
testl %r13d, %r13d
je 0x17cad
movl 0x200d9f(%rip), %edi    # 0x218880
incl %edi
addl 0x200d93(%rip), %esi    # 0x21887c
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200d84(%rip), %edi    # 0x218880
incl %edi
movl 0x200d78(%rip), %esi    # 0x21887c
addl 0x200d8a(%rip), %esi    # 0x218894
addl %r13d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200d63(%rip), %eax    # 0x218880
movl 0x200d61(%rip), %ecx    # 0x218884
leal (%rax,%rcx), %edi
addl $-0x2, %edi
movl 0x200d4d(%rip), %esi    # 0x21887c
addl 0x200d5f(%rip), %esi    # 0x218894
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200d38(%rip), %eax    # 0x218880
movl 0x200d36(%rip), %ecx    # 0x218884
leal (%rax,%rcx), %edi
addl $-0x2, %edi
movl 0x200d22(%rip), %esi    # 0x21887c
addl 0x200d34(%rip), %esi    # 0x218894
addl %r13d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200d0d(%rip), %edi    # 0x218880
addl $0x2, %edi
movl 0x200d00(%rip), %esi    # 0x21887c
addl 0x200d12(%rip), %esi    # 0x218894
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200ceb(%rip), %edi    # 0x218880
addl $0x2, %edi
movl 0x200cde(%rip), %esi    # 0x21887c
addl 0x200cf0(%rip), %esi    # 0x218894
addl %r13d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200cc9(%rip), %eax    # 0x218880
movl 0x200cc7(%rip), %ecx    # 0x218884
leal (%rax,%rcx), %edi
addl $-0x3, %edi
movl 0x200cb3(%rip), %esi    # 0x21887c
addl 0x200cc5(%rip), %esi    # 0x218894
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200c9e(%rip), %eax    # 0x218880
movl 0x200c9c(%rip), %ecx    # 0x218884
leal (%rax,%rcx), %edi
addl $-0x3, %edi
movl 0x200c88(%rip), %esi    # 0x21887c
addl 0x200c9a(%rip), %esi    # 0x218894
addl %r13d, %esi
movl $0xf, %edx
callq 0xe657
movl 0x200c73(%rip), %edi    # 0x218880
addl $0x3, %edi
movl $0xfffffffc, %r15d      # imm = 0xFFFFFFFC
movl $0x3, %r12d
movl 0x200c5a(%rip), %esi    # 0x21887c
leaq 0x200c6b(%rip), %rax    # 0x218894
addl (%rax), %esi
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
addl 0x200c41(%rip), %r12d   # 0x218880
movl 0x200c37(%rip), %esi    # 0x21887c
addl 0x200c49(%rip), %esi    # 0x218894
addl %r13d, %esi
movl %r12d, %edi
movl $0xf, %edx
callq 0xe657
movl 0x200c1f(%rip), %edi    # 0x218880
addl %r15d, %edi
addl 0x200c1a(%rip), %edi    # 0x218884
movl 0x200c0c(%rip), %esi    # 0x21887c
addl 0x200c1e(%rip), %esi    # 0x218894
addl %r14d, %esi
movl $0xf, %edx
callq 0xe657
addl 0x200bf6(%rip), %r15d   # 0x218880
addl 0x200bf3(%rip), %r15d   # 0x218884
movl 0x200be5(%rip), %esi    # 0x21887c
addl 0x200bf7(%rip), %esi    # 0x218894
addl %r13d, %esi
movl %r15d, %edi
movl $0xf, %edx
callq 0xe657
leal 0x1(%r14), %eax
movl 0x200bdd(%rip), %esi    # 0x218894
decl %r13d
cmpl %esi, %r14d
movl %eax, %r14d
jl 0x17a92
movl 0x200bb8(%rip), %edx    # 0x218884
movl 0x200bae(%rip), %edi    # 0x218880
movl 0x200ba4(%rip), %esi    # 0x21887c
incl %esi
decl %edx
movl 0x200ba6(%rip), %ecx    # 0x218888
addl $-0x2, %ecx
movl $0xf, %r8d
callq 0xf222
movl 0x200b9e(%rip), %edi    # 0x218894
callq 0x16a04
movl %ebx, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xff186