// File: /workspace/github_cpp_makefile_star2_O2/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 0x1f5936(%rip), %rsi    # 0x205310
testq %rsi, %rsi
sete %cl
cmpq %rax, 0x1f5939(%rip)    # 0x205320
setle %dl
orb %cl, %dl
testq %rax, %rax
sets %cl
orb %dl, %cl
je 0xfa14
leaq 0x31a79b(%rip), %rsi    # 0x32a198
movl $0xb0, %edx
movq %rbx, %rdi
callq 0x92a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
imulq $0xb0, %rax, %rax
addq %rax, %rsi
leaq 0x31a773(%rip), %rdi    # 0x32a198
movl $0xb0, %edx
callq 0x92a0
cmpb $0x0, 0x219508(%rip)    # 0x228f3e
je 0xfac2
cmpb $0x0, 0x2e7529(%rip)    # 0x2f6f6c
je 0xfb08
movsd 0x31a7af(%rip), %xmm3   # 0x32a200
movsd 0x31a79f(%rip), %xmm1   # 0x32a1f8
movapd %xmm3, %xmm0
addsd %xmm1, %xmm0
movsd 0x31a787(%rip), %xmm2   # 0x32a1f0
addsd %xmm2, %xmm0
divsd 0xe35eb(%rip), %xmm0    # 0xf3060
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm0
jne 0xfa85
jnp 0xfb7a
divsd %xmm0, %xmm3
movsd %xmm3, 0x31a76f(%rip)   # 0x32a200
divsd %xmm0, %xmm1
movsd %xmm1, 0x31a75b(%rip)   # 0x32a1f8
divsd %xmm0, %xmm2
movsd %xmm2, 0x31a747(%rip)   # 0x32a1f0
movsd 0x31a757(%rip), %xmm1   # 0x32a208
divsd %xmm0, %xmm1
movsd %xmm1, 0x31a74b(%rip)   # 0x32a208
jmp 0xf9f6
testl $0x101b1b00, 0x1f2e05(%rip) # imm = 0x101B1B00
jne 0xf9f6
cmpb $0x0, 0x3157eb(%rip)    # 0x3252c4
jne 0xf9f6
movsd 0x31a6d9(%rip), %xmm0   # 0x32a1c0
movsd 0x31a6c9(%rip), %xmm1   # 0x32a1b8
mulsd 0x319c19(%rip), %xmm1   # 0x329710
subsd %xmm1, %xmm0
movsd %xmm0, 0x31a6d5(%rip)   # 0x32a1d8
jmp 0xf9f6
cmpb $0x0, 0x2e745c(%rip)    # 0x2f6f6b
je 0xf9f6
movsd 0x31a6d3(%rip), %xmm0   # 0x32a1f0
divsd 0x2e73bb(%rip), %xmm0   # 0x2f6ee0
movsd %xmm0, 0x31a6c3(%rip)   # 0x32a1f0
movsd 0x31a6c3(%rip), %xmm0   # 0x32a1f8
divsd 0x2e73ab(%rip), %xmm0   # 0x2f6ee8
movsd %xmm0, 0x31a6b3(%rip)   # 0x32a1f8
movsd 0x31a6b3(%rip), %xmm0   # 0x32a200
divsd 0x2e739b(%rip), %xmm0   # 0x2f6ef0
movsd %xmm0, 0x31a6a3(%rip)   # 0x32a200
movsd 0x31a6a3(%rip), %xmm0   # 0x32a208
divsd 0x2e738b(%rip), %xmm0   # 0x2f6ef8
movsd %xmm0, 0x31a693(%rip)   # 0x32a208
jmp 0xf9f6
xorpd %xmm0, %xmm0
movupd %xmm0, 0x31a67a(%rip)   # 0x32a200
movupd %xmm0, 0x31a662(%rip)   # 0x32a1f0
jmp 0xf9f6