// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: show_adev_info(int)
void show_adev_info(int why)
{
int row;
int mask;

   // draw the adev tables and graphs
   adev_show_time = 0;
   adevs_shown = 0;
   if(adevs_active(1) == 0) return;
   if(luxor) return;

   mask = 0xFFFF;
   if(all_adevs) {
      if(mixed_adevs == MIXED_REGULAR) {  // show 4 adev tables, PPS and OSC curves
         show_all_adevs();
         if(adev_display_mask & DISPLAY_CHA) plot_adev_curve(&pps_bins, PPS_ADEV_COLOR, mask);
         if(adev_display_mask & DISPLAY_CHB) plot_adev_curve(&osc_bins, OSC_ADEV_COLOR, mask);
      }
      else {  // show all 4 adev tables and matching curves
         show_all_adevs();
      }
   }
   else {  // show OSC and PPS tables and curves
      find_global_max();
      row = ADEV_ROW+0;
      if(pps_adev_q_count && osc_adev_q_count) ;
      else adev_page_size = adev_table_rows = (adev_bottom_row - row) - 1;

      if(pps_adev_q_count) {  // we have pps adevs
         if(continuous_scroll) {
            if     (ATYPE == OSC_ADEV) { fetch_adev_info(PPS_ADEV, &pps_bins); mask = DISPLAY_ADEV; }
            else if(ATYPE == OSC_HDEV) { fetch_adev_info(PPS_HDEV, &pps_bins); mask = DISPLAY_HDEV; } 
            else if(ATYPE == OSC_MDEV) { fetch_adev_info(PPS_MDEV, &pps_bins); mask = DISPLAY_MDEV; } 
            else if(ATYPE == OSC_TDEV) { fetch_adev_info(PPS_TDEV, &pps_bins); mask = DISPLAY_TDEV; } 
            else if(ATYPE == A_MTIE)   { fetch_adev_info(A_MTIE, &pps_bins); mask = DISPLAY_MTIE; } 
         }
         show_adev_table(&pps_bins, row, ADEV_COL, PPS_ADEV_COLOR, 9);
         if(adev_display_mask & DISPLAY_CHA) plot_adev_curve(&pps_bins, PPS_ADEV_COLOR, mask);
      }


      if(pps_adev_q_count && osc_adev_q_count) {  // we have osc and pps adevs
         row = (adev_bottom_row - ADEV_ROW);  // split the adev area in half adev_page_size
         row = ADEV_ROW + (row/2);
         adev_page_size = adev_table_rows = (adev_bottom_row - row);
         if(adev_decades_shown && (adev_decades_shown < adev_page_size)) adev_page_size = adev_decades_shown;
         adev_page_size &= (~1);
         adev_table_rows &= (~1);
      }
//sprintf(debug_text, "arow:%d  abr:%d  aps:%d  ads:%d", ADEV_ROW, adev_bottom_row, adev_page_size, adev_decades_shown);

      if(osc_adev_q_count) {  // we have osc adevs to show
         if(continuous_scroll) {
            if     (ATYPE == OSC_ADEV) { fetch_adev_info(OSC_ADEV, &osc_bins); mask = DISPLAY_ADEV; }  
            else if(ATYPE == OSC_HDEV) { fetch_adev_info(OSC_HDEV, &osc_bins); mask = DISPLAY_HDEV; }  
            else if(ATYPE == OSC_MDEV) { fetch_adev_info(OSC_MDEV, &osc_bins); mask = DISPLAY_MDEV; }  
            else if(ATYPE == OSC_TDEV) { fetch_adev_info(OSC_TDEV, &osc_bins); mask = DISPLAY_TDEV; }  
            else if(ATYPE == A_MTIE)   { fetch_adev_info(B_MTIE,   &osc_bins); mask = DISPLAY_MTIE; }  
         }
         show_adev_table(&osc_bins, row, ADEV_COL, OSC_ADEV_COLOR, 10);
         if(adev_display_mask & DISPLAY_CHB) plot_adev_curve(&osc_bins, OSC_ADEV_COLOR, mask);
      }
   }
//sprintf(debug_text, "gamax:%g  gamin:%g    ", global_adev_max,global_adev_min);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x13c843(%rip), %rax    # 0x226d38
andl $0x0, (%rax)
leaq 0x13c785(%rip), %rax    # 0x226c84
andl $0x0, (%rax)
pushq $0x1
popq %rdi
callq 0xc71ad
testl %eax, %eax
je 0xea711
leaq 0x13ea25(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
jne 0xea711
leaq 0x13c815(%rip), %rax    # 0x226d3e
cmpb $0x0, (%rax)
je 0xea57e
leaq 0x13c808(%rip), %rax    # 0x226d3d
movb (%rax), %bl
callq 0xecf6a
cmpb $0x2, %bl
jne 0xea711
leaq 0x1230cc(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
btl $0x8, %eax
jae 0xea56a
leaq 0x1230c5(%rip), %rdi    # 0x20d620
pushq $0x9
popq %rsi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0xec731
movl (%rbx), %eax
movl $0xffff, %ebx           # imm = 0xFFFF
btl $0x9, %eax
jae 0xea711
jmp 0xea71c
callq 0xc6cd3
leaq 0x13c5ae(%rip), %r14    # 0x226b38
movq (%r14), %rax
leaq 0x13c5f4(%rip), %r15    # 0x226b88
testq %rax, %rax
je 0xea59f
cmpq $0x0, (%r15)
jne 0xea5c1
leaq 0x118212(%rip), %rcx    # 0x2027b8
movl (%rcx), %ecx
decl %ecx
leaq 0x11820f(%rip), %rdx    # 0x2027c0
movl %ecx, (%rdx)
leaq 0x118202(%rip), %rdx    # 0x2027bc
movl %ecx, (%rdx)
testq %rax, %rax
je 0xea640
leaq 0x11ae00(%rip), %rax    # 0x2053c8
movl $0xffff, %ebx           # imm = 0xFFFF
cmpb $0x0, (%rax)
je 0xea60c
leaq 0x123037(%rip), %rax    # 0x20d610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xea60c
movl $0x20f, %ecx            # imm = 0x20F
btl %eax, %ecx
jae 0xea60c
leaq 0x2afc6(%rip), %rcx     # 0x1155b8
movzbl (%rax,%rcx), %edi
leaq 0x2af6b(%rip), %rcx     # 0x115568
movl (%rcx,%rax,4), %ebx
leaq 0x123019(%rip), %rsi    # 0x20d620
callq 0xeaf45
leaq 0x12300d(%rip), %rdi    # 0x20d620
pushq $0x4f
popq %rdx
pushq $0x9
popq %rcx
xorl %esi, %esi
callq 0xeb8fc
leaq 0x122ff1(%rip), %rax    # 0x20d618
testb $0x1, 0x1(%rax)
je 0xea645
leaq 0x122fec(%rip), %rdi    # 0x20d620
pushq $0x9
popq %rsi
movl %ebx, %edx
callq 0xec731
jmp 0xea645
movl $0xffff, %ebx           # imm = 0xFFFF
cmpq $0x0, (%r14)
setne %cl
movq (%r15), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xea6a1
leaq 0x118155(%rip), %rax    # 0x2027b8
movl (%rax), %ecx
pushq $0x2
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %r14d
subl %eax, %ecx
leaq 0x11814b(%rip), %rax    # 0x2027c4
movl (%rax), %eax
cmpl %ecx, %eax
movl %ecx, %edx
cmovll %eax, %edx
testl %eax, %eax
cmovel %ecx, %edx
andl $-0x2, %edx
leaq 0x11812b(%rip), %rax    # 0x2027bc
movl %edx, (%rax)
andl $-0x2, %ecx
leaq 0x118123(%rip), %rax    # 0x2027c0
movl %ecx, (%rax)
jmp 0xea6a9
xorl %r14d, %r14d
testq %rax, %rax
je 0xea711
leaq 0x11ad18(%rip), %rax    # 0x2053c8
cmpb $0x0, (%rax)
je 0xea6ef
leaq 0x122f54(%rip), %rax    # 0x20d610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xea6ef
movl $0x20f, %ecx            # imm = 0x20F
btl %eax, %ecx
jae 0xea6ef
leaq 0x2af17(%rip), %rcx     # 0x1155ec
movzbl (%rax,%rcx), %edi
leaq 0x2ae88(%rip), %rcx     # 0x115568
movl (%rcx,%rax,4), %ebx
leaq 0x12358e(%rip), %rsi    # 0x20dc78
callq 0xeaf45
leaq 0x123582(%rip), %rdi    # 0x20dc78
pushq $0x4f
popq %rdx
pushq $0x6
popq %rcx
movl %r14d, %esi
callq 0xeb8fc
leaq 0x122f0d(%rip), %rax    # 0x20d618
testb $0x2, 0x1(%rax)
jne 0xea71c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123555(%rip), %rdi    # 0x20dc78
pushq $0x6
popq %rsi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xec731