// File: /workspace/github_cpp_makefile_star2_O3/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 0xd8c0d
testl %eax, %eax
je 0x103edd
leaq 0x138e51(%rip), %rax    # 0x23cb88
cmpq $0x0, (%rax)
je 0x103d7f
leaq 0x138e5c(%rip), %rax    # 0x23cba0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103d7f
movl $0x0, (%rax)
movzbl %r14b, %edi
leaq 0x11ff17(%rip), %rsi    # 0x223c78
callq 0x10128d
leaq 0x138e37(%rip), %rcx    # 0x23cba4
cmpl (%rcx), %eax
jle 0x103eec
movl %eax, (%rcx)
movb $0x2, %r15b
movb $0x2, %r12b
jmp 0x103d85
xorl %r15d, %r15d
xorl %r12d, %r12d
leaq 0x138dac(%rip), %rax    # 0x23cb38
cmpq $0x0, (%rax)
je 0x103dee
leaq 0x138db7(%rip), %rax    # 0x23cb50
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103dee
movl $0x0, (%rax)
leaq 0x138f8c(%rip), %rax    # 0x23cd3e
movb (%rax), %r13b
orb $0x1, %r15b
leal 0x5(%r14), %eax
movzbl %al, %edi
leaq 0x11f859(%rip), %rsi    # 0x223620
callq 0x10128d
leaq 0x138d81(%rip), %rcx    # 0x23cb54
cmpl (%rcx), %eax
jle 0x103ddd
orb $0x1, %r12b
movl %eax, (%rcx)
testb %r13b, %r13b
movzbl %r15b, %eax
movl $0x1, %r15d
cmovel %eax, %r15d
leaq 0x138de3(%rip), %rax    # 0x23cbd8
cmpq $0x0, (%rax)
je 0x103e3c
leaq 0x138dee(%rip), %rax    # 0x23cbf0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103e3c
movl $0x0, (%rax)
leal 0xa(%r14), %eax
movzbl %al, %edi
leaq 0x1204ae(%rip), %rsi    # 0x2242d0
callq 0x10128d
leaq 0x138dc6(%rip), %rcx    # 0x23cbf4
cmpl (%rcx), %eax
jle 0x103e38
orb $0x4, %r12b
movl %eax, (%rcx)
orb $0x4, %r15b
leaq 0x138de5(%rip), %rax    # 0x23cc28
cmpq $0x0, (%rax)
je 0x103e90
leaq 0x138de8(%rip), %rax    # 0x23cc38
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0x103e90
movl $0x0, (%rax)
addb $0xf, %r14b
movzbl %r14b, %edi
leaq 0x120ab7(%rip), %rsi    # 0x224928
callq 0x10128d
leaq 0x138dcb(%rip), %rcx    # 0x23cc48
movb $0x1, %r15b
cmpl (%rcx), %eax
jle 0x103e90
movl %eax, (%rcx)
testl %ebx, %ebx
setne %bl
movb $0x1, %r15b
jmp 0x103ea0
testl %ebx, %ebx
setne %bl
jne 0x103ea0
testb %r12b, %r12b
jne 0x103ea0
xorl %ebx, %ebx
jmp 0x103ea7
xorl %edi, %edi
callq 0x197ae
leaq 0x138dca(%rip), %r14    # 0x23cc78
testb %bl, %bl
jne 0x103ebd
testb %r15b, %r15b
jne 0x103ebd
cmpl $0x0, (%r14)
je 0x103edd
leaq 0x117504(%rip), %rax    # 0x21b3c8
cmpb $0x0, (%rax)
sete %al
orb %al, %bl
cmpb $0x1, %bl
jne 0x103ed6
callq 0x100623
movl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x2, %r15b
jmp 0x103d82