// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: adevs_active(int)
int adevs_active(int check_enable)
{
int i;
static int last_ticc_i = 0;

   // NEW_RCVR

   // return true if we might have adevs to display
   //   0x01 : pps_offset available
   //   0x02 : osc_offset available
   //   0x04 : TICC channel C available
   //   0x08 : TICC channel D available
   //   0x80 : flags that bits 0x01 and 0x02 are guessed

   if(no_adev_flag) return 0;

   if(check_enable) {
      if     (pps_adev_period > 0.0) ;        // aaaallll
      else if(osc_adev_period > 0.0) ;
      else if(chc_adev_period > 0.0) ;
      else if(chd_adev_period > 0.0) ;
      else if(adev_period <= 0.0) {
         return 0;
      }
   }

   if(jitter_adev) return 0x03;

   i = 0;
   if(rcvr_type == TICC_RCVR) {
      if(have_pps_offset) i |= 0x01;
      if(have_osc_offset) i |= 0x02;
      if(have_chc_offset) i |= 0x04;
      if(have_chd_offset) i |= 0x08;
      if(mtie_q_count[CHA_MTIE]) i |= 0x01;
      if(mtie_q_count[CHB_MTIE]) i |= 0x02;
      if(mtie_q_count[CHC_MTIE]) i |= 0x04;
      if(mtie_q_count[CHD_MTIE]) i |= 0x08;
      if(sim_file && (i == 0)) return last_ticc_i;
      last_ticc_i = i;
      return i;
   }
   else if(TICC_USED) {
      if(ticc_mode == 'I') return 0x01;   // time interval
      if(ticc_mode == 'F') return 0x01;   // frequency counter
      return 0x03;   // aaaacccc
   }
   else {
      if(luxor) return 0;
      if(NO_ADEV_INFO) return 0;
   }

   if(rcvr_type == PRS_RCVR) ;   // SRO_RCVR?  LPFRS_RCVR  SA35_RCVR?
   else if(GPSDO) ;
   else if(!TIMING_RCVR) return 0;
///   else if(TIMING_RCVR) return 0;

   if(rcvr_type == BRANDY_RCVR) {
      if(have_pps_offset) return 0x01;
      else                return 0x01;
   }

   if(have_pps_offset && have_osc_offset) return 0x03;
   else if(have_pps_offset) return 0x01;
   else if(have_osc_offset) return 0x02;

   return 0x83;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
leaq 0x174182(%rip), %rax    # 0x29bf14
cmpl $0x0, (%rax)
je 0x127da3
movl $0x0, -0x4(%rbp)
jmp 0x12825c
cmpl $0x0, -0x8(%rbp)
je 0x127e27
leaq 0x174130(%rip), %rax    # 0x29bee0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x127dbf
jmp 0x127e25
leaq 0x174122(%rip), %rax    # 0x29bee8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x127dd5
jmp 0x127e23
leaq 0x174114(%rip), %rax    # 0x29bef0
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x127deb
jmp 0x127e21
leaq 0x174106(%rip), %rax    # 0x29bef8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x127e01
jmp 0x127e1f
xorps %xmm0, %xmm0
leaq 0x1740cd(%rip), %rax    # 0x29bed8
ucomisd (%rax), %xmm0
jb 0x127e1d
movl $0x0, -0x4(%rbp)
jmp 0x12825c
jmp 0x127e1f
jmp 0x127e21
jmp 0x127e23
jmp 0x127e25
jmp 0x127e27
leaq 0x174076(%rip), %rax    # 0x29bea4
cmpl $0x0, (%rax)
je 0x127e3f
movl $0x3, -0x4(%rbp)
jmp 0x12825c
movl $0x0, -0xc(%rbp)
leaq 0x14fc63(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
jne 0x127f2b
leaq 0x2445b7(%rip), %rax    # 0x36c418
cmpl $0x0, (%rax)
je 0x127e6f
movl -0xc(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xc(%rbp)
leaq 0x24459e(%rip), %rax    # 0x36c414
cmpl $0x0, (%rax)
je 0x127e84
movl -0xc(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xc(%rbp)
leaq 0x244591(%rip), %rax    # 0x36c41c
cmpl $0x0, (%rax)
je 0x127e99
movl -0xc(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xc(%rbp)
leaq 0x244580(%rip), %rax    # 0x36c420
cmpl $0x0, (%rax)
je 0x127eae
movl -0xc(%rbp), %eax
orl $0x8, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x38c44b(%rip)    # 0x4b4300
je 0x127ec0
movl -0xc(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x38c43d(%rip)    # 0x4b4304
je 0x127ed2
movl -0xc(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x38c42f(%rip)    # 0x4b4308
je 0x127ee4
movl -0xc(%rbp), %eax
orl $0x4, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x38c421(%rip)    # 0x4b430c
je 0x127ef6
movl -0xc(%rbp), %eax
orl $0x8, %eax
movl %eax, -0xc(%rbp)
leaq 0x1756a3(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0x127f17
cmpl $0x0, -0xc(%rbp)
jne 0x127f17
movl 0x38cae1(%rip), %eax    # 0x4b49f0
movl %eax, -0x4(%rbp)
jmp 0x12825c
movl -0xc(%rbp), %eax
movl %eax, 0x38cad0(%rip)    # 0x4b49f0
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12825c
leaq 0x14fb7e(%rip), %rax    # 0x277ab0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0x127f45
callq 0x992e0
cmpl $0x0, %eax
je 0x127f81
leaq 0x243fa0(%rip), %rax    # 0x36beec
cmpl $0x49, (%rax)
jne 0x127f5d
movl $0x1, -0x4(%rbp)
jmp 0x12825c
leaq 0x243f88(%rip), %rax    # 0x36beec
cmpl $0x46, (%rax)
jne 0x127f75
movl $0x1, -0x4(%rbp)
jmp 0x12825c
movl $0x3, -0x4(%rbp)
jmp 0x12825c
leaq 0x176196(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x127f99
movl $0x0, -0x4(%rbp)
jmp 0x12825c
leaq 0x14fb10(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x127fbe
leaq 0x152207(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x127fbe
leaq 0x14fb1f(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x128022
leaq 0x14faeb(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x127fef
leaq 0x1521e2(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x127fef
leaq 0x14fafa(%rip), %rax    # 0x277ad8
cmpl $0x33, (%rax)
je 0x128022
leaq 0x14faee(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x128022
leaq 0x14faba(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x128008
leaq 0x1521b1(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x128022
leaq 0x14faa1(%rip), %rcx    # 0x277ab0
movabsq $0xcc0a0d4a2, %rax      # imm = 0xCC0A0D4A2
andq (%rcx), %rax
cmpq $0x0, %rax
je 0x12802e
movl $0x0, -0x4(%rbp)
jmp 0x12825c
jmp 0x128030
jmp 0x128032
leaq 0x14fa77(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x128047
jmp 0x1281d8
leaq 0x14fa62(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x1280cf
leaq 0x14fa89(%rip), %rax    # 0x277ae4
cmpb $0x0, (%rax)
jne 0x1280cf
leaq 0x14fa49(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x128079
leaq 0x152140(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x1280cf
leaq 0x14fa30(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x128092
leaq 0x152127(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x1280cf
leaq 0x14fa17(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x12810d
leaq 0x15210e(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x1280cf
leaq 0x152102(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x1280cf
leaq 0x1520f6(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x1280cf
leaq 0x1520ea(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x12810d
leaq 0x14f9da(%rip), %rcx    # 0x277ab0
movabsq $0x400741010, %rax      # imm = 0x400741010
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0x12810d
leaq 0x1520c0(%rip), %rax    # 0x27a1b0
cmpl $0x0, (%rax)
jne 0x12810d
leaq 0x176011(%rip), %rax    # 0x29e10d
cmpb $0x0, (%rax)
jne 0x12810d
leaq 0x152110(%rip), %rax    # 0x27a218
cmpl $0x0, (%rax)
je 0x128112
jmp 0x1281d6
leaq 0x14f9cb(%rip), %rax    # 0x277ae4
cmpb $0x0, (%rax)
jne 0x1281d4
leaq 0x14f987(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x12814b
leaq 0x15207e(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x12814b
leaq 0x14f996(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x1281d4
leaq 0x14f95e(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x12817c
leaq 0x152055(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x12817c
leaq 0x14f96d(%rip), %rax    # 0x277ad8
cmpl $0x33, (%rax)
je 0x1281d4
leaq 0x14f961(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x1281d4
leaq 0x14f92d(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x128195
leaq 0x152024(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
je 0x1281d4
leaq 0x14f914(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x1281ae
leaq 0x15200b(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x1281d4
leaq 0x14f8fb(%rip), %rcx    # 0x277ab0
movabsq $0x800009e4, %rax       # imm = 0x800009E4
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0x1281d4
movl $0x0, -0x4(%rbp)
jmp 0x12825c
jmp 0x1281d6
jmp 0x1281d8
leaq 0x14f8d1(%rip), %rax    # 0x277ab0
cmpq $0x40000, (%rax)        # imm = 0x40000
jne 0x128206
leaq 0x244229(%rip), %rax    # 0x36c418
cmpl $0x0, (%rax)
je 0x1281fd
movl $0x1, -0x4(%rbp)
jmp 0x12825c
movl $0x1, -0x4(%rbp)
jmp 0x12825c
leaq 0x24420b(%rip), %rax    # 0x36c418
cmpl $0x0, (%rax)
je 0x128227
leaq 0x2441fb(%rip), %rax    # 0x36c414
cmpl $0x0, (%rax)
je 0x128227
movl $0x3, -0x4(%rbp)
jmp 0x12825c
leaq 0x2441ea(%rip), %rax    # 0x36c418
cmpl $0x0, (%rax)
je 0x12823c
movl $0x1, -0x4(%rbp)
jmp 0x12825c
leaq 0x2441d1(%rip), %rax    # 0x36c414
cmpl $0x0, (%rax)
je 0x128251
movl $0x2, -0x4(%rbp)
jmp 0x12825c
jmp 0x128253
jmp 0x128255
movl $0x83, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)