// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: update_adev_display(int, int)
void update_adev_display(int type, int force)
{
int bin_count;
u08 new_adev_info;
u08 need_new_plot;

   // redraw the adev displays if it is time to do so
   if(adevs_active(1) == 0) return;

// if(type == A_MTIE) type = OSC_ADEV;

   new_adev_info = 0;
   need_new_plot = 0;

   if(osc_adev_q_count && (++osc_adev_disp >= ADEV_DISPLAY_RATE)) {
      osc_adev_disp = 0;
      bin_count = fetch_adev_info(type+NUM_ADEV_TYPES*0, &osc_bins);

      if(bin_count > last_osc_bin_count) {  // force redraw whenever a new bin fills
         need_new_plot |= 0x02;
         last_osc_bin_count = bin_count;
      }
      new_adev_info |= 0x02;
   }

   if(pps_adev_q_count && (++pps_adev_disp >= ADEV_DISPLAY_RATE)) {
      pps_adev_disp = 0;
      if(all_adevs) new_adev_info = 1;

      bin_count = fetch_adev_info(type+NUM_ADEV_TYPES*1, &pps_bins);

      if(bin_count > last_pps_bin_count) {  // force redraw whenever a new bin fills
         need_new_plot |= 0x01;
         last_pps_bin_count = bin_count;
      }
      new_adev_info |= 0x01;
   }


   if(chc_adev_q_count && (++chc_adev_disp >= ADEV_DISPLAY_RATE)) {   // aaabbb what about chc
      chc_adev_disp = 0;
      bin_count = fetch_adev_info(type+NUM_ADEV_TYPES*2, &chc_bins);

      if(bin_count > last_chc_bin_count) {  // force redraw whenever a new bin fills
         need_new_plot |= 0x04;
         last_chc_bin_count = bin_count;
      }
      new_adev_info |= 0x04;
   }


   if(chd_adev_q_count && (++chd_adev_disp >= ADEV_DISPLAY_RATE)) {   // aaabbb what about chc
      chd_adev_disp = 0;
      bin_count = fetch_adev_info(type+NUM_ADEV_TYPES*3, &chd_bins);

      if(bin_count > last_chd_bin_count) {  // force redraw whenever a new bin fills
         need_new_plot |= 0x08;
         last_chd_bin_count = bin_count;
      }
      new_adev_info |= 0x08;
   }

   if(need_new_plot || force) {
      draw_plot(NO_REFRESH);
   }

   if(new_adev_info || force || adev_freshened) { 
      if(force || (continuous_scroll == 0)) {
         show_adev_info(5);      // aaaahhhh
      }
      adev_freshened = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
movl $0x1, %edi
callq 0xd84d7
testl %eax, %eax
je 0x103826
leaq 0x1394f9(%rip), %rax    # 0x23cb88
cmpq $0x0, (%rax)
je 0x1036d7
leaq 0x139504(%rip), %rax    # 0x23cba0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x1036d7
movl $0x0, (%rax)
movzbl %r14b, %edi
leaq 0x1205bf(%rip), %rsi    # 0x223c78
callq 0x100c0d
leaq 0x1394df(%rip), %rcx    # 0x23cba4
cmpl (%rcx), %eax
jle 0x103835
movl %eax, (%rcx)
movb $0x2, %r15b
movb $0x2, %r12b
jmp 0x1036dd
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x139454(%rip), %rax    # 0x23cb38
cmpq $0x0, (%rax)
je 0x103746
leaq 0x13945f(%rip), %rax    # 0x23cb50
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103746
movl $0x0, (%rax)
leaq 0x139634(%rip), %rax    # 0x23cd3e
movb (%rax), %r13b
orb $0x1, %r15b
leal 0x5(%r14), %eax
movzbl %al, %edi
leaq 0x11ff01(%rip), %rsi    # 0x223620
callq 0x100c0d
leaq 0x139429(%rip), %rcx    # 0x23cb54
cmpl (%rcx), %eax
jle 0x103735
orb $0x1, %r12b
movl %eax, (%rcx)
testb %r13b, %r13b
movzbl %r15b, %eax
movl $0x1, %r15d
cmovel %eax, %r15d
leaq 0x13948b(%rip), %rax    # 0x23cbd8
cmpq $0x0, (%rax)
je 0x103794
leaq 0x139496(%rip), %rax    # 0x23cbf0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103794
movl $0x0, (%rax)
leal 0xa(%r14), %eax
movzbl %al, %edi
leaq 0x120b56(%rip), %rsi    # 0x2242d0
callq 0x100c0d
leaq 0x13946e(%rip), %rcx    # 0x23cbf4
cmpl (%rcx), %eax
jle 0x103790
orb $0x4, %r12b
movl %eax, (%rcx)
orb $0x4, %r15b
leaq 0x13948d(%rip), %rax    # 0x23cc28
cmpq $0x0, (%rax)
je 0x1037e4
leaq 0x139490(%rip), %rax    # 0x23cc38
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x1037e4
movl $0x0, (%rax)
addb $0xf, %r14b
movzbl %r14b, %edi
leaq 0x12115f(%rip), %rsi    # 0x224928
callq 0x100c0d
leaq 0x139473(%rip), %rcx    # 0x23cc48
movb $0x1, %r15b
cmpl (%rcx), %eax
jle 0x1037e4
movl %eax, (%rcx)
movb $0x1, %r15b
movb $0x1, %r12b
testl %ebx, %ebx
jne 0x1037ed
testb %r12b, %r12b
je 0x1037f4
xorl %edi, %edi
callq 0x19792
leaq 0x13947d(%rip), %r14    # 0x23cc78
testl %ebx, %ebx
jne 0x10380a
testb %r15b, %r15b
jne 0x10380a
cmpl $0x0, (%r14)
je 0x103826
testl %ebx, %ebx
jne 0x10381a
leaq 0x117bb3(%rip), %rax    # 0x21b3c8
cmpb $0x0, (%rax)
jne 0x10381f
callq 0xfff83
movl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x2, %r15b
jmp 0x1036da