// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heather.cpp
// Function: get_plot_q(long)
struct PLOT_Q get_plot_q(long i)
{
static struct PLOT_Q q;
DATA_SIZE color_sum;

   // returns entry "i" from the plot queue.  If "i" is out of range, return
   // the last queue entry that we fetched.  This should show up as a duplicate
   // time stamp error...


   if(plot_q == 0) return q;
   if(i >= plot_q_size) return q;
   if(i < 0) return q;

   q = plot_q[i];

   if(luxor) {
      if(show_color_pct) {  // scale color values to percentages
         color_sum = (DATA_SIZE) ((q.data[REDHZ] + q.data[GREENHZ] + q.data[BLUEHZ]) / (DATA_SIZE) 100.0);
         if(color_sum) {
            q.data[REDHZ] /= color_sum;
            q.data[GREENHZ] /= color_sum;
            q.data[BLUEHZ] /= color_sum;
            q.data[WHITEHZ] /= color_sum;
         }
         else {
            q.data[REDHZ] = 0.0;
            q.data[GREENHZ] = 0.0;
            q.data[BLUEHZ] = 0.0;
            q.data[WHITEHZ] = 0.0;
         }
      }
      else if(show_color_uw) {
         q.data[BLUEHZ] /= (DATA_SIZE) BLUE_SENS;     // blue
         q.data[GREENHZ] /= (DATA_SIZE)  GREEN_SENS;  // green
         q.data[REDHZ] /= (DATA_SIZE) RED_SENS;       // red
         q.data[WHITEHZ] /= (DATA_SIZE) WHITE_SENS;   // white
      }
   }
   else if(USES_PLOT_THREE) ;
   else if(graph_lla == 0) {
      q.data[THREE] = q.data[TEMP] - (q.data[DAC] * d_scale);  // !!!!
   }

   return q;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
movq 0x20b1bc(%rip), %rsi    # 0x21b310
testq %rsi, %rsi
sete %cl
cmpq %rax, 0x20b1bf(%rip)    # 0x21b320
setle %dl
orb %cl, %dl
testq %rax, %rax
sets %cl
orb %dl, %cl
je 0x1018e
leaq 0x330021(%rip), %rsi    # 0x340198
movl $0xb0, %edx
movq %rbx, %rdi
callq 0x92b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
imulq $0xb0, %rax, %rax
addq %rax, %rsi
leaq 0x32fff9(%rip), %rdi    # 0x340198
movl $0xb0, %edx
callq 0x92b0
cmpb $0x0, 0x22ed8e(%rip)    # 0x23ef3e
je 0x1023c
cmpb $0x0, 0x2fcdaf(%rip)    # 0x30cf6c
je 0x10282
movsd 0x330035(%rip), %xmm3   # 0x340200
movsd 0x330025(%rip), %xmm1   # 0x3401f8
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd 0x33000d(%rip), %xmm2   # 0x3401f0
addsd %xmm2, %xmm0
divsd 0xf8e71(%rip), %xmm0    # 0x109060
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jne 0x101ff
jnp 0x102f4
divsd %xmm0, %xmm3
movsd %xmm3, 0x32fff5(%rip)   # 0x340200
divsd %xmm0, %xmm1
movsd %xmm1, 0x32ffe1(%rip)   # 0x3401f8
divsd %xmm0, %xmm2
movsd %xmm2, 0x32ffcd(%rip)   # 0x3401f0
movsd 0x32ffdd(%rip), %xmm1   # 0x340208
divsd %xmm0, %xmm1
movsd %xmm1, 0x32ffd1(%rip)   # 0x340208
jmp 0x10170
testl $0x101b1b00, 0x20868b(%rip) # imm = 0x101B1B00
jne 0x10170
cmpb $0x0, 0x32b071(%rip)    # 0x33b2c4
jne 0x10170
movsd 0x32ff5f(%rip), %xmm0   # 0x3401c0
movsd 0x32ff4f(%rip), %xmm1   # 0x3401b8
mulsd 0x32f49f(%rip), %xmm1   # 0x33f710
subsd %xmm1, %xmm0
movsd %xmm0, 0x32ff5b(%rip)   # 0x3401d8
jmp 0x10170
cmpb $0x0, 0x2fcce2(%rip)    # 0x30cf6b
je 0x10170
movsd 0x32ff59(%rip), %xmm0   # 0x3401f0
divsd 0x2fcc41(%rip), %xmm0   # 0x30cee0
movsd %xmm0, 0x32ff49(%rip)   # 0x3401f0
movsd 0x32ff49(%rip), %xmm0   # 0x3401f8
divsd 0x2fcc31(%rip), %xmm0   # 0x30cee8
movsd %xmm0, 0x32ff39(%rip)   # 0x3401f8
movsd 0x32ff39(%rip), %xmm0   # 0x340200
divsd 0x2fcc21(%rip), %xmm0   # 0x30cef0
movsd %xmm0, 0x32ff29(%rip)   # 0x340200
movsd 0x32ff29(%rip), %xmm0   # 0x340208
divsd 0x2fcc11(%rip), %xmm0   # 0x30cef8
movsd %xmm0, 0x32ff19(%rip)   # 0x340208
jmp 0x10170
xorpd %xmm0, %xmm0
movupd %xmm0, 0x32ff00(%rip)   # 0x340200
movupd %xmm0, 0x32fee8(%rip)   # 0x3401f0
jmp 0x10170