// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: analyze_bang_bang()
void analyze_bang_bang()
{
char *s;
double ct;
double val;

   ct = 0.0;
   if(bang_bang == 0) {  // we are not banging around
      return;   
   }
   else if(bang_bang == 1) {    // waiting for a temp zero crossing (temp near setpoint)
      if(((PID_error > 0.0) && (last_PID_error < 0.0)) ||
         ((PID_error < 0.0) && (last_PID_error > 0.0))) { 
         bang_bang = 2;         // now wait for pid to settle
         bang_settle_time = (int) (I_TC * 5.0F);  // wait for 5 integrator time constants
      }
      s = "ZEROING";
      goto tuned_up;
   }
   else if(bang_bang == 2) {  // waiting for pid filter to settle
      if(bang_settle_time > 0) --bang_settle_time;
      else bang_bang = 3;     // start analyzing pid disturbance cycles
      ct_samples = bang_settle_time;
      s = "SETTLING";
      goto tuned_up;
   }
   else if(bang_bang == 3) {  // first bang time,  initialize variables
      s = "INITIALIZING";
      BANG_INITS = 2;
      tune_cycles = TUNE_CYCLES;
      goto start_banging;
   }
   else if(bang_bang == 4) { // quick bang test
      s = "QUICK TEST";
      BANG_INITS = 0;
      tune_cycles = 1;

      start_banging:
      low_ok = high_ok = 0;
      heat_rate = cool_rate = 0.0F;
      heat_sum = cool_sum = 0.0F;
      heat_ticks = cool_ticks = 0.0F;
      cycle_time = avg_cycle_time = fall_time = ct_samples = 0.0;
      this_cycle = last_cycle = fall_cycle = GetMsecs();
      cyc_ptr = amp_ptr = 0;
      tune_cyc[0] = tune_amp[0] = 0.0;

      OLD_P_GAIN = P_GAIN;
      P_GAIN = 0.0F;
      if(PID_error > 0.0F) k6 = KL_TUNE_STEP;
      else                 k6 = (-KL_TUNE_STEP);
      calc_k_factors();

      bang_bang = 5;
      goto tuned_up;
   }


   // PID filter should now be near a steady state
   // Start disturbance testing
   last_delta = delta;
   delta = this_temperature - desired_temp;

   if(delta > 0.0F) {
      heat_sum += delta;     // calculate average peak values
      heat_ticks += 1.0F;
   }
   else if(delta < 0.0F) {
      cool_sum += delta;
      cool_ticks += 1.0F;
   }

   if(PID_error > 0.0F) k6 = KL_TUNE_STEP;
   else                 k6 = (-KL_TUNE_STEP);

   if((low_ok > BANG_INITS) && (high_ok > BANG_INITS)) {  // we are past the disturbance startup wobblies
      s = "TUNING";
   }
   else {
      s = "DISTURBING";
   }

   if((last_PID_error > 0.0F) && (PID_error <= 0.0F)) {  // rising zero crossing
      this_cycle = GetMsecs();
      cycle_time = this_cycle - last_cycle;
      cycle_time /= 1000.0;    // waveform cycle time in seconds
      fall_time = this_cycle - fall_cycle;
      fall_time /= 1000.0;

      if((low_ok > BANG_INITS) && (high_ok > BANG_INITS)) { // it's not the first rising crossing
         if(cycle_time > 10.0) {  // crossing is probably not noise
            avg_cycle_time += cycle_time;
            ct_samples += 1.0;
            if(cyc_ptr <= tune_cycles) cyc_ptr = add_to_bin(cycle_time,  tune_cyc,  cyc_ptr);

            if(heat_ticks) HEAT_OVERSHOOT = (heat_sum / heat_ticks) * 1.414F;
            if(cool_ticks) COOL_UNDERSHOOT = (cool_sum / cool_ticks) * 1.414F;
            val = HEAT_OVERSHOOT - COOL_UNDERSHOOT;
            if(amp_ptr <= tune_cycles) amp_ptr = add_to_bin(val,  tune_amp,  amp_ptr);
            heat_sum = cool_sum = 0.0F;
            heat_ticks = cool_ticks = 0.0F;

            if(cyc_ptr >= tune_cycles) {
               calc_autotune();
               s = "DONE";
               last_cycle = this_cycle;
               goto tuned_up;
            }
         }
      }
      else { // first rising zero crossing
         heat_sum = cool_sum = 0.0F;
         heat_ticks = cool_ticks = 0.0F;
         avg_cycle_time = ct_samples = 0.0;
      }

      last_cycle = this_cycle;
      rate_sum = delta;
      rate_count = 1.0F;

      ++low_ok;
   }
   else if((last_PID_error < 0.0F) && (PID_error >= 0.0F)) {  // falling zero crossing
      fall_cycle = GetMsecs();
      rate_sum = delta;     //!!!! should we filter test the cycle time here?
      rate_count = 1.0F;
      ++high_ok;
   }
   else {  // calculate the heating and cooling rates near the zero crossing
      rate_sum += delta;
      if(++rate_count == 5.0) {
         rate_sum /= rate_count;
         if(delta > 0.0) heat_rate = rate_sum;
         else            cool_rate = rate_sum;
      }
   }

   tuned_up:
   #ifdef DEBUG_TEMP_CONTROL
      ct = cycle_time;
      sprintf(debug_text2, "%s: cycle(%.0f)=%.3f+%.3f=%.3f sec   us(%.0f)=%.4f os(%.0f)=%.4f  [%.3f,%.4f]", 
             s, ct_samples, ct-fall_time, fall_time, ct,  
             cool_ticks, COOL_UNDERSHOOT,  heat_ticks, HEAT_OVERSHOOT,
             tune_cyc[cyc_ptr/2], tune_amp[amp_ptr/2]
      );
   #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x234885(%rip), %rax    # 0x39e81c
cmpl $0x0, (%rax)
jne 0x169fa1
jmp 0x16a7fc
leaq 0x234874(%rip), %rax    # 0x39e81c
cmpl $0x1, (%rax)
jne 0x16a023
movsd 0x34ad4b(%rip), %xmm0   # 0x4b4d00
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x169fcb
xorps %xmm0, %xmm0
ucomisd 0x34ad3f(%rip), %xmm0   # 0x4b4d08
ja 0x169fe9
xorps %xmm0, %xmm0
ucomisd 0x34ad2a(%rip), %xmm0   # 0x4b4d00
jbe 0x16a013
movsd 0x34ad28(%rip), %xmm0   # 0x4b4d08
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a013
leaq 0x23482c(%rip), %rax    # 0x39e81c
movl $0x2, (%rax)
movsd 0x5162(%rip), %xmm0     # 0x16f160
leaq 0x23483b(%rip), %rax    # 0x39e840
mulsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x34adf1(%rip)    # 0x4b4e04
leaq 0x2eab1(%rip), %rax     # 0x198acb
movq %rax, -0x8(%rbp)
jmp 0x16a743
leaq 0x2347f2(%rip), %rax    # 0x39e81c
cmpl $0x2, (%rax)
jne 0x16a076
cmpl $0x0, 0x34adce(%rip)    # 0x4b4e04
jle 0x16a049
movl 0x34adc6(%rip), %eax    # 0x4b4e04
addl $-0x1, %eax
movl %eax, 0x34adbd(%rip)    # 0x4b4e04
jmp 0x16a056
leaq 0x2347cc(%rip), %rax    # 0x39e81c
movl $0x3, (%rax)
cvtsi2sdl 0x34ada6(%rip), %xmm0 # 0x4b4e04
movsd %xmm0, 0x34ac02(%rip)   # 0x4b4c68
leaq 0x1e9a6(%rip), %rax     # 0x188a13
movq %rax, -0x8(%rbp)
jmp 0x16a743
leaq 0x23479f(%rip), %rax    # 0x39e81c
cmpl $0x3, (%rax)
jne 0x16a0a3
leaq 0x2ea4a(%rip), %rax     # 0x198ad3
movq %rax, -0x8(%rbp)
movl $0x2, 0x34ad71(%rip)    # 0x4b4e08
movl $0x7, 0x34acbf(%rip)    # 0x4b4d60
jmp 0x16a0d2
leaq 0x234772(%rip), %rax    # 0x39e81c
cmpl $0x4, (%rax)
jne 0x16a228
leaq 0x2ea26(%rip), %rax     # 0x198ae0
movq %rax, -0x8(%rbp)
movl $0x0, 0x34ad40(%rip)    # 0x4b4e08
movl $0x1, 0x34ac8e(%rip)    # 0x4b4d60
movq $0x0, 0x34abfb(%rip) # 0x4b4cd8
movq $0x0, 0x34abe8(%rip) # 0x4b4cd0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34abc5(%rip)   # 0x4b4cb8
xorps %xmm0, %xmm0
movsd %xmm0, 0x34abb2(%rip)   # 0x4b4cb0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab97(%rip)   # 0x4b4ca0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab7c(%rip)   # 0x4b4c90
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab89(%rip)   # 0x4b4ca8
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab6e(%rip)   # 0x4b4c98
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab33(%rip)   # 0x4b4c68
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab48(%rip)   # 0x4b4c88
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab15(%rip)   # 0x4b4c60
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ab02(%rip)   # 0x4b4c58
callq 0xb630
movsd %xmm0, 0x34ab1d(%rip)   # 0x4b4c80
movsd %xmm0, 0x34ab0d(%rip)   # 0x4b4c78
movsd %xmm0, 0x34aafd(%rip)   # 0x4b4c70
movl $0x0, 0x34ac33(%rip)    # 0x4b4db0
movl $0x0, 0x34ac79(%rip)    # 0x4b4e00
xorps %xmm0, %xmm0
movsd %xmm0, 0x34abde(%rip)   # 0x4b4d70
xorps %xmm0, %xmm0
movsd %xmm0, 0x34ac23(%rip)   # 0x4b4dc0
leaq 0x234684(%rip), %rax    # 0x39e828
movsd (%rax), %xmm0
leaq 0x2346a9(%rip), %rax    # 0x39e858
movsd %xmm0, (%rax)
leaq 0x23466e(%rip), %rax    # 0x39e828
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movsd 0x34ab37(%rip), %xmm0   # 0x4b4d00
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a1e7
leaq 0x234677(%rip), %rax    # 0x39e850
movsd (%rax), %xmm0
movsd %xmm0, 0x34ab63(%rip)   # 0x4b4d48
jmp 0x16a211
leaq 0x234662(%rip), %rax    # 0x39e850
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x34ab37(%rip)   # 0x4b4d48
callq 0x169430
leaq 0x2345ff(%rip), %rax    # 0x39e81c
movl $0x5, (%rax)
jmp 0x16a743
jmp 0x16a22a
jmp 0x16a22c
jmp 0x16a22e
jmp 0x16a230
movsd 0x34a9d0(%rip), %xmm0   # 0x4b4c08
movsd %xmm0, 0x34a9d0(%rip)   # 0x4b4c10
movsd 0x34a9b0(%rip), %xmm0   # 0x4b4bf8
leaq 0x234d59(%rip), %rax    # 0x39efa8
subsd (%rax), %xmm0
movsd %xmm0, 0x34a9ad(%rip)   # 0x4b4c08
movsd 0x34a9a5(%rip), %xmm0   # 0x4b4c08
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a29e
movsd 0x34a994(%rip), %xmm0   # 0x4b4c08
addsd 0x34aa14(%rip), %xmm0   # 0x4b4c90
movsd %xmm0, 0x34aa0c(%rip)   # 0x4b4c90
movsd 0x4ddc(%rip), %xmm0     # 0x16f068
addsd 0x34aa04(%rip), %xmm0   # 0x4b4c98
movsd %xmm0, 0x34a9fc(%rip)   # 0x4b4c98
jmp 0x16a2dd
xorps %xmm0, %xmm0
ucomisd 0x34a95f(%rip), %xmm0   # 0x4b4c08
jbe 0x16a2db
movsd 0x34a955(%rip), %xmm0   # 0x4b4c08
addsd 0x34a9e5(%rip), %xmm0   # 0x4b4ca0
movsd %xmm0, 0x34a9dd(%rip)   # 0x4b4ca0
movsd 0x4d9d(%rip), %xmm0     # 0x16f068
addsd 0x34a9d5(%rip), %xmm0   # 0x4b4ca8
movsd %xmm0, 0x34a9cd(%rip)   # 0x4b4ca8
jmp 0x16a2dd
movsd 0x34aa1b(%rip), %xmm0   # 0x4b4d00
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a303
leaq 0x23455b(%rip), %rax    # 0x39e850
movsd (%rax), %xmm0
movsd %xmm0, 0x34aa47(%rip)   # 0x4b4d48
jmp 0x16a32d
leaq 0x234546(%rip), %rax    # 0x39e850
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x34aa1b(%rip)   # 0x4b4d48
movq 0x34a99c(%rip), %rax    # 0x4b4cd0
movslq 0x34aacd(%rip), %rcx    # 0x4b4e08
cmpq %rcx, %rax
jle 0x16a360
movq 0x34a991(%rip), %rax    # 0x4b4cd8
movslq 0x34aaba(%rip), %rcx    # 0x4b4e08
cmpq %rcx, %rax
jle 0x16a360
leaq 0x2e791(%rip), %rax     # 0x198aeb
movq %rax, -0x8(%rbp)
jmp 0x16a36b
leaq 0x2e78b(%rip), %rax     # 0x198af2
movq %rax, -0x8(%rbp)
movsd 0x34a995(%rip), %xmm0   # 0x4b4d08
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a64a
xorps %xmm0, %xmm0
ucomisd 0x34a975(%rip), %xmm0   # 0x4b4d00
jb 0x16a64a
callq 0xb630
movsd %xmm0, 0x34a8d2(%rip)   # 0x4b4c70
movsd 0x34a8ca(%rip), %xmm0   # 0x4b4c70
subsd 0x34a8ca(%rip), %xmm0   # 0x4b4c78
movsd %xmm0, 0x34a8a2(%rip)   # 0x4b4c58
movsd 0x34a89a(%rip), %xmm0   # 0x4b4c58
movsd 0x4c6a(%rip), %xmm1     # 0x16f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x34a886(%rip)   # 0x4b4c58
movsd 0x34a896(%rip), %xmm0   # 0x4b4c70
subsd 0x34a89e(%rip), %xmm0   # 0x4b4c80
movsd %xmm0, 0x34a89e(%rip)   # 0x4b4c88
movsd 0x34a896(%rip), %xmm0   # 0x4b4c88
movsd 0x4c36(%rip), %xmm1     # 0x16f030
divsd %xmm1, %xmm0
movsd %xmm0, 0x34a882(%rip)   # 0x4b4c88
movq 0x34a8c3(%rip), %rax    # 0x4b4cd0
movslq 0x34a9f4(%rip), %rcx    # 0x4b4e08
cmpq %rcx, %rax
jle 0x16a5c1
movq 0x34a8b4(%rip), %rax    # 0x4b4cd8
movslq 0x34a9dd(%rip), %rcx    # 0x4b4e08
cmpq %rcx, %rax
jle 0x16a5c1
movsd 0x34a81c(%rip), %xmm0   # 0x4b4c58
movsd 0x4c7c(%rip), %xmm1     # 0x16f0c0
ucomisd %xmm1, %xmm0
jbe 0x16a5bf
movsd 0x34a802(%rip), %xmm0   # 0x4b4c58
addsd 0x34a802(%rip), %xmm0   # 0x4b4c60
movsd %xmm0, 0x34a7fa(%rip)   # 0x4b4c60
movsd 0x4bfa(%rip), %xmm0     # 0x16f068
addsd 0x34a7f2(%rip), %xmm0   # 0x4b4c68
movsd %xmm0, 0x34a7ea(%rip)   # 0x4b4c68
movl 0x34a97c(%rip), %eax    # 0x4b4e00
cmpl 0x34a8d6(%rip), %eax    # 0x4b4d60
jg 0x16a4ac
movsd 0x34a7c4(%rip), %xmm0   # 0x4b4c58
movl 0x34a966(%rip), %esi    # 0x4b4e00
leaq 0x34a91f(%rip), %rdi    # 0x4b4dc0
callq 0x15c580
movl %eax, 0x34a954(%rip)    # 0x4b4e00
movsd 0x34a7e4(%rip), %xmm0   # 0x4b4c98
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16a4c1
jp 0x16a4c1
jmp 0x16a4e5
movsd 0x34a7c7(%rip), %xmm0   # 0x4b4c90
divsd 0x34a7c7(%rip), %xmm0   # 0x4b4c98
movsd 0x24cbf(%rip), %xmm1    # 0x18f198
mulsd %xmm1, %xmm0
movsd %xmm0, 0x34a7fb(%rip)   # 0x4b4ce0
movsd 0x34a7bb(%rip), %xmm0   # 0x4b4ca8
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16a4fa
jp 0x16a4fa
jmp 0x16a51e
movsd 0x34a79e(%rip), %xmm0   # 0x4b4ca0
divsd 0x34a79e(%rip), %xmm0   # 0x4b4ca8
movsd 0x24c86(%rip), %xmm1    # 0x18f198
mulsd %xmm1, %xmm0
movsd %xmm0, 0x34a7ca(%rip)   # 0x4b4ce8
movsd 0x34a7ba(%rip), %xmm0   # 0x4b4ce0
subsd 0x34a7ba(%rip), %xmm0   # 0x4b4ce8
movsd %xmm0, -0x18(%rbp)
movl 0x34a877(%rip), %eax    # 0x4b4db0
cmpl 0x34a821(%rip), %eax    # 0x4b4d60
jg 0x16a55e
movsd -0x18(%rbp), %xmm0
movl 0x34a864(%rip), %esi    # 0x4b4db0
leaq 0x34a81d(%rip), %rdi    # 0x4b4d70
callq 0x15c580
movl %eax, 0x34a852(%rip)    # 0x4b4db0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a737(%rip)   # 0x4b4ca0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a71c(%rip)   # 0x4b4c90
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a729(%rip)   # 0x4b4ca8
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a70e(%rip)   # 0x4b4c98
movl 0x34a870(%rip), %eax    # 0x4b4e00
cmpl 0x34a7ca(%rip), %eax    # 0x4b4d60
jl 0x16a5bd
callq 0x1698c0
leaq 0x2e559(%rip), %rax     # 0x198afd
movq %rax, -0x8(%rbp)
movsd 0x34a6c0(%rip), %xmm0   # 0x4b4c70
movsd %xmm0, 0x34a6c0(%rip)   # 0x4b4c78
jmp 0x16a743
jmp 0x16a5bf
jmp 0x16a603
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a6d4(%rip)   # 0x4b4ca0
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a6b9(%rip)   # 0x4b4c90
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a6c6(%rip)   # 0x4b4ca8
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a6ab(%rip)   # 0x4b4c98
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a670(%rip)   # 0x4b4c68
xorps %xmm0, %xmm0
movsd %xmm0, 0x34a65d(%rip)   # 0x4b4c60
movsd 0x34a665(%rip), %xmm0   # 0x4b4c70
movsd %xmm0, 0x34a665(%rip)   # 0x4b4c78
movsd 0x34a5ed(%rip), %xmm0   # 0x4b4c08
movsd %xmm0, 0x34a69d(%rip)   # 0x4b4cc0
movsd 0x4a3d(%rip), %xmm0     # 0x16f068
movsd %xmm0, 0x34a695(%rip)   # 0x4b4cc8
movq 0x34a696(%rip), %rax    # 0x4b4cd0
addq $0x1, %rax
movq %rax, 0x34a68b(%rip)    # 0x4b4cd0
jmp 0x16a741
xorps %xmm0, %xmm0
ucomisd 0x34a6b3(%rip), %xmm0   # 0x4b4d08
jbe 0x16a6ac
movsd 0x34a6a1(%rip), %xmm0   # 0x4b4d00
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x16a6ac
callq 0xb630
movsd %xmm0, 0x34a60b(%rip)   # 0x4b4c80
movsd 0x34a58b(%rip), %xmm0   # 0x4b4c08
movsd %xmm0, 0x34a63b(%rip)   # 0x4b4cc0
movsd 0x49db(%rip), %xmm0     # 0x16f068
movsd %xmm0, 0x34a633(%rip)   # 0x4b4cc8
movq 0x34a63c(%rip), %rax    # 0x4b4cd8
addq $0x1, %rax
movq %rax, 0x34a631(%rip)    # 0x4b4cd8
jmp 0x16a73f
movsd 0x34a554(%rip), %xmm0   # 0x4b4c08
addsd 0x34a604(%rip), %xmm0   # 0x4b4cc0
movsd %xmm0, 0x34a5fc(%rip)   # 0x4b4cc0
movsd 0x499c(%rip), %xmm0     # 0x16f068
addsd 0x34a5f4(%rip), %xmm0   # 0x4b4cc8
movsd %xmm0, 0x34a5ec(%rip)   # 0x4b4cc8
movsd 0x4a7c(%rip), %xmm1     # 0x16f160
ucomisd %xmm1, %xmm0
jne 0x16a73d
jp 0x16a73d
movsd 0x34a5d4(%rip), %xmm1   # 0x4b4cc8
movsd 0x34a5c4(%rip), %xmm0   # 0x4b4cc0
divsd %xmm1, %xmm0
movsd %xmm0, 0x34a5b8(%rip)   # 0x4b4cc0
movsd 0x34a4f8(%rip), %xmm0   # 0x4b4c08
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x16a72b
movsd 0x34a59f(%rip), %xmm0   # 0x4b4cc0
movsd %xmm0, 0x34a587(%rip)   # 0x4b4cb0
jmp 0x16a73b
movsd 0x34a58d(%rip), %xmm0   # 0x4b4cc0
movsd %xmm0, 0x34a57d(%rip)   # 0x4b4cb8
jmp 0x16a73d
jmp 0x16a73f
jmp 0x16a741
jmp 0x16a743
movsd 0x34a50d(%rip), %xmm0   # 0x4b4c58
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movsd 0x34a508(%rip), %xmm0   # 0x4b4c68
movsd -0x10(%rbp), %xmm1
subsd 0x34a51b(%rip), %xmm1   # 0x4b4c88
movsd 0x34a513(%rip), %xmm2   # 0x4b4c88
movsd -0x10(%rbp), %xmm3
movsd 0x34a526(%rip), %xmm4   # 0x4b4ca8
movsd 0x34a55e(%rip), %xmm5   # 0x4b4ce8
movsd 0x34a506(%rip), %xmm6   # 0x4b4c98
movsd 0x34a546(%rip), %xmm7   # 0x4b4ce0
movl 0x34a660(%rip), %eax    # 0x4b4e00
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rcx
leaq 0x34a60e(%rip), %rax    # 0x4b4dc0
movsd (%rax,%rcx,8), %xmm9
movl 0x34a5f2(%rip), %eax    # 0x4b4db0
movl $0x2, %ecx
cltd
idivl %ecx
movq -0x20(%rbp), %rdx
movslq %eax, %rcx
leaq 0x34a59c(%rip), %rax    # 0x4b4d70
movsd (%rax,%rcx,8), %xmm8
leaq 0x2334ef(%rip), %rdi    # 0x39dcd0
leaq 0x2e31a(%rip), %rsi     # 0x198b02
movsd %xmm9, (%rsp)
movsd %xmm8, 0x8(%rsp)
movb $0x8, %al
callq 0x9060
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)