// File: /workspace/github_cpp_makefile_star2_O3/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 0x20b23f(%rip), %rsi    # 0x21b310
testq %rsi, %rsi
sete %cl
cmpq %rax, 0x20b242(%rip)    # 0x21b320
setle %dl
orb %cl, %dl
testq %rax, %rax
sets %cl
orb %dl, %cl
je 0x1010b
leaq 0x3300a4(%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 0x33007c(%rip), %rdi    # 0x340198
movl $0xb0, %edx
callq 0x92b0
cmpb $0x0, 0x22ee11(%rip)    # 0x23ef3e
je 0x101b9
cmpb $0x0, 0x2fce32(%rip)    # 0x30cf6c
je 0x101ff
movsd 0x3300b8(%rip), %xmm3   # 0x340200
movsd 0x3300a8(%rip), %xmm1   # 0x3401f8
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd 0x330090(%rip), %xmm2   # 0x3401f0
addsd %xmm2, %xmm0
divsd 0xf8ef4(%rip), %xmm0    # 0x109060
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jne 0x1017c
jnp 0x10271
divsd %xmm0, %xmm3
movsd %xmm3, 0x330078(%rip)   # 0x340200
divsd %xmm0, %xmm1
movsd %xmm1, 0x330064(%rip)   # 0x3401f8
divsd %xmm0, %xmm2
movsd %xmm2, 0x330050(%rip)   # 0x3401f0
movsd 0x330060(%rip), %xmm1   # 0x340208
divsd %xmm0, %xmm1
movsd %xmm1, 0x330054(%rip)   # 0x340208
jmp 0x100ed
testl $0x101b1b00, 0x20870e(%rip) # imm = 0x101B1B00
jne 0x100ed
cmpb $0x0, 0x32b0f4(%rip)    # 0x33b2c4
jne 0x100ed
movsd 0x32ffe2(%rip), %xmm0   # 0x3401c0
movsd 0x32ffd2(%rip), %xmm1   # 0x3401b8
mulsd 0x32f522(%rip), %xmm1   # 0x33f710
subsd %xmm1, %xmm0
movsd %xmm0, 0x32ffde(%rip)   # 0x3401d8
jmp 0x100ed
cmpb $0x0, 0x2fcd65(%rip)    # 0x30cf6b
je 0x100ed
movsd 0x32ffdc(%rip), %xmm0   # 0x3401f0
divsd 0x2fccc4(%rip), %xmm0   # 0x30cee0
movsd %xmm0, 0x32ffcc(%rip)   # 0x3401f0
movsd 0x32ffcc(%rip), %xmm0   # 0x3401f8
divsd 0x2fccb4(%rip), %xmm0   # 0x30cee8
movsd %xmm0, 0x32ffbc(%rip)   # 0x3401f8
movsd 0x32ffbc(%rip), %xmm0   # 0x340200
divsd 0x2fcca4(%rip), %xmm0   # 0x30cef0
movsd %xmm0, 0x32ffac(%rip)   # 0x340200
movsd 0x32ffac(%rip), %xmm0   # 0x340208
divsd 0x2fcc94(%rip), %xmm0   # 0x30cef8
movsd %xmm0, 0x32ff9c(%rip)   # 0x340208
jmp 0x100ed
xorpd %xmm0, %xmm0
movupd %xmm0, 0x32ff83(%rip)   # 0x340200
movupd %xmm0, 0x32ff6b(%rip)   # 0x3401f0
jmp 0x100ed