// File: /workspace/github_cpp_makefile_star2_O2/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 0x13bf7b(%rip), %rax    # 0x226ce0
xorpd %xmm0, %xmm0
cmpl $0x0, (%rax)
je 0xeaeeb
leal -0x5(%rdi), %ecx
leaq 0x13bf5c(%rip), %rax    # 0x226cd8
movq (%rax), %rax
cmpb $0x4, %cl
ja 0xeadd3
leaq 0x13bda5(%rip), %rcx    # 0x226b30
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0xead94
testq %rcx, %rcx
js 0xeaeeb
leaq 0x13bd74(%rip), %rax    # 0x226b20
movq (%rax), %rax
testq %rax, %rax
je 0xeaeeb
leaq 0x13e17f(%rip), %rdx    # 0x228f3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x1226e2(%rip), %rax    # 0x20d4b0
jmp 0xeae7b
leal -0xa(%rdi), %ecx
cmpb $0x4, %cl
ja 0xeae27
leaq 0x13bdee(%rip), %rcx    # 0x226bd0
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0xeadeb
testq %rcx, %rcx
js 0xeaeeb
leaq 0x13bdbd(%rip), %rax    # 0x226bc0
movq (%rax), %rax
testq %rax, %rax
je 0xeaeeb
leaq 0x13e128(%rip), %rdx    # 0x228f3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x12269b(%rip), %rax    # 0x20d4c0
jmp 0xeae7b
addb $-0xf, %dil
cmpb $0x4, %dil
ja 0xeaea1
leaq 0x13bde8(%rip), %rcx    # 0x226c20
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0xeae41
testq %rcx, %rcx
js 0xeaeeb
leaq 0x13bdb7(%rip), %rax    # 0x226c10
movq (%rax), %rax
testq %rax, %rax
je 0xeaeeb
leaq 0x13e0d2(%rip), %rdx    # 0x228f3e
cmpb $0x0, (%rdx)
movsd (%rax,%rcx,8), %xmm0
leaq 0x12264d(%rip), %rax    # 0x20d4c8
addsd (%rax), %xmm0
je 0xeae8b
xorpd %xmm1, %xmm1
addsd %xmm1, %xmm0
jmp 0xeaeeb
mulsd 0x82b5(%rip), %xmm0     # 0xf3148
xorpd %xmm1, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
jmp 0xeaeeb
leaq 0x13bcd8(%rip), %rcx    # 0x226b80
movq (%rcx), %rcx
addq %rax, %rcx
addq %rsi, %rcx
subq %rax, %rcx
cmpq %rax, %rcx
jge 0xeaeb1
testq %rcx, %rcx
js 0xeaeeb
leaq 0x13bcab(%rip), %rax    # 0x226b70
movq (%rax), %rax
testq %rax, %rax
je 0xeaeeb
movsd (%rax,%rcx,8), %xmm1
leaq 0x13e065(%rip), %rax    # 0x228f3e
cmpb $0x0, (%rax)
je 0xeaef1
leaq 0x1225d3(%rip), %rax    # 0x20d4b8
addsd (%rax), %xmm1
jmp 0xeaf27
addq $0x10, %rsp
popq %rbp
retq
leaq 0x1179d8(%rip), %rax    # 0x2028d0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0xeaf14
movsd %xmm1, -0x8(%rbp)
callq 0x66b41
movsd -0x8(%rbp), %xmm1
testl %eax, %eax
je 0xeaf30
leaq 0x12259d(%rip), %rax    # 0x20d4b8
addsd (%rax), %xmm1
mulsd 0x8221(%rip), %xmm1     # 0xf3148
xorpd %xmm0, %xmm0
jmp 0xeae85
leaq 0x122581(%rip), %rax    # 0x20d4b8
addsd (%rax), %xmm1
mulsd 0x2a7f5(%rip), %xmm1    # 0x115738
jmp 0xeaf27