// File: /workspace/github_cpp_makefile_star2_O1/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 0x164abc(%rip), %rax    # 0x23cae8
movabsq $-0x3a0bce1f051928df, %rcx # imm = 0xC5F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x164ab0(%rip), %rax    # 0x23caf0
movabsq $0x45f431e0fae6d721, %rcx # imm = 0x45F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x164cea(%rip), %rbx    # 0x23cd3e
movzbl (%rbx), %eax
cmpl $0x5, %eax
je 0xd820d
cmpl $0x2, %eax
je 0xd80c9
testl %eax, %eax
jne 0xd8118
leaq 0x14b59c(%rip), %rax    # 0x223610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xd8208
leaq 0x52f79(%rip), %rcx     # 0x12b000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14b581(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x1, %al
je 0xd8208
btl $0x8, %eax
jae 0xd80b3
leaq 0x14e842(%rip), %rdi    # 0x2268f0
callq 0x102d32
testb $0x2, 0x1(%rbx)
je 0xd8208
leaq 0x15830c(%rip), %rdi    # 0x2303d0
jmp 0xd83a8
leaq 0x14b548(%rip), %r14    # 0x223618
testb $0x1, (%r14)
je 0xd80e2
leaq 0x14e813(%rip), %rdi    # 0x2268f0
callq 0x102d32
testb $0x2, (%r14)
je 0xd80f4
leaq 0x14fe21(%rip), %rdi    # 0x227f10
callq 0x102d32
testb $0x4, (%r14)
je 0xd8106
leaq 0x15142f(%rip), %rdi    # 0x229530
callq 0x102d32
testb $0x8, (%r14)
je 0xd8118
leaq 0x152a3d(%rip), %rdi    # 0x22ab50
callq 0x102d32
cmpb $0x1, (%rbx)
jne 0xd816c
leaq 0x14b4f4(%rip), %r14    # 0x223618
testb $0x1, (%r14)
je 0xd8136
leaq 0x15829f(%rip), %rdi    # 0x2303d0
callq 0x102d32
testb $0x2, (%r14)
je 0xd8148
leaq 0x15402d(%rip), %rdi    # 0x22c170
callq 0x102d32
testb $0x4, (%r14)
je 0xd815a
leaq 0x15563b(%rip), %rdi    # 0x22d790
callq 0x102d32
testb $0x8, (%r14)
je 0xd816c
leaq 0x156c49(%rip), %rdi    # 0x22edb0
callq 0x102d32
cmpb $0x3, (%rbx)
jne 0xd81c0
leaq 0x14b4a0(%rip), %r14    # 0x223618
testb $0x1, (%r14)
je 0xd818a
leaq 0x15986b(%rip), %rdi    # 0x2319f0
callq 0x102d32
testb $0x2, (%r14)
je 0xd819c
leaq 0x15ae79(%rip), %rdi    # 0x233010
callq 0x102d32
testb $0x4, (%r14)
je 0xd81ae
leaq 0x15c487(%rip), %rdi    # 0x234630
callq 0x102d32
testb $0x8, (%r14)
je 0xd81c0
leaq 0x15da95(%rip), %rdi    # 0x235c50
callq 0x102d32
cmpb $0x4, (%rbx)
jne 0xd8208
leaq 0x14b44c(%rip), %rbx    # 0x223618
testb $0x1, (%rbx)
je 0xd81dd
leaq 0x15f098(%rip), %rdi    # 0x237270
callq 0x102d32
testb $0x2, (%rbx)
je 0xd81ee
leaq 0x1606a7(%rip), %rdi    # 0x238890
callq 0x102d32
testb $0x4, (%rbx)
je 0xd81ff
leaq 0x161cb6(%rip), %rdi    # 0x239eb0
callq 0x102d32
testb $0x8, (%rbx)
jne 0xd83a1
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x14b3fc(%rip), %rax    # 0x223610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xd8208
leaq 0x52db5(%rip), %rcx     # 0x12afd8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14b3e5(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x1, %al
je 0xd8208
btl $0x8, %eax
jae 0xd824b
leaq 0x14e6aa(%rip), %rdi    # 0x2268f0
callq 0x102d32
testb $0x2, 0x1(%rbx)
je 0xd825d
leaq 0x158178(%rip), %rdi    # 0x2303d0
callq 0x102d32
testb $0x4, 0x1(%rbx)
je 0xd826f
leaq 0x159786(%rip), %rdi    # 0x2319f0
callq 0x102d32
testb $0x8, 0x1(%rbx)
je 0xd8208
leaq 0x15eff4(%rip), %rdi    # 0x237270
jmp 0xd83a8
leaq 0x14b390(%rip), %rax    # 0x223618
testb $0x4, (%rax)
je 0xd8208
leaq 0x151298(%rip), %rdi    # 0x229530
callq 0x102d32
leaq 0x1554ec(%rip), %rdi    # 0x22d790
callq 0x102d32
leaq 0x15c380(%rip), %rdi    # 0x234630
callq 0x102d32
leaq 0x161bf4(%rip), %rdi    # 0x239eb0
jmp 0xd83a8
leaq 0x14b350(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x4, %al
je 0xd8208
btl $0x8, %eax
jae 0xd82e4
leaq 0x151251(%rip), %rdi    # 0x229530
callq 0x102d32
testb $0x2, 0x1(%rbx)
je 0xd8208
leaq 0x15549b(%rip), %rdi    # 0x22d790
jmp 0xd83a8
leaq 0x14b317(%rip), %rax    # 0x223618
testb $0x2, (%rax)
je 0xd8208
leaq 0x14fbff(%rip), %rdi    # 0x227f10
callq 0x102d32
leaq 0x153e53(%rip), %rdi    # 0x22c170
callq 0x102d32
leaq 0x15ace7(%rip), %rdi    # 0x233010
callq 0x102d32
leaq 0x16055b(%rip), %rdi    # 0x238890
jmp 0xd83a8
leaq 0x14b2da(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x2, %al
je 0xd8208
btl $0x8, %eax
jae 0xd835a
leaq 0x14fbbb(%rip), %rdi    # 0x227f10
callq 0x102d32
testb $0x2, 0x1(%rbx)
je 0xd8208
leaq 0x153e05(%rip), %rdi    # 0x22c170
jmp 0xd83a8
leaq 0x14b2a4(%rip), %rax    # 0x223618
testb $0x8, (%rax)
je 0xd8208
leaq 0x1527cc(%rip), %rdi    # 0x22ab50
callq 0x102d32
leaq 0x156a20(%rip), %rdi    # 0x22edb0
callq 0x102d32
leaq 0x15d8b4(%rip), %rdi    # 0x235c50
callq 0x102d32
leaq 0x163128(%rip), %rdi    # 0x23b4d0
popq %rbx
popq %r14
popq %rbp
jmp 0x102d32
leaq 0x14b260(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x10, %al
je 0xd8208
btl $0x8, %eax
jae 0xd83cf
xorl %edi, %edi
callq 0xfe0c2
testb $0x2, 0x1(%rbx)
je 0xd83df
movl $0x1, %edi
callq 0xfe0c2
testb $0x4, 0x1(%rbx)
je 0xd83ef
movl $0x2, %edi
callq 0xfe0c2
testb $0x8, 0x1(%rbx)
je 0xd8208
movl $0x3, %edi
jmp 0xd8466
leaq 0x14b211(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x8, %al
je 0xd8208
btl $0x8, %eax
jae 0xd8423
leaq 0x152732(%rip), %rdi    # 0x22ab50
callq 0x102d32
testb $0x2, 0x1(%rbx)
je 0xd8208
leaq 0x15697c(%rip), %rdi    # 0x22edb0
jmp 0xd83a8
leaq 0x14b1d8(%rip), %rbx    # 0x223618
movl (%rbx), %eax
testb $0x10, %al
je 0xd8208
btl $0x8, %eax
jae 0xd8457
xorl %edi, %edi
callq 0xfe0c2
testb $0x2, 0x1(%rbx)
je 0xd8208
movl $0x1, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xfe0c2