// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: find_global_max()
void find_global_max()
{
   // find the min and max adev values in all the displayed xDEV bins

   global_adev_max = (-(BIG_NUM));
   global_adev_min = (BIG_NUM);

   if(all_adevs == SINGLE_ADEVS) {  // main screen adev display of PPS/chA and OSC/chB values
      if(ATYPE == OSC_ADEV) {
         if(adev_display_mask & DISPLAY_ADEV) {
            if(adev_display_mask & DISPLAY_CHA) scan_bins(&pps_adev_bins[0]);
            if(adev_display_mask & DISPLAY_CHB) scan_bins(&osc_adev_bins[0]);
         }
      }
      else if(ATYPE == OSC_HDEV) {
         if(adev_display_mask & DISPLAY_HDEV) {
            if(adev_display_mask & DISPLAY_CHA) scan_bins(&pps_hdev_bins[0]);
            if(adev_display_mask & DISPLAY_CHB) scan_bins(&osc_hdev_bins[0]);
         }
      }
      else if(ATYPE == OSC_MDEV) {
         if(adev_display_mask & DISPLAY_MDEV) {
            if(adev_display_mask & DISPLAY_CHA) scan_bins(&pps_mdev_bins[0]);
            if(adev_display_mask & DISPLAY_CHB) scan_bins(&osc_mdev_bins[0]);
         }
      }
      else if(ATYPE == OSC_TDEV) {
         if(adev_display_mask & DISPLAY_TDEV) {
            if(adev_display_mask & DISPLAY_CHA) scan_bins(&pps_tdev_bins[0]);
            if(adev_display_mask & DISPLAY_CHB) scan_bins(&osc_tdev_bins[0]);
         }
      }
      else if(ATYPE == A_MTIE) { 
         if(adev_display_mask & DISPLAY_MTIE) {
            if(adev_display_mask & DISPLAY_CHA) scan_mtie_bins(CHA_MTIE);
            if(adev_display_mask & DISPLAY_CHB) scan_mtie_bins(CHB_MTIE);
         }
      }
   }
   else if(all_adevs == ALL_CHANS) {  // show selected adev type for all channels
      if(ATYPE == OSC_ADEV) {
         if(adev_display_mask & DISPLAY_ADEV) {
            if(adev_display_mask & DISPLAY_CHA) scan_bins(&pps_adev_bins[0]);
            if(adev_display_mask & DISPLAY_CHB) scan_bins(&osc_adev_bins[0]);
            if(adev_display_mask & DISPLAY_CHC) scan_bins(&chc_adev_bins[0]);
            if(adev_display_mask & DISPLAY_CHD) scan_bins(&chd_adev_bins[0]);
         }
      }
      else if(ATYPE == OSC_HDEV) {
         if(adev_display_mask & DISPLAY_HDEV) {
            scan_bins(&pps_hdev_bins[0]);
            scan_bins(&osc_hdev_bins[0]);
            scan_bins(&chc_hdev_bins[0]);
            scan_bins(&chd_hdev_bins[0]);
         }
      }
      else if(ATYPE == OSC_MDEV) {
         if(adev_display_mask & DISPLAY_MDEV) {
            scan_bins(&pps_mdev_bins[0]);
            scan_bins(&osc_mdev_bins[0]);
            scan_bins(&chc_mdev_bins[0]);
            scan_bins(&chd_mdev_bins[0]);
         }
      }
      else if(ATYPE == OSC_TDEV) {
         if(adev_display_mask & DISPLAY_TDEV) {
            scan_bins(&pps_tdev_bins[0]);
            scan_bins(&osc_tdev_bins[0]);
            scan_bins(&chc_tdev_bins[0]);
            scan_bins(&chd_tdev_bins[0]);
         }
      }
      else if(ATYPE == A_MTIE) {
         if(adev_display_mask & DISPLAY_MTIE) {
            if(adev_display_mask & DISPLAY_CHA) scan_mtie_bins(CHA_MTIE);
            if(adev_display_mask & DISPLAY_CHB) scan_mtie_bins(CHB_MTIE);
            if(adev_display_mask & DISPLAY_CHC) scan_mtie_bins(CHC_MTIE);
            if(adev_display_mask & DISPLAY_CHD) scan_mtie_bins(CHD_MTIE);
         }
      }
   }
   else {  // show all adev types for the selected channel
      if(all_adevs == ALL_PPS) {
         if(adev_display_mask & DISPLAY_ADEV) scan_bins(&pps_adev_bins[0]);
         if(adev_display_mask & DISPLAY_HDEV) scan_bins(&pps_hdev_bins[0]);
         if(adev_display_mask & DISPLAY_MDEV) scan_bins(&pps_mdev_bins[0]);
         if(adev_display_mask & DISPLAY_TDEV) scan_bins(&pps_tdev_bins[0]);
      }

      if(all_adevs == ALL_OSC) {
         if(adev_display_mask & DISPLAY_ADEV) scan_bins(&osc_adev_bins[0]);
         if(adev_display_mask & DISPLAY_HDEV) scan_bins(&osc_hdev_bins[0]);
         if(adev_display_mask & DISPLAY_MDEV) scan_bins(&osc_mdev_bins[0]);
         if(adev_display_mask & DISPLAY_TDEV) scan_bins(&osc_tdev_bins[0]);
      }

      if(all_adevs == ALL_CHC) {
         if(adev_display_mask & DISPLAY_ADEV) scan_bins(&chc_adev_bins[0]);
         if(adev_display_mask & DISPLAY_HDEV) scan_bins(&chc_hdev_bins[0]);
         if(adev_display_mask & DISPLAY_MDEV) scan_bins(&chc_mdev_bins[0]);
         if(adev_display_mask & DISPLAY_TDEV) scan_bins(&chc_tdev_bins[0]);
      }

      if(all_adevs == ALL_CHD) {
         if(adev_display_mask & DISPLAY_ADEV) scan_bins(&chd_adev_bins[0]);
         if(adev_display_mask & DISPLAY_HDEV) scan_bins(&chd_hdev_bins[0]);
         if(adev_display_mask & DISPLAY_MDEV) scan_bins(&chd_mdev_bins[0]);
         if(adev_display_mask & DISPLAY_TDEV) scan_bins(&chd_tdev_bins[0]);
      }
   }
//if(global_adev_min) {
//   sprintf(debug_text, "gamax:%g  gamin:%g  gdecades:%g", 
//adev_decade(global_adev_max),adev_decade(global_adev_min),adev_decade(global_adev_max)/adev_decade(global_adev_min));
//}
///global_adev_max = 1.0E-7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1643af(%rip), %rax    # 0x23cae8
movabsq $-0x3a0bce1f051928df, %rcx # imm = 0xC5F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x1643a3(%rip), %rax    # 0x23caf0
movabsq $0x45f431e0fae6d721, %rcx # imm = 0x45F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x1645dd(%rip), %rbx    # 0x23cd3e
movzbl (%rbx), %eax
cmpl $0x5, %eax
je 0xd892f
cmpl $0x2, %eax
je 0xd87d8
testl %eax, %eax
jne 0xd882d
leaq 0x14ae8f(%rip), %rax    # 0x223610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xd892a
leaq 0x5293c(%rip), %rcx     # 0x12b0d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14ae74(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x1, %al
je 0xd892a
btl $0x8, %eax
jae 0xd87c2
leaq 0x14e135(%rip), %rdi    # 0x2268f0
callq 0x1033c0
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd892a
leaq 0x157bfd(%rip), %rdi    # 0x2303d0
jmp 0xd8ad4
leaq 0x14ae39(%rip), %r14    # 0x223618
movl (%r14), %eax
testb $0x1, %al
je 0xd87f5
leaq 0x14e103(%rip), %rdi    # 0x2268f0
callq 0x1033c0
movl (%r14), %eax
testb $0x2, %al
je 0xd8808
leaq 0x14f710(%rip), %rdi    # 0x227f10
callq 0x1033c0
movl (%r14), %eax
testb $0x4, %al
je 0xd881b
leaq 0x150d1d(%rip), %rdi    # 0x229530
callq 0x1033c0
movl (%r14), %eax
testb $0x8, %al
je 0xd882b
leaq 0x15232a(%rip), %rdi    # 0x22ab50
callq 0x1033c0
movb (%rbx), %al
cmpb $0x1, %al
jne 0xd8884
leaq 0x14ade0(%rip), %r14    # 0x223618
movl (%r14), %eax
testb $0x1, %al
je 0xd884e
leaq 0x157b8a(%rip), %rdi    # 0x2303d0
callq 0x1033c0
movl (%r14), %eax
testb $0x2, %al
je 0xd8861
leaq 0x153917(%rip), %rdi    # 0x22c170
callq 0x1033c0
movl (%r14), %eax
testb $0x4, %al
je 0xd8874
leaq 0x154f24(%rip), %rdi    # 0x22d790
callq 0x1033c0
movl (%r14), %eax
testb $0x8, %al
je 0xd8884
leaq 0x156531(%rip), %rdi    # 0x22edb0
callq 0x1033c0
movb (%rbx), %al
cmpb $0x3, %al
jne 0xd88df
leaq 0x14ad87(%rip), %r14    # 0x223618
movl (%r14), %eax
testb $0x1, %al
je 0xd88a7
leaq 0x159151(%rip), %rdi    # 0x2319f0
callq 0x1033c0
movl (%r14), %eax
testb $0x2, %al
je 0xd88ba
leaq 0x15a75e(%rip), %rdi    # 0x233010
callq 0x1033c0
movl (%r14), %eax
testb $0x4, %al
je 0xd88cd
leaq 0x15bd6b(%rip), %rdi    # 0x234630
callq 0x1033c0
movl (%r14), %eax
testb $0x8, %al
je 0xd88dd
leaq 0x15d378(%rip), %rdi    # 0x235c50
callq 0x1033c0
movb (%rbx), %al
cmpb $0x4, %al
jne 0xd892a
leaq 0x14ad2e(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x1, %al
je 0xd88fe
leaq 0x15e979(%rip), %rdi    # 0x237270
callq 0x1033c0
movl (%rbx), %eax
testb $0x2, %al
je 0xd8910
leaq 0x15ff87(%rip), %rdi    # 0x238890
callq 0x1033c0
movl (%rbx), %eax
testb $0x4, %al
je 0xd8922
leaq 0x161595(%rip), %rdi    # 0x239eb0
callq 0x1033c0
movl (%rbx), %eax
testb $0x8, %al
jne 0xd8acd
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x14acda(%rip), %rax    # 0x223610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xd892a
leaq 0x52763(%rip), %rcx     # 0x12b0a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14acc3(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x1, %al
je 0xd892a
btl $0x8, %eax
jae 0xd896f
leaq 0x14df88(%rip), %rdi    # 0x2268f0
callq 0x1033c0
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd8983
leaq 0x157a54(%rip), %rdi    # 0x2303d0
callq 0x1033c0
movl (%rbx), %eax
btl $0xa, %eax
jae 0xd8997
leaq 0x159060(%rip), %rdi    # 0x2319f0
callq 0x1033c0
movl (%rbx), %eax
btl $0xb, %eax
jae 0xd892a
leaq 0x15e8cc(%rip), %rdi    # 0x237270
jmp 0xd8ad4
leaq 0x14ac68(%rip), %rax    # 0x223618
testb $0x4, (%rax)
je 0xd892a
leaq 0x150b70(%rip), %rdi    # 0x229530
callq 0x1033c0
leaq 0x154dc4(%rip), %rdi    # 0x22d790
callq 0x1033c0
leaq 0x15bc58(%rip), %rdi    # 0x234630
callq 0x1033c0
leaq 0x1614cc(%rip), %rdi    # 0x239eb0
jmp 0xd8ad4
leaq 0x14ac28(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x4, %al
je 0xd892a
btl $0x8, %eax
jae 0xd8a0e
leaq 0x150b29(%rip), %rdi    # 0x229530
callq 0x1033c0
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd892a
leaq 0x154d71(%rip), %rdi    # 0x22d790
jmp 0xd8ad4
leaq 0x14abed(%rip), %rax    # 0x223618
testb $0x2, (%rax)
je 0xd892a
leaq 0x14f4d5(%rip), %rdi    # 0x227f10
callq 0x1033c0
leaq 0x153729(%rip), %rdi    # 0x22c170
callq 0x1033c0
leaq 0x15a5bd(%rip), %rdi    # 0x233010
callq 0x1033c0
leaq 0x15fe31(%rip), %rdi    # 0x238890
jmp 0xd8ad4
leaq 0x14abb0(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x2, %al
je 0xd892a
btl $0x8, %eax
jae 0xd8a86
leaq 0x14f491(%rip), %rdi    # 0x227f10
callq 0x1033c0
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd892a
leaq 0x1536d9(%rip), %rdi    # 0x22c170
jmp 0xd8ad4
leaq 0x14ab78(%rip), %rax    # 0x223618
testb $0x8, (%rax)
je 0xd892a
leaq 0x1520a0(%rip), %rdi    # 0x22ab50
callq 0x1033c0
leaq 0x1562f4(%rip), %rdi    # 0x22edb0
callq 0x1033c0
leaq 0x15d188(%rip), %rdi    # 0x235c50
callq 0x1033c0
leaq 0x1629fc(%rip), %rdi    # 0x23b4d0
popq %rbx
popq %r14
popq %rbp
jmp 0x1033c0
leaq 0x14ab34(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x10, %al
je 0xd892a
btl $0x8, %eax
jae 0xd8afd
xorl %edi, %edi
callq 0xfe78f
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd8b0f
movl $0x1, %edi
callq 0xfe78f
movl (%rbx), %eax
btl $0xa, %eax
jae 0xd8b21
movl $0x2, %edi
callq 0xfe78f
movl (%rbx), %eax
btl $0xb, %eax
jae 0xd892a
movl $0x3, %edi
jmp 0xd8b9c
leaq 0x14aadf(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x8, %al
je 0xd892a
btl $0x8, %eax
jae 0xd8b57
leaq 0x152000(%rip), %rdi    # 0x22ab50
callq 0x1033c0
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd892a
leaq 0x156248(%rip), %rdi    # 0x22edb0
jmp 0xd8ad4
leaq 0x14aaa4(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x10, %al
je 0xd892a
btl $0x8, %eax
jae 0xd8b8d
xorl %edi, %edi
callq 0xfe78f
movl (%rbx), %eax
btl $0x9, %eax
jae 0xd892a
movl $0x1, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xfe78f