// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x13a6e6(%rip), %rax    # 0x29bf18
movl $0x0, (%rax)
leaq 0x13a625(%rip), %rax    # 0x29be64
movl $0x0, (%rax)
movl $0x1, %edi
callq 0x127d80
cmpl $0x0, %eax
jne 0x161859
jmp 0x161c51
leaq 0x13c8be(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x16186a
jmp 0x161c51
movl $0xffff, -0xc(%rbp)     # imm = 0xFFFF
leaq 0x13a6a6(%rip), %rax    # 0x29bf1e
cmpb $0x0, (%rax)
je 0x1618eb
leaq 0x13a699(%rip), %rax    # 0x29bf1d
movzbl (%rax), %eax
cmpl $0x2, %eax
jne 0x1618e1
callq 0x165d70
leaq 0x120f60(%rip), %rax    # 0x2827f8
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x1618b8
movl -0xc(%rbp), %edx
leaq 0x120f52(%rip), %rdi    # 0x282800
movl $0x9, %esi
callq 0x165080
leaq 0x120f39(%rip), %rax    # 0x2827f8
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x1618df
movl -0xc(%rbp), %edx
leaq 0x121583(%rip), %rdi    # 0x282e58
movl $0x6, %esi
callq 0x165080
jmp 0x1618e6
callq 0x165d70
jmp 0x161c51
callq 0x127650
movl $0x0, -0x8(%rbp)
leaq 0x13a41a(%rip), %rax    # 0x29bd18
cmpq $0x0, (%rax)
je 0x161913
leaq 0x13a45d(%rip), %rax    # 0x29bd68
cmpq $0x0, (%rax)
je 0x161913
jmp 0x161934
leaq 0x11607e(%rip), %rax    # 0x277998
movl (%rax), %ecx
subl -0x8(%rbp), %ecx
subl $0x1, %ecx
leaq 0x116077(%rip), %rax    # 0x2779a0
movl %ecx, (%rax)
leaq 0x11606a(%rip), %rax    # 0x27799c
movl %ecx, (%rax)
leaq 0x13a3dd(%rip), %rax    # 0x29bd18
cmpq $0x0, (%rax)
je 0x161a64
leaq 0x118c5c(%rip), %rax    # 0x27a5a8
cmpb $0x0, (%rax)
je 0x161a1e
leaq 0x120e94(%rip), %rax    # 0x2827f0
cmpl $0x0, (%rax)
jne 0x16197e
movl $0x5, %edi
leaq 0x120e93(%rip), %rsi    # 0x282800
callq 0x162900
movl $0x1, -0xc(%rbp)
jmp 0x161a1c
leaq 0x120e6b(%rip), %rax    # 0x2827f0
cmpl $0x1, (%rax)
jne 0x1619a4
movl $0x6, %edi
leaq 0x120e6a(%rip), %rsi    # 0x282800
callq 0x162900
movl $0x2, -0xc(%rbp)
jmp 0x161a1a
leaq 0x120e45(%rip), %rax    # 0x2827f0
cmpl $0x2, (%rax)
jne 0x1619ca
movl $0x7, %edi
leaq 0x120e44(%rip), %rsi    # 0x282800
callq 0x162900
movl $0x4, -0xc(%rbp)
jmp 0x161a18
leaq 0x120e1f(%rip), %rax    # 0x2827f0
cmpl $0x3, (%rax)
jne 0x1619f0
movl $0x8, %edi
leaq 0x120e1e(%rip), %rsi    # 0x282800
callq 0x162900
movl $0x8, -0xc(%rbp)
jmp 0x161a16
leaq 0x120df9(%rip), %rax    # 0x2827f0
cmpl $0x9, (%rax)
jne 0x161a14
movl $0x9, %edi
leaq 0x120df8(%rip), %rsi    # 0x282800
callq 0x162900
movl $0x10, -0xc(%rbp)
jmp 0x161a16
jmp 0x161a18
jmp 0x161a1a
jmp 0x161a1c
jmp 0x161a1e
movl -0x8(%rbp), %esi
leaq 0x120dd8(%rip), %rdi    # 0x282800
movl $0x4f, %edx
movl $0x9, %r8d
movl %r8d, %ecx
callq 0x163b40
leaq 0x120db6(%rip), %rax    # 0x2827f8
movl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x161a62
movl -0xc(%rbp), %edx
leaq 0x120da8(%rip), %rdi    # 0x282800
movl $0x9, %esi
callq 0x165080
jmp 0x161a64
leaq 0x13a2ad(%rip), %rax    # 0x29bd18
cmpq $0x0, (%rax)
je 0x161b20
leaq 0x13a2ec(%rip), %rax    # 0x29bd68
cmpq $0x0, (%rax)
je 0x161b20
leaq 0x115f0b(%rip), %rax    # 0x277998
movl (%rax), %eax
subl $0x0, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addl $0x0, %eax
movl %eax, -0x8(%rbp)
leaq 0x115eeb(%rip), %rax    # 0x277998
movl (%rax), %ecx
subl -0x8(%rbp), %ecx
leaq 0x115ee7(%rip), %rax    # 0x2779a0
movl %ecx, (%rax)
leaq 0x115eda(%rip), %rax    # 0x27799c
movl %ecx, (%rax)
leaq 0x115ed9(%rip), %rax    # 0x2779a4
cmpl $0x0, (%rax)
je 0x161af6
leaq 0x115ecd(%rip), %rax    # 0x2779a4
movl (%rax), %eax
leaq 0x115ebc(%rip), %rcx    # 0x27799c
cmpl (%rcx), %eax
jge 0x161af6
leaq 0x115eb9(%rip), %rax    # 0x2779a4
movl (%rax), %ecx
leaq 0x115ea8(%rip), %rax    # 0x27799c
movl %ecx, (%rax)
leaq 0x115e9f(%rip), %rax    # 0x27799c
movl (%rax), %ecx
andl $-0x2, %ecx
leaq 0x115e93(%rip), %rax    # 0x27799c
movl %ecx, (%rax)
leaq 0x115e8e(%rip), %rax    # 0x2779a0
movl (%rax), %ecx
andl $-0x2, %ecx
leaq 0x115e82(%rip), %rax    # 0x2779a0
movl %ecx, (%rax)
leaq 0x13a241(%rip), %rax    # 0x29bd68
cmpq $0x0, (%rax)
je 0x161c4f
leaq 0x118a70(%rip), %rax    # 0x27a5a8
cmpb $0x0, (%rax)
je 0x161c07
leaq 0x120ca8(%rip), %rax    # 0x2827f0
cmpl $0x0, (%rax)
jne 0x161b67
xorl %edi, %edi
leaq 0x121302(%rip), %rsi    # 0x282e58
callq 0x162900
movl $0x1, -0xc(%rbp)
jmp 0x161c05
leaq 0x120c82(%rip), %rax    # 0x2827f0
cmpl $0x1, (%rax)
jne 0x161b8d
movl $0x1, %edi
leaq 0x1212d9(%rip), %rsi    # 0x282e58
callq 0x162900
movl $0x2, -0xc(%rbp)
jmp 0x161c03
leaq 0x120c5c(%rip), %rax    # 0x2827f0
cmpl $0x2, (%rax)
jne 0x161bb3
movl $0x2, %edi
leaq 0x1212b3(%rip), %rsi    # 0x282e58
callq 0x162900
movl $0x4, -0xc(%rbp)
jmp 0x161c01
leaq 0x120c36(%rip), %rax    # 0x2827f0
cmpl $0x3, (%rax)
jne 0x161bd9
movl $0x3, %edi
leaq 0x12128d(%rip), %rsi    # 0x282e58
callq 0x162900
movl $0x8, -0xc(%rbp)
jmp 0x161bff
leaq 0x120c10(%rip), %rax    # 0x2827f0
cmpl $0x9, (%rax)
jne 0x161bfd
movl $0x4, %edi
leaq 0x121267(%rip), %rsi    # 0x282e58
callq 0x162900
movl $0x10, -0xc(%rbp)
jmp 0x161bff
jmp 0x161c01
jmp 0x161c03
jmp 0x161c05
jmp 0x161c07
movl -0x8(%rbp), %esi
leaq 0x121247(%rip), %rdi    # 0x282e58
movl $0x4f, %edx
movl $0x6, %ecx
movl $0xa, %r8d
callq 0x163b40
leaq 0x120bcb(%rip), %rax    # 0x2827f8
movl (%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x161c4d
movl -0xc(%rbp), %edx
leaq 0x121215(%rip), %rdi    # 0x282e58
movl $0x6, %esi
callq 0x165080
jmp 0x161c4f
jmp 0x161c51
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)