// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: add_rcvr_adev_point(int)
void add_rcvr_adev_point(int why)
{
   // NEW_RCVR

   // add receiver derived pps/osc values to adev queues
   if(jitter_adev) return;  // adev queues in use measuring message timing
    
   if(TICC_USED) {    // ADEV data comes from external time interval counter
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == BRANDY_RCVR) {
      do_pps_adev(pps_offset);
   }
   else if(rcvr_type == PRS_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == RFTG_RCVR) {
///   if(have_pps_offset && last_rftg_phase) do_pps_adev(pps_offset-last_rftg_phase);  
///   last_rftg_phase = pps_offset;
      do_pps_adev(pps_offset);
   }
   else if(rcvr_type == SCPI_RCVR) {  // TINT adevs
      if(have_pps_offset) do_pps_adev(pps_offset/100.00);  
//    if(have_osc_offset) do_osc_adev(osc_offset);  // makes no sense to ADEV
   }
   else if(rcvr_type == UCCM_RCVR) {  // TINT adevs
      if(have_pps_offset) {
         if(scpi_type == UCCMP_TYPE) {
            do_pps_adev((pps_offset/100.00)*UCCMP_PPS_ADEV_SCALE);
         }
         else if(scpi_type == SAMSUNG_TYPE) {
            do_pps_adev((pps_offset/100.00)*SAMSUNG_PPS_ADEV_SCALE);
         }
         else {
            do_pps_adev((pps_offset/100.00)*UCCM_PPS_ADEV_SCALE);
         }
      }

      if(0 && have_osc_offset) {  // UCCM DIAG:LOOP? adevs
         do_osc_adev(osc_offset);  // we don't know what this value actually is, so dont ADEV_STUFF it
      }
   }
   else if(0) {  // adadad
   }
   else if(rcvr_type == GPSD_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == MOTO_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == NVS_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
   }
   else if(rcvr_type == SIRF_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == TSIP_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset / 100.0);
      if(have_osc_offset) do_osc_adev(osc_offset / 100.0);
   }
   else if(rcvr_type == UBX_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
   else if(rcvr_type == ZODIAC_RCVR) {
      if(have_pps_offset) do_pps_adev(pps_offset);
      if(have_osc_offset) do_osc_adev(osc_offset);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1c4b24(%rip), %rax    # 0x23ccc4
cmpl $0x0, (%rax)
je 0x781a7
popq %rbp
retq
leaq 0x1a0722(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x10000, %rax          # imm = 0x10000
je 0x781df
leaq 0x1c61d8(%rip), %rcx    # 0x23e398
cmpq $0x0, (%rcx)
jne 0x781df
leaq 0x296113(%rip), %rcx    # 0x30e2e0
cmpl $0x0, 0x1e114(%rcx)
je 0x78218
cmpl $0x0, 0x1e110(%rcx)
jle 0x78218
leaq 0x295052(%rip), %rax    # 0x30d238
cmpl $0x0, (%rax)
je 0x781fb
leaq 0x2945c6(%rip), %rax    # 0x30c7b8
movsd (%rax), %xmm0
callq 0x780d5
leaq 0x295032(%rip), %rax    # 0x30d234
cmpl $0x0, (%rax)
je 0x781a5
leaq 0x2945b2(%rip), %rax    # 0x30c7c0
movsd (%rax), %xmm0
popq %rbp
jmp 0x78135
cmpq $0xff, %rax
jg 0x7828f
cmpq $0xf, %rax
jg 0x782cc
cmpq $0x1, %rax
je 0x78320
cmpq $0x4, %rax
je 0x781df
cmpq $0x8, %rax
jne 0x781a5
leaq 0x294fed(%rip), %rax    # 0x30d238
cmpl $0x0, (%rax)
je 0x781a5
leaq 0x1a2d85(%rip), %rax    # 0x21afe0
movl (%rax), %eax
leaq 0x294554(%rip), %rcx    # 0x30c7b8
movsd (%rcx), %xmm0
divsd 0x90df0(%rip), %xmm0    # 0x109060
cmpl $0x53, %eax
je 0x78391
cmpl $0x50, %eax
jne 0x7839e
mulsd 0xa5f76(%rip), %xmm0    # 0x11e200
jmp 0x7831a
cmpq $0x3ffff, %rax          # imm = 0x3FFFF
jg 0x782ef
cmpq $0x100, %rax            # imm = 0x100
je 0x781df
cmpq $0x200, %rax            # imm = 0x200
je 0x781df
cmpq $0x800, %rax            # imm = 0x800
jne 0x781a5
leaq 0x294f76(%rip), %rax    # 0x30d238
cmpl $0x0, (%rax)
jne 0x7830f
jmp 0x781a5
cmpq $0x10, %rax
je 0x7836c
cmpq $0x20, %rax
je 0x781df
cmpq $0x40, %rax
je 0x781df
jmp 0x781a5
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0x781df
cmpq $0x400000, %rax         # imm = 0x400000
je 0x7830f
cmpq $0x40000, %rax          # imm = 0x40000
jne 0x781a5
leaq 0x2944a2(%rip), %rax    # 0x30c7b8
movsd (%rax), %xmm0
popq %rbp
jmp 0x780d5
leaq 0x294f11(%rip), %rax    # 0x30d238
cmpl $0x0, (%rax)
je 0x78344
leaq 0x294485(%rip), %rax    # 0x30c7b8
movsd (%rax), %xmm0
divsd 0x90d21(%rip), %xmm0    # 0x109060
callq 0x780d5
leaq 0x294ee9(%rip), %rax    # 0x30d234
cmpl $0x0, (%rax)
je 0x781a5
leaq 0x294465(%rip), %rax    # 0x30c7c0
movsd (%rax), %xmm0
divsd 0x90cf9(%rip), %xmm0    # 0x109060
jmp 0x78212
leaq 0x294ec5(%rip), %rax    # 0x30d238
cmpl $0x0, (%rax)
je 0x781a5
leaq 0x294435(%rip), %rax    # 0x30c7b8
movsd (%rax), %xmm0
divsd 0x90cd1(%rip), %xmm0    # 0x109060
jmp 0x7831a
mulsd 0xa5e5f(%rip), %xmm0    # 0x11e1f8
jmp 0x7831a
mulsd 0xa5e62(%rip), %xmm0    # 0x11e208
jmp 0x7831a