// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/Kicker.cpp
// Function: Kicker::MultiCycleKick(Agent const&, int)
ActionPlan Kicker::MultiCycleKick(const Agent &agent, int cycle) {
  Assert(cycle > 1);

  UpdateKickData(agent);

  ActionPlan plan;
  AtomicAction act;

  /** 首先考虑能否先转身再踢，可以就不进行后面的搜索了 */
  act = GetTurnAction(agent);
  if (act.mSucceed == true) {
    plan.mCycle = 2;
    plan.mSucceed = true;
    plan.mActionQueue.clear();
    plan.mActionQueue.push_back(act);
    return plan;
  }

  /** 其次考虑能否先停再转身，再踢 */
  double speed_buf = 0.1;
  int index = -1;
  double turn_max_speed = 0.0;
  double turn_poss = 0.0;
  if (cycle >= 3) {
    act = TurnPlan(agent, index, turn_max_speed);
    if (act.mSucceed == true && index >= 0 &&
        turn_max_speed > mKickSpeed + 0.1) {
      turn_poss =
          mPointEva[index] *
          mSpeedCurve.GetOutput(turn_max_speed - mKickSpeed + speed_buf);
      turn_poss *= 1.2; /** 这里要仔细调下 */
    }
  }

  /** 下面进行多脚踢球的规划 */
  // target及mPoint都是在踢球的最后一个周期的坐标系中
  Vector target =
      mKickTarget -
      mInput.mPlayerVel * ((1 - pow(PlayerParam::instance()
                                        .HeteroPlayer(mInput.mPlayerType)
                                        .playerDecay(),
                                    cycle - 1)) /
                           (1 - PlayerParam::instance()
                                    .HeteroPlayer(mInput.mPlayerType)
                                    .playerDecay()));
  int best = -1;
  double poss = 0.0;
  double max_poss = 0.0;

  int idx = (int)GetNormalizeAngleDeg((target - mInput.mBallPos).Dir(),
                                      -FLOAT_EPS); /** 得到0到359的一个整数 */

  if (cycle < 4 && mMaxSpeedFlag[idx][cycle - 1] == mAgentID) {
    best = NearestPoint(mMaxSpeedOutFirstPos[idx][cycle - 1]);

    // std::cerr << agent.GetSelfUnum() << "@" <<
    // agent.GetWorldState().CurrentTime() << ": good" << std::endl;

    if (best >= 0) {
      poss = mPointEva[best] * mSpeedCurve.GetOutput(mMaxSpeed[idx][cycle - 1] -
                                                     mKickSpeed + speed_buf);
    }
  }

  if (poss < 0.001) {
    // std::cerr << agent.GetSelfUnum() << "@" <<
    // agent.GetWorldState().CurrentTime() << ": no good" << std::endl;

    for (int k = 0, v = cycle - 2, j = NearestPoint(mInput.mBallPos);
         k < POINTS_NUM; ++k) {
      int i =
          (int)(GetNormalizeAngleDeg((target - mPoint[k]).Dir(), -FLOAT_EPS) /
                STEP_KICK_ANGLE);
      if (mPointEva[k] > 0.001 &&
          (double)mKickerValue[v][i][j][k] >
              mKickSpeed - speed_buf) // 要大于期望的出球速度
      {
        // mPoint[k]+mInput.mPlayerVel是mPoint[k]在踢球的第一个周期的坐标系中的位置
        Vector ball_vel = (mPoint[k] + mInput.mPlayerVel - mInput.mBallPos) *
                          ServerParam::instance().ballDecay(); // 踢到k后的球速
        double speed = 0.0;

        if (cycle == 2) // 前向搜索1步
        {
          speed = GetOneKickMaxSpeed(ball_vel, (target - mPoint[k]).Dir(),
                                     mMaxAccel[k]);
        } else // 前向搜索2步
        {
          Vector ball_next = mPoint[k] + ball_vel;
          for (int l = 0; l < POINTS_NUM; ++l) // 从j踢到k，再踢到l
          {
            if (mPoint[l].Dist(ball_next) <
                mMaxAccel[k]) // 保证理论上可以从k踢到l
            {
              // mPoint[l]+PlayerVel*Decay是mPoint[l]在踢球的第二个周期的坐标系中的位置
              Vector ball_vel_next =
                  (mPoint[l] +
                   mInput.mPlayerVel * PlayerParam::instance()
                                           .HeteroPlayer(mInput.mPlayerType)
                                           .playerDecay() -
                   mPoint[k]) *
                  ServerParam::instance().ballDecay();
              if (cycle == 3) {
                speed =
                    Max(speed, GetOneKickMaxSpeed(ball_vel_next,
                                                  (target - mPoint[l]).Dir(),
                                                  mMaxAccel[l]));
              } else if (cycle ==
                         4) // 利用mKickerValue[1]的信息，没必要再前向了
              {
                int t = (int)(GetNormalizeAngleDeg((target - mPoint[l]).Dir(),
                                                   -FLOAT_EPS) /
                              STEP_KICK_ANGLE);
                speed = Max(speed, (double)mKickerValue[1][t][k][l]);
              }
            }
          }
        }

        if (speed > mKickSpeed - speed_buf) {
          poss = mPointEva[k] *
                 mSpeedCurve.GetOutput(speed - mKickSpeed + speed_buf);
        } else {
          poss = 0.0;
        }

        if (poss > max_poss) // 找到poss最大的点
        {
          best = k;
          max_poss = poss;
          // max_speed   = speed;
        }
      }
    }
  }

  if (turn_poss > max_poss) // 转身规划的收益较高
  {
    plan.mCycle = 3;
    plan.mSucceed = true;
    plan.mActionQueue.clear();
    plan.mActionQueue.push_back(act);
    return plan;
  }

  // 不进行转身的规划，进行多脚踢球
  plan.mCycle = cycle;
  plan.mSucceed = false;
  if (best >= 0) {
    act = GetOneKickAction(agent, mInput.mBallPos, mInput.mBallVel,
                           mInput.mPlayerVel + mPoint[best]);
    if (act.mSucceed == true) {
      plan.mSucceed = true;
      plan.mActionQueue.clear();
      plan.mActionQueue.push_back(act);
    }
  }
  return plan;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rcx, -0x50(%rbp)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r13
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2de9c
xorl %ebx, %ebx
movb %bl, (%r13)
leaq 0x8(%r13), %r12
xorpd %xmm0, %xmm0
movupd %xmm0, 0x4(%r13)
movupd %xmm0, 0x14(%r13)
movupd %xmm0, 0x24(%r13)
movupd %xmm0, 0x34(%r13)
movupd %xmm0, 0x44(%r13)
movl $0x0, 0x54(%r13)
movq %r12, %rdi
xorl %esi, %esi
callq 0x338f6
movb %bl, -0xe0(%rbp)
xorpd %xmm0, %xmm0
movupd %xmm0, -0xdc(%rbp)
movupd %xmm0, -0xcc(%rbp)
movupd %xmm0, -0xc0(%rbp)
leaq -0x120(%rbp), %rdi
movq %r14, -0x38(%rbp)
movq %r14, %rsi
movq %r15, %rdx
callq 0x321c4
movupd -0x120(%rbp), %xmm0
movupd -0x110(%rbp), %xmm1
movupd -0x100(%rbp), %xmm2
movapd %xmm2, -0xc0(%rbp)
movapd %xmm1, -0xd0(%rbp)
movapd %xmm0, -0xe0(%rbp)
cmpb $0x1, -0xe0(%rbp)
jne 0x2fe1d
movl $0x2, 0x4(%r13)
movb $0x1, (%r13)
movq %r12, %rdi
callq 0x335ec
movq 0x38(%r13), %rax
movq 0x48(%r13), %rcx
addq $-0x30, %rcx
cmpq %rcx, %rax
jne 0x30877
leaq -0xe0(%rbp), %rsi
movq %r12, %rdi
callq 0x33afc
jmp 0x308a5
cmpl $0x3, -0x50(%rbp)
jl 0x2fe66
leaq -0x120(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x3283e
movupd -0x120(%rbp), %xmm0
movupd -0x110(%rbp), %xmm1
movupd -0x100(%rbp), %xmm2
movapd %xmm2, -0xc0(%rbp)
movapd %xmm1, -0xd0(%rbp)
movapd %xmm0, -0xe0(%rbp)
callq 0x450ba
movq -0x38(%rbp), %r14
movq 0x5c38(%rax), %rax
movslq 0x2b4580(%r14), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x3020(%rax,%rcx), %xmm0
movq -0x50(%rbp), %rax
leal -0x1(%rax), %ebx
xorps %xmm1, %xmm1
cvtsi2sd %ebx, %xmm1
callq 0x98a0
movsd %xmm0, -0x60(%rbp)
callq 0x450ba
movsd 0x3b1a6(%rip), %xmm0    # 0x6b058
movapd %xmm0, %xmm1
subsd -0x60(%rbp), %xmm1
movq 0x5c38(%rax), %rax
movslq 0x2b4580(%r14), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
subsd 0x3020(%rax,%rcx), %xmm0
divsd %xmm0, %xmm1
movsd 0x2b4598(%r14), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x2b45a0(%r14), %xmm1
movsd 0x2b45d8(%r14), %xmm2
subsd %xmm0, %xmm2
movsd 0x2b45e0(%r14), %xmm0
subsd %xmm1, %xmm0
movsd %xmm2, -0x70(%rbp)
movapd %xmm2, %xmm1
subsd 0x2b45b0(%r14), %xmm1
movsd %xmm0, -0x68(%rbp)
movapd %xmm0, %xmm2
subsd 0x2b45b8(%r14), %xmm2
movapd %xmm1, %xmm0
andpd 0x3b0d3(%rip), %xmm0    # 0x6b010
movsd 0x3b0fb(%rip), %xmm3    # 0x6b040
ucomisd %xmm0, %xmm3
jbe 0x2ff69
movapd %xmm2, %xmm3
andpd 0x3b0b9(%rip), %xmm3    # 0x6b010
xorpd %xmm0, %xmm0
movsd 0x3b0dd(%rip), %xmm4    # 0x6b040
ucomisd %xmm3, %xmm4
ja 0x2ff82
movapd %xmm2, %xmm0
callq 0x90d0
mulsd 0x3b0ce(%rip), %xmm0    # 0x6b048
divsd 0x3b0ce(%rip), %xmm0    # 0x6b050
movsd 0x3b0ee(%rip), %xmm1    # 0x6b078
ucomisd %xmm0, %xmm1
jbe 0x2ffac
movsd 0x3b0d8(%rip), %xmm1    # 0x6b070
movsd 0x3b0d8(%rip), %xmm2    # 0x6b078
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
ja 0x2ffa0
jmp 0x2ffd0
ucomisd 0x3c954(%rip), %xmm0    # 0x6c908
jb 0x2ffd0
movsd 0x3b0aa(%rip), %xmm1    # 0x6b068
movsd 0x3c942(%rip), %xmm2    # 0x6c908
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x2ffc6
movb $0x1, %r14b
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x3, -0x50(%rbp)
movq %r15, -0x48(%rbp)
jg 0x300ee
cvttsd2si %xmm0, %eax
cltq
leaq (%rax,%rax,2), %r15
movq %r15, %rax
shlq $0x4, %rax
movq -0x38(%rbp), %rdi
addq %rdi, %rax
movslq %ebx, %rbx
movq %rbx, %rcx
shlq $0x4, %rcx
movl 0x2b5018(%rcx,%rax), %edx
cmpl 0x8(%rdi), %edx
jne 0x300ea
movl 0x4(%rdi), %edx
cmpl %edx, 0x2b5014(%rcx,%rax)
jne 0x300ea
leaq (%rcx,%rax), %rdx
addq $0x2b5010, %rdx         # imm = 0x2B5010
movl (%rdx), %esi
cmpl (%rdi), %esi
jne 0x300ea
movb 0xc(%rdx), %dl
cmpb 0xc(%rdi), %dl
jne 0x300ea
leaq (%rcx,%rax), %rsi
addq $0x2bf8d0, %rsi         # imm = 0x2BF8D0
callq 0x33702
testl %eax, %eax
movl %eax, -0x2c(%rbp)
js 0x300ea
movl %eax, %eax
movq -0x38(%rbp), %rdx
leaq (%rdx,%r15,8), %rcx
movsd 0x2b9390(%rcx,%rbx,8), %xmm1
subsd 0x2b45d0(%rdx), %xmm1
addsd 0x3c547(%rip), %xmm1    # 0x6c5d0
addsd 0x2b4568(%rdx), %xmm1
movsd 0x2b4d80(%rdx,%rax,8), %xmm0
movsd 0x2b4560(%rdx), %xmm2
divsd %xmm1, %xmm2
movsd 0x2b4570(%rdx), %xmm1
addsd 0x2b4558(%rdx), %xmm2
ucomisd %xmm2, %xmm1
ja 0x300d6
movq -0x38(%rbp), %rax
movsd 0x2b4578(%rax), %xmm3
ucomisd %xmm3, %xmm2
movapd %xmm2, %xmm1
jbe 0x300d6
movapd %xmm3, %xmm1
mulsd %xmm1, %xmm0
movsd 0x3c056(%rip), %xmm1    # 0x6c138
ucomisd %xmm0, %xmm1
seta %r14b
movq -0x48(%rbp), %r15
movq -0x38(%rbp), %rbx
leaq 0x2b45b0(%rbx), %rsi
testb %r14b, %r14b
movq %rsi, -0x130(%rbp)
je 0x3077c
movq %r13, -0x128(%rbp)
movq %r12, -0x40(%rbp)
movq %rbx, %rdi
callq 0x33702
movl -0x2c(%rbp), %esi
movq -0x50(%rbp), %rcx
addl $-0x2, %ecx
leaq 0x48(%rbx), %r15
leaq 0x558(%rbx), %rdx
movslq %ecx, %rcx
cltq
leaq 0x2b4870(%rbx), %rdi
movq %rdi, -0x60(%rbp)
leaq 0xe6fe8(%rbx), %rdi
movq %rdi, -0x138(%rbp)
xorl %r13d, %r13d
imulq $0xe6a90, %rcx, %rcx    # imm = 0xE6A90
addq %rdx, %rcx
imulq $0x144, %rax, %r12      # imm = 0x144
addq %rcx, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
movq %r12, -0x140(%rbp)
movl %esi, -0x2c(%rbp)
movq %r13, %r14
shlq $0x4, %r14
movsd -0x70(%rbp), %xmm1
subsd (%r15,%r14), %xmm1
movsd -0x68(%rbp), %xmm2
subsd 0x8(%r15,%r14), %xmm2
movapd %xmm1, %xmm0
andpd 0x3ae6d(%rip), %xmm0    # 0x6b010
movsd 0x3ae95(%rip), %xmm3    # 0x6b040
ucomisd %xmm0, %xmm3
jbe 0x301cf
movapd %xmm2, %xmm0
andpd 0x3ae53(%rip), %xmm0    # 0x6b010
movsd 0x3ae7b(%rip), %xmm3    # 0x6b040
ucomisd %xmm0, %xmm3
xorpd %xmm0, %xmm0
ja 0x301e8
movapd %xmm2, %xmm0
callq 0x90d0
mulsd 0x3ae68(%rip), %xmm0    # 0x6b048
divsd 0x3ae68(%rip), %xmm0    # 0x6b050
movsd 0x3ae88(%rip), %xmm1    # 0x6b078
ucomisd %xmm0, %xmm1
jbe 0x3044a
addsd 0x3ae6e(%rip), %xmm0    # 0x6b070
movsd 0x3ae6e(%rip), %xmm1    # 0x6b078
ucomisd %xmm0, %xmm1
ja 0x301fa
movsd 0x2b4d80(%rbx,%r13,8), %xmm1
ucomisd 0x3bf16(%rip), %xmm1    # 0x6c138
jbe 0x30462
divsd 0x3b530(%rip), %xmm0    # 0x6b760
cvttsd2si %xmm0, %eax
cltq
imulq $0x6684, %rax, %rax     # imm = 0x6684
addq %r12, %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r13,4), %xmm0
movsd 0x2b45d0(%rbx), %xmm1
addsd 0x3c37f(%rip), %xmm1    # 0x6c5d8
ucomisd %xmm1, %xmm0
jbe 0x30462
addq %r15, %r14
movsd (%r14), %xmm0
movsd %xmm0, -0xa8(%rbp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd 0x2b4598(%rbx), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd 0x2b45a0(%rbx), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x2b45b0(%rbx), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd 0x2b45b8(%rbx), %xmm0
movsd %xmm0, -0x80(%rbp)
callq 0x4a75c
movsd -0xa0(%rbp), %xmm2
addsd -0x88(%rbp), %xmm2
subsd -0x80(%rbp), %xmm2
movsd -0xa8(%rbp), %xmm1
addsd -0x98(%rbp), %xmm1
subsd -0x90(%rbp), %xmm1
movsd 0x30e0(%rax), %xmm0
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm2
movsd %xmm1, -0x120(%rbp)
movsd %xmm2, -0x118(%rbp)
cmpl $0x2, -0x50(%rbp)
jne 0x30477
movsd -0x70(%rbp), %xmm1
subsd (%r14), %xmm1
movsd -0x68(%rbp), %xmm0
subsd 0x8(%r14), %xmm0
movapd %xmm1, %xmm2
andpd 0x3acd5(%rip), %xmm2    # 0x6b010
movsd 0x3acfd(%rip), %xmm3    # 0x6b040
ucomisd %xmm2, %xmm3
jbe 0x30367
movapd %xmm0, %xmm3
andpd 0x3acbb(%rip), %xmm3    # 0x6b010
xorpd %xmm2, %xmm2
movsd 0x3acdf(%rip), %xmm4    # 0x6b040
ucomisd %xmm3, %xmm4
ja 0x30380
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x3acd0(%rip), %xmm2    # 0x6b048
divsd 0x3acd0(%rip), %xmm2    # 0x6b050
movsd %xmm2, -0xf0(%rbp)
movq -0x60(%rbp), %rax
leaq (%rax,%r13,8), %rcx
movq %rbx, %rdi
leaq -0x120(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x3349a
movsd %xmm0, -0x58(%rbp)
movq -0x38(%rbp), %rbx
movsd 0x2b45d0(%rbx), %xmm1
movapd %xmm1, %xmm2
addsd 0x3c215(%rip), %xmm2    # 0x6c5d8
xorpd %xmm0, %xmm0
movsd -0x58(%rbp), %xmm3
ucomisd %xmm2, %xmm3
movl -0x2c(%rbp), %esi
movq -0x140(%rbp), %r12
jbe 0x30432
subsd %xmm1, %xmm3
addsd 0x3c1e8(%rip), %xmm3    # 0x6c5d0
addsd 0x2b4568(%rbx), %xmm3
movsd 0x2b4560(%rbx), %xmm1
divsd %xmm3, %xmm1
movsd 0x2b4570(%rbx), %xmm0
addsd 0x2b4558(%rbx), %xmm1
ucomisd %xmm1, %xmm0
ja 0x30428
movsd 0x2b4578(%rbx), %xmm2
ucomisd %xmm2, %xmm1
movapd %xmm1, %xmm0
jbe 0x30428
movapd %xmm2, %xmm0
mulsd 0x2b4d80(%rbx,%r13,8), %xmm0
movsd -0x78(%rbp), %xmm1
ucomisd %xmm1, %xmm0
cmoval %r13d, %esi
maxsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0x30465
ucomisd 0x3c4b6(%rip), %xmm0    # 0x6c908
jb 0x30210
addsd 0x3ac08(%rip), %xmm0    # 0x6b068
jmp 0x3044a
movl -0x2c(%rbp), %esi
incq %r13
cmpq $0x51, %r13
jne 0x30176
jmp 0x30783
movapd %xmm1, %xmm0
movapd %xmm2, %xmm1
addsd (%r14), %xmm0
movsd %xmm0, -0xa8(%rbp)
addsd 0x8(%r14), %xmm1
movsd %xmm1, -0xa0(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
imulq $0x144, %r13, %rax      # imm = 0x144
addq -0x138(%rbp), %rax
movq %rax, -0x148(%rbp)
xorl %r12d, %r12d
movq %r12, %rbx
shlq $0x4, %rbx
movsd (%r15,%rbx), %xmm0
subsd -0xa8(%rbp), %xmm0
movsd 0x8(%r15,%rbx), %xmm1
subsd -0xa0(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x3ab9d(%rip), %xmm0    # 0x6b090
jb 0x304fb
sqrtsd %xmm0, %xmm0
jmp 0x30500
callq 0x93c0
movq -0x60(%rbp), %rax
movsd (%rax,%r13,8), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x30756
callq 0x450ba
addq %r15, %rbx
movq 0x5c38(%rax), %rax
movq -0x38(%rbp), %rdx
movslq 0x2b4580(%rdx), %rcx
imulq $0x3700, %rcx, %rcx     # imm = 0x3700
movsd 0x2b4598(%rdx), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd 0x2b45a0(%rdx), %xmm0
movsd %xmm0, -0x98(%rbp)
movsd 0x3020(%rax,%rcx), %xmm0
movsd %xmm0, -0x160(%rbp)
movsd (%rbx), %xmm0
movsd %xmm0, -0x88(%rbp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, -0x158(%rbp)
movsd (%r14), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, -0x150(%rbp)
callq 0x4a75c
movsd -0x98(%rbp), %xmm1
movsd -0x160(%rbp), %xmm0
mulsd %xmm0, %xmm1
addsd -0x158(%rbp), %xmm1
subsd -0x150(%rbp), %xmm1
movsd -0x90(%rbp), %xmm2
mulsd %xmm0, %xmm2
addsd -0x88(%rbp), %xmm2
subsd -0x80(%rbp), %xmm2
movsd 0x30e0(%rax), %xmm0
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm1
movsd %xmm2, -0xf0(%rbp)
movsd %xmm1, -0xe8(%rbp)
movq -0x50(%rbp), %rax
cmpl $0x4, %eax
je 0x3069f
cmpl $0x3, %eax
jne 0x30756
movsd -0x70(%rbp), %xmm1
subsd (%rbx), %xmm1
movsd -0x68(%rbp), %xmm0
subsd 0x8(%rbx), %xmm0
movapd %xmm1, %xmm2
andpd 0x3a9e2(%rip), %xmm2    # 0x6b010
movsd 0x3aa0a(%rip), %xmm3    # 0x6b040
ucomisd %xmm2, %xmm3
jbe 0x3065a
movapd %xmm0, %xmm3
andpd 0x3a9c8(%rip), %xmm3    # 0x6b010
xorpd %xmm2, %xmm2
movsd 0x3a9ec(%rip), %xmm4    # 0x6b040
ucomisd %xmm3, %xmm4
ja 0x30673
callq 0x90d0
movapd %xmm0, %xmm2
mulsd 0x3a9dd(%rip), %xmm2    # 0x6b048
divsd 0x3a9dd(%rip), %xmm2    # 0x6b050
movsd %xmm2, -0x168(%rbp)
movq -0x60(%rbp), %rax
leaq (%rax,%r12,8), %rcx
movq -0x38(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x168(%rbp), %rdx
callq 0x3349a
jmp 0x3074c
movsd -0x70(%rbp), %xmm1
subsd (%rbx), %xmm1
movsd -0x68(%rbp), %xmm2
subsd 0x8(%rbx), %xmm2
movapd %xmm1, %xmm0
andpd 0x3a952(%rip), %xmm0    # 0x6b010
movsd 0x3a97a(%rip), %xmm3    # 0x6b040
ucomisd %xmm0, %xmm3
jbe 0x306ea
movapd %xmm2, %xmm3
andpd 0x3a938(%rip), %xmm3    # 0x6b010
xorpd %xmm0, %xmm0
movsd 0x3a95c(%rip), %xmm4    # 0x6b040
ucomisd %xmm3, %xmm4
ja 0x30703
movapd %xmm2, %xmm0
callq 0x90d0
mulsd 0x3a94d(%rip), %xmm0    # 0x6b048
divsd 0x3a94d(%rip), %xmm0    # 0x6b050
movsd 0x3a96d(%rip), %xmm1    # 0x6b078
ucomisd %xmm0, %xmm1
jbe 0x30768
addsd 0x3a957(%rip), %xmm0    # 0x6b070
movsd 0x3a957(%rip), %xmm1    # 0x6b078
ucomisd %xmm0, %xmm1
ja 0x30711
divsd 0x3b031(%rip), %xmm0    # 0x6b760
cvttsd2si %xmm0, %eax
cltq
imulq $0x6684, %rax, %rax     # imm = 0x6684
addq -0x148(%rbp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax,%r12,4), %xmm0
maxsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
incq %r12
cmpq $0x51, %r12
jne 0x304bb
jmp 0x303ab
ucomisd 0x3c198(%rip), %xmm0    # 0x6c908
jb 0x30727
addsd 0x3a8ee(%rip), %xmm0    # 0x6b068
jmp 0x30768
xorl %eax, %eax
movl -0x2c(%rbp), %esi
jmp 0x3079e
xorpd %xmm0, %xmm0
ucomisd -0x78(%rbp), %xmm0
seta %al
movq -0x40(%rbp), %r12
movq -0x128(%rbp), %r13
movq -0x48(%rbp), %r15
testb %al, %al
je 0x307af
movl $0x3, 0x4(%r13)
jmp 0x30859
movq -0x50(%rbp), %rax
movl %eax, 0x4(%r13)
movb $0x0, (%r13)
testl %esi, %esi
js 0x308a5
movl %esi, %eax
shlq $0x4, %rax
movq -0x38(%rbp), %rsi
movsd 0x2b4598(%rsi), %xmm0
movsd 0x2b45a0(%rsi), %xmm1
addsd 0x48(%rsi,%rax), %xmm0
addsd 0x50(%rsi,%rax), %xmm1
leaq 0x2b45c0(%rsi), %r8
leaq -0xf0(%rbp), %r9
movsd %xmm0, (%r9)
movsd %xmm1, 0x8(%r9)
movl $0x1, (%rsp)
leaq -0x120(%rbp), %rdi
movq %r15, %rdx
movq -0x130(%rbp), %rcx
callq 0x315de
movupd -0x120(%rbp), %xmm0
movupd -0x110(%rbp), %xmm1
movupd -0x100(%rbp), %xmm2
movapd %xmm2, -0xc0(%rbp)
movapd %xmm1, -0xd0(%rbp)
movapd %xmm0, -0xe0(%rbp)
cmpb $0x1, -0xe0(%rbp)
jne 0x308a5
movb $0x1, (%r13)
movq %r12, %rdi
callq 0x335ec
movq 0x38(%r13), %rax
movq 0x48(%r13), %rcx
addq $-0x30, %rcx
cmpq %rcx, %rax
je 0x308ba
leaq 0x38(%r13), %rcx
movapd -0xe0(%rbp), %xmm0
movapd -0xd0(%rbp), %xmm1
movapd -0xc0(%rbp), %xmm2
movupd %xmm2, 0x20(%rax)
movupd %xmm1, 0x10(%rax)
movupd %xmm0, (%rax)
addq $0x30, (%rcx)
movq %r13, %rax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0xe0(%rbp), %rsi
movq %r12, %rdi
callq 0x33afc
jmp 0x308a5
jmp 0x308db
jmp 0x308db
jmp 0x308db
jmp 0x308db
jmp 0x308e7
jmp 0x308db
jmp 0x308e7
jmp 0x308db
movq %r12, -0x40(%rbp)
jmp 0x308e7
jmp 0x308e7
jmp 0x308e7
jmp 0x308e7
movq %rax, %rbx
movq -0x40(%rbp), %rdi
callq 0x33aa2
movq %rbx, %rdi
callq 0x98b0
nop