// File: /workspace/github_cpp_makefile_star2_O2/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 0x15fe07(%rip), %rax    # 0x226ae8
movabsq $-0x3a0bce1f051928df, %rcx # imm = 0xC5F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x15fdfb(%rip), %rax    # 0x226af0
movabsq $0x45f431e0fae6d721, %rcx # imm = 0x45F431E0FAE6D721
movq %rcx, (%rax)
leaq 0x160035(%rip), %rbx    # 0x226d3e
movzbl (%rbx), %eax
cmpl $0x5, %eax
je 0xc6ed7
cmpl $0x2, %eax
je 0xc6d80
testl %eax, %eax
jne 0xc6dd5
leaq 0x1468e7(%rip), %rax    # 0x20d610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xc6ed2
leaq 0x4e2d4(%rip), %rcx     # 0x115010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1468cc(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x1, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc6d6a
leaq 0x149b8d(%rip), %rdi    # 0x2108f0
callq 0xeced2
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6ed2
leaq 0x153655(%rip), %rdi    # 0x21a3d0
jmp 0xc707c
leaq 0x146891(%rip), %r14    # 0x20d618
movl (%r14), %eax
testb $0x1, %al
je 0xc6d9d
leaq 0x149b5b(%rip), %rdi    # 0x2108f0
callq 0xeced2
movl (%r14), %eax
testb $0x2, %al
je 0xc6db0
leaq 0x14b168(%rip), %rdi    # 0x211f10
callq 0xeced2
movl (%r14), %eax
testb $0x4, %al
je 0xc6dc3
leaq 0x14c775(%rip), %rdi    # 0x213530
callq 0xeced2
movl (%r14), %eax
testb $0x8, %al
je 0xc6dd3
leaq 0x14dd82(%rip), %rdi    # 0x214b50
callq 0xeced2
movb (%rbx), %al
cmpb $0x1, %al
jne 0xc6e2c
leaq 0x146838(%rip), %r14    # 0x20d618
movl (%r14), %eax
testb $0x1, %al
je 0xc6df6
leaq 0x1535e2(%rip), %rdi    # 0x21a3d0
callq 0xeced2
movl (%r14), %eax
testb $0x2, %al
je 0xc6e09
leaq 0x14f36f(%rip), %rdi    # 0x216170
callq 0xeced2
movl (%r14), %eax
testb $0x4, %al
je 0xc6e1c
leaq 0x15097c(%rip), %rdi    # 0x217790
callq 0xeced2
movl (%r14), %eax
testb $0x8, %al
je 0xc6e2c
leaq 0x151f89(%rip), %rdi    # 0x218db0
callq 0xeced2
movb (%rbx), %al
cmpb $0x3, %al
jne 0xc6e87
leaq 0x1467df(%rip), %r14    # 0x20d618
movl (%r14), %eax
testb $0x1, %al
je 0xc6e4f
leaq 0x154ba9(%rip), %rdi    # 0x21b9f0
callq 0xeced2
movl (%r14), %eax
testb $0x2, %al
je 0xc6e62
leaq 0x1561b6(%rip), %rdi    # 0x21d010
callq 0xeced2
movl (%r14), %eax
testb $0x4, %al
je 0xc6e75
leaq 0x1577c3(%rip), %rdi    # 0x21e630
callq 0xeced2
movl (%r14), %eax
testb $0x8, %al
je 0xc6e85
leaq 0x158dd0(%rip), %rdi    # 0x21fc50
callq 0xeced2
movb (%rbx), %al
cmpb $0x4, %al
jne 0xc6ed2
leaq 0x146786(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x1, %al
je 0xc6ea6
leaq 0x15a3d1(%rip), %rdi    # 0x221270
callq 0xeced2
movl (%rbx), %eax
testb $0x2, %al
je 0xc6eb8
leaq 0x15b9df(%rip), %rdi    # 0x222890
callq 0xeced2
movl (%rbx), %eax
testb $0x4, %al
je 0xc6eca
leaq 0x15cfed(%rip), %rdi    # 0x223eb0
callq 0xeced2
movl (%rbx), %eax
testb $0x8, %al
jne 0xc7075
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x146732(%rip), %rax    # 0x20d610
movl (%rax), %eax
cmpq $0x9, %rax
ja 0xc6ed2
leaq 0x4e0fb(%rip), %rcx     # 0x114fe8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14671b(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x1, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc6f17
leaq 0x1499e0(%rip), %rdi    # 0x2108f0
callq 0xeced2
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6f2b
leaq 0x1534ac(%rip), %rdi    # 0x21a3d0
callq 0xeced2
movl (%rbx), %eax
btl $0xa, %eax
jae 0xc6f3f
leaq 0x154ab8(%rip), %rdi    # 0x21b9f0
callq 0xeced2
movl (%rbx), %eax
btl $0xb, %eax
jae 0xc6ed2
leaq 0x15a324(%rip), %rdi    # 0x221270
jmp 0xc707c
leaq 0x1466c0(%rip), %rax    # 0x20d618
testb $0x4, (%rax)
je 0xc6ed2
leaq 0x14c5c8(%rip), %rdi    # 0x213530
callq 0xeced2
leaq 0x15081c(%rip), %rdi    # 0x217790
callq 0xeced2
leaq 0x1576b0(%rip), %rdi    # 0x21e630
callq 0xeced2
leaq 0x15cf24(%rip), %rdi    # 0x223eb0
jmp 0xc707c
leaq 0x146680(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x4, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc6fb6
leaq 0x14c581(%rip), %rdi    # 0x213530
callq 0xeced2
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6ed2
leaq 0x1507c9(%rip), %rdi    # 0x217790
jmp 0xc707c
leaq 0x146645(%rip), %rax    # 0x20d618
testb $0x2, (%rax)
je 0xc6ed2
leaq 0x14af2d(%rip), %rdi    # 0x211f10
callq 0xeced2
leaq 0x14f181(%rip), %rdi    # 0x216170
callq 0xeced2
leaq 0x156015(%rip), %rdi    # 0x21d010
callq 0xeced2
leaq 0x15b889(%rip), %rdi    # 0x222890
jmp 0xc707c
leaq 0x146608(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x2, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc702e
leaq 0x14aee9(%rip), %rdi    # 0x211f10
callq 0xeced2
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6ed2
leaq 0x14f131(%rip), %rdi    # 0x216170
jmp 0xc707c
leaq 0x1465d0(%rip), %rax    # 0x20d618
testb $0x8, (%rax)
je 0xc6ed2
leaq 0x14daf8(%rip), %rdi    # 0x214b50
callq 0xeced2
leaq 0x151d4c(%rip), %rdi    # 0x218db0
callq 0xeced2
leaq 0x158be0(%rip), %rdi    # 0x21fc50
callq 0xeced2
leaq 0x15e454(%rip), %rdi    # 0x2254d0
popq %rbx
popq %r14
popq %rbp
jmp 0xeced2
leaq 0x14658c(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x10, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc70a5
xorl %edi, %edi
callq 0xe8852
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc70b5
pushq $0x1
popq %rdi
callq 0xe8852
movl (%rbx), %eax
btl $0xa, %eax
jae 0xc70c5
pushq $0x2
popq %rdi
callq 0xe8852
movl (%rbx), %eax
btl $0xb, %eax
jae 0xc6ed2
pushq $0x3
jmp 0xc713a
leaq 0x14653e(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x8, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc70f8
leaq 0x14da5f(%rip), %rdi    # 0x214b50
callq 0xeced2
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6ed2
leaq 0x151ca7(%rip), %rdi    # 0x218db0
jmp 0xc707c
leaq 0x146503(%rip), %rbx    # 0x20d618
movl (%rbx), %eax
testb $0x10, %al
je 0xc6ed2
btl $0x8, %eax
jae 0xc712e
xorl %edi, %edi
callq 0xe8852
movl (%rbx), %eax
btl $0x9, %eax
jae 0xc6ed2
pushq $0x1
popq %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xe8852