// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %r15
movl %r15d, %edi
callq 0xc71ad
testl %eax, %eax
je 0xed7b7
leaq 0x139569(%rip), %rax    # 0x226b88
cmpq $0x0, (%rax)
je 0xed664
leaq 0x139574(%rip), %rax    # 0x226ba0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0xed664
andl $0x0, (%rax)
movzbl %r14b, %edi
leaq 0x120632(%rip), %rsi    # 0x20dc78
callq 0xeaf45
leaq 0x139552(%rip), %rcx    # 0x226ba4
cmpl (%rcx), %eax
jle 0xed7c6
movl %eax, (%rcx)
movb $0x2, %r12b
movb $0x2, %r13b
jmp 0xed66a
xorl %r12d, %r12d
xorl %r13d, %r13d
leaq 0x1394c7(%rip), %rax    # 0x226b38
cmpq $0x0, (%rax)
je 0xed6d1
leaq 0x1394d2(%rip), %rax    # 0x226b50
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0xed6d1
movl %ebx, -0x2c(%rbp)
andl $0x0, (%rax)
leaq 0x1396a7(%rip), %rax    # 0x226d3e
movb (%rax), %bl
orb $0x1, %r12b
leal 0x5(%r14), %eax
movzbl %al, %edi
leaq 0x11ff75(%rip), %rsi    # 0x20d620
callq 0xeaf45
leaq 0x13949d(%rip), %rcx    # 0x226b54
cmpl (%rcx), %eax
jle 0xed6c1
orb $0x1, %r13b
movl %eax, (%rcx)
testb %bl, %bl
movzbl %r12b, %eax
cmovel %eax, %r15d
movl %r15d, %r12d
movl -0x2c(%rbp), %ebx
leaq 0x139500(%rip), %rax    # 0x226bd8
cmpq $0x0, (%rax)
je 0xed71c
leaq 0x13950b(%rip), %rax    # 0x226bf0
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0xed71c
andl $0x0, (%rax)
leal 0xa(%r14), %eax
movzbl %al, %edi
leaq 0x120bce(%rip), %rsi    # 0x20e2d0
callq 0xeaf45
leaq 0x1394e6(%rip), %rcx    # 0x226bf4
cmpl (%rcx), %eax
jle 0xed718
orb $0x4, %r13b
movl %eax, (%rcx)
orb $0x4, %r12b
leaq 0x139505(%rip), %rax    # 0x226c28
cmpq $0x0, (%rax)
je 0xed76d
leaq 0x139508(%rip), %rax    # 0x226c38
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl $0x9, %ecx
jl 0xed76d
andl $0x0, (%rax)
addb $0xf, %r14b
movzbl %r14b, %edi
leaq 0x1211da(%rip), %rsi    # 0x20e928
callq 0xeaf45
leaq 0x1394ee(%rip), %rcx    # 0x226c48
movb $0x1, %r12b
cmpl (%rcx), %eax
jle 0xed76d
movl %eax, (%rcx)
testl %ebx, %ebx
setne %bl
movb $0x1, %r12b
jmp 0xed77d
testl %ebx, %ebx
setne %bl
jne 0xed77d
testb %r13b, %r13b
jne 0xed77d
xorl %ebx, %ebx
jmp 0xed784
xorl %edi, %edi
callq 0x18cb0
leaq 0x1394ed(%rip), %r14    # 0x226c78
testb %bl, %bl
jne 0xed79a
testb %r12b, %r12b
jne 0xed79a
cmpl $0x0, (%r14)
je 0xed7b7
leaq 0x117c27(%rip), %rax    # 0x2053c8
cmpb $0x0, (%rax)
sete %al
orb %al, %bl
cmpb $0x1, %bl
jne 0xed7b3
callq 0xea4e4
andl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x2, %r12b
jmp 0xed667