// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_adev_point(unsigned char, long)
double get_adev_point(u08 id, long i)
{
double val;
#define INTERVAL ((OFS_SIZE) 0.0)  //1.0

   if(adev_q_allocated == 0) return 0.0;

   id /= NUM_ADEV_TYPES;

   val = 0;
   if(id == PPS_ID) {   // return PPS value
      i = pps_adev_q_out + i;
//      if(i >= adev_q_size) i -= adev_q_size;
      while(i >= adev_q_size) i -= adev_q_size;
      if(i < 0) return 0.0;
      if(pps_adev_q == 0) return 0.0;
      val = pps_adev_q[i];
      if(luxor) val = INTERVAL + (val+pps_base_value);
      else      val = INTERVAL + (1.0e-9 * (val+pps_base_value));
   }
   else if(id == CHC_ID) {   // return CHC value
      i = chc_adev_q_out + i;
//      if(i >= adev_q_size) i -= adev_q_size;
      while(i >= adev_q_size) i -= adev_q_size;
      if(i < 0) return 0.0;
      if(chc_adev_q == 0) return 0.0;
      val = chc_adev_q[i];
      if(luxor) val = INTERVAL + (val+chc_base_value);
      else      val = INTERVAL + (1.0e-9 * (val+chc_base_value));
   }
   else if(id == CHD_ID) {   // return CHD value
      i = chd_adev_q_out + i;
//      if(i >= adev_q_size) i -= adev_q_size;
      while(i >= adev_q_size) i -= adev_q_size;
      if(i < 0) return 0.0;
      if(chd_adev_q == 0) return 0.0;
      val = chd_adev_q[i];
      if(luxor) val = INTERVAL + (val+chd_base_value);
      else      val = INTERVAL + (1.0e-9 * (val+chd_base_value));
   }
   else {      // return OSC value
      i = osc_adev_q_out + i;
//      if(i >= adev_q_size) i -= adev_q_size;
      while(i >= adev_q_size) i -= adev_q_size;
      if(i < 0) return 0.0;
      if(osc_adev_q == 0) return 0.0;
      val = osc_adev_q[i];
      if(luxor) val = INTERVAL + (val+osc_base_value);
      else if(TICC_USED) val = INTERVAL + (1.0e-9 * (val+osc_base_value));
      else if(0) val = INTERVAL + (1.0e-9 * (val+osc_base_value));  // aaattttt
      else val = INTERVAL + ((100.0 * 1.0e-9) * (val+osc_base_value));
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x13c2b3(%rip), %rax    # 0x23cce0
xorpd %xmm0, %xmm0
cmpl $0x0, (%rax)
je 0x100bb3
leal -0x5(%rdi), %ecx
leaq 0x13c294(%rip), %rax    # 0x23ccd8
movq (%rax), %rax
cmpb $0x4, %cl
ja 0x100a9b
leaq 0x13c0dd(%rip), %rcx    # 0x23cb30
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0x100a5c
testq %rcx, %rcx
js 0x100bb3
leaq 0x13c0ac(%rip), %rax    # 0x23cb20
movq (%rax), %rax
testq %rax, %rax
je 0x100bb3
leaq 0x13e4b7(%rip), %rdx    # 0x23ef3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x122a1a(%rip), %rax    # 0x2234b0
jmp 0x100b43
leal -0xa(%rdi), %ecx
cmpb $0x4, %cl
ja 0x100aef
leaq 0x13c126(%rip), %rcx    # 0x23cbd0
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0x100ab3
testq %rcx, %rcx
js 0x100bb3
leaq 0x13c0f5(%rip), %rax    # 0x23cbc0
movq (%rax), %rax
testq %rax, %rax
je 0x100bb3
leaq 0x13e460(%rip), %rdx    # 0x23ef3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x1229d3(%rip), %rax    # 0x2234c0
jmp 0x100b43
addb $-0xf, %dil
cmpb $0x4, %dil
ja 0x100b69
leaq 0x13c120(%rip), %rcx    # 0x23cc20
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0x100b09
testq %rcx, %rcx
js 0x100bb3
leaq 0x13c0ef(%rip), %rax    # 0x23cc10
movq (%rax), %rax
testq %rax, %rax
je 0x100bb3
leaq 0x13e40a(%rip), %rdx    # 0x23ef3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x122985(%rip), %rax    # 0x2234c8
addsd (%rax), %xmm0
je 0x100b53
xorpd %xmm1, %xmm1
addsd %xmm1, %xmm0
jmp 0x100bb3
mulsd 0x1d695(%rip), %xmm0    # 0x11e1f0
xorpd %xmm1, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0x100bb3
leaq 0x13c010(%rip), %rcx    # 0x23cb80
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0x100b79
testq %rcx, %rcx
js 0x100bb3
leaq 0x13bfe3(%rip), %rax    # 0x23cb70
movq (%rax), %rax
testq %rax, %rax
je 0x100bb3
movsd (%rax,%rcx,8), %xmm1
leaq 0x13e39d(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0x100bb9
leaq 0x12290b(%rip), %rax    # 0x2234b8
addsd (%rax), %xmm1
jmp 0x100bef
addq $0x10, %rsp
popq %rbp
retq
leaq 0x117d10(%rip), %rax    # 0x2188d0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0x100bdc
movsd %xmm1, -0x8(%rbp)
callq 0x701f2
movsd -0x8(%rbp), %xmm1
testl %eax, %eax
je 0x100bf8
leaq 0x1228d5(%rip), %rax    # 0x2234b8
addsd (%rax), %xmm1
mulsd 0x1d601(%rip), %xmm1    # 0x11e1f0
xorpd %xmm0, %xmm0
jmp 0x100b4d
leaq 0x1228b9(%rip), %rax    # 0x2234b8
addsd (%rax), %xmm1
mulsd 0x2ab05(%rip), %xmm1    # 0x12b710
jmp 0x100bef