// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.cpp
// Function: Dasher::TurnDashPlaning(Agent&, AtomicAction&, Vector, double, double, bool, bool)
void Dasher::TurnDashPlaning(Agent &agent, AtomicAction &act, Vector target,
                             double buffer, double power, bool inverse,
                             bool turn_first) {
  act.Clear();

  power = inverse ? -fabs(power) : fabs(power);
  power = agent.GetSelf().CorrectDashPowerForStamina(power);

  PlayerState &self = agent.Self();
  const Vector &my_pre_pos = self.GetPredictedPos(1);
  double target_dist = my_pre_pos.Dist(target);
  AngleDeg target_ang =
      inverse
          ? GetNormalizeAngleDeg((my_pre_pos - target).Dir() -
                                 agent.GetSelf().GetBodyDir())
          : GetNormalizeAngleDeg((target - my_pre_pos).Dir() -
                                 agent.GetSelf().GetBodyDir()); //需要转身的角度

  // DT_none
  //处理转身问题,可能1dash + 1turn更好
  double bufang;
  if (buffer > FLOAT_EPS) {
    bufang = ASin(buffer / target_dist / 2) * 2;
    bufang = Max(10.0, bufang);
  } else {
    bufang = 0.0;
  }

  const double &effort = self.GetEffort();
  const double &accrate = self.GetDashPowerRate();
  const double &inertia_moment = self.GetInertiaMoment();
  const double &decay = self.GetPlayerDecay();
  const double &speedmax = self.GetEffectiveSpeedMax();
  const Vector &vel = self.GetVel();

  const double &facing = self.GetBodyDir();
  double speed = vel.Mod();

  double diffang = fabs(target_ang);
  double oneturnang = self.GetMaxTurnAngle();
  if (buffer < FLOAT_EPS && target_dist > 2.6) {
    oneturnang += 2.6;
  }

  if (turn_first || diffang <= oneturnang ||
      speed <
          0.04) { //由于噪声的存在，在非身体方向也有速度，调也调不过来，太小时不如直接转,0.04是一般队员的误差极值
    act.mType = CT_Turn;
    act.mTurnAngle = target_ang;
    act.mSucceed = true;
    return;
  } else {
    //计算1 dash + 1turn;
    //下面都是算dash到什么速度最好
    double mspd1 = (180.0 / (diffang + 10) - 1.0) /
                   inertia_moment; // 10是buf，不然容易调整后正好还转不过来
    double dash2spd = Min(mspd1 / decay, speedmax) /
                      (1 + ServerParam::instance().playerRand());

    if (fabs(GetNormalizeAngleDeg(vel.Dir() - facing)) > 90.0) {
      speed = -speed;
    }

    double spd_inf = Max(
        speed - accrate * ServerParam::instance().maxDashPower(), -dash2spd);
    double spd_sup =
        Min(speed + accrate * ServerParam::instance().maxDashPower(), dash2spd);
    Ray cur_r(self.GetPos(), facing);
    Vector pt_inf = cur_r.GetPoint(spd_inf * (1.0 + decay));
    Vector pt_sup = cur_r.GetPoint(spd_sup * (1.0 + decay));
    Vector pt;     //要取得点
    bool bnegtive; //要跑的点是不是在身后
    Line pdl = Line(cur_r).GetPerpendicular(target); //垂线
    if (pdl.IsPointInSameSide(pt_inf, pt_sup)) {
      if (fabs(GetNormalizeAngleDeg(facing - target_ang)) < 90.0) {
        pt = pt_sup;
        bnegtive = (spd_sup < 0);
      } else {
        pt = pt_inf;
        bnegtive = (spd_inf < 0);
      }
    } else {
      double dist;
      bnegtive = !cur_r.Intersection(pdl, dist); //垂点
      pt = cur_r.GetPoint(dist);
    }
    double dis =
        pt.Dist(target); //两个周期后离point的距离,用来compare with 2 turn
    double twoturnang =
        oneturnang + 180.0 / (1.0 + inertia_moment * fabs(speed) * decay);
    if (twoturnang > diffang) {
      const Vector &pt2 = self.GetPredictedPos(2);
      double dis2 = pt2.Dist(target);
      if (dis2 < dis || diffang > 102.6) { //一次转太大，误差也大不如直接2turn
        act.mType = CT_Turn;
        act.mTurnAngle = target_ang;
        act.mSucceed = true;
        return;
      }
    }
    double spd_need;
    if (bnegtive) {
      spd_need = -(pt - self.GetPos()).Mod() / (1.0 + decay);
    } else {
      spd_need = (pt - self.GetPos()).Mod() / (1.0 + decay);
    }
    //会总是dash而dash后又转不过来...,看着就像不拿球
    double turnang_after_dash =
        180.0 / (1.0 + inertia_moment * fabs(spd_need) * decay) - 5.0;
    if (GetAngleDegDiffer((target - pt).Dir(), facing) > turnang_after_dash) {
      act.mType = CT_Turn;
      act.mTurnAngle = target_ang;
      act.mSucceed = true;
      return;
    }
    double power = (spd_need - speed) / accrate / effort;

    power = MinMax(-ServerParam::instance().maxDashPower(), power,
                   ServerParam::instance().maxDashPower());

    // I over
    act.mType = CT_Dash;
    act.mDashPower = AdjustPowerForDash(self, pt, FLOAT_EPS, power);
    act.mDashPower = agent.GetSelf().CorrectDashPowerForStamina(act.mDashPower);
    if (fabs(act.mDashPower) > FLOAT_EPS) {
      act.mSucceed = true;
    } else {
      act.mType = CT_Turn; // power为零时就不要执行了，没意义
      act.mTurnAngle = 0.0;
      act.mSucceed = true;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movb %r8b, %al
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movsd %xmm2, -0x30(%rbp)
movsd %xmm3, -0x38(%rbp)
andb $0x1, %cl
movb %cl, -0x39(%rbp)
andb $0x1, %al
movb %al, -0x3a(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x28(%rbp), %rdi
callq 0x32480
testb $0x1, -0x39(%rbp)
je 0x30144
movsd -0x38(%rbp), %xmm0
movaps 0x90f41(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x298(%rbp)
jmp 0x3015c
movsd -0x38(%rbp), %xmm0
movaps 0x90f10(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd %xmm0, -0x298(%rbp)
movsd -0x298(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10590
movq %rax, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x7c940
movsd %xmm0, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1a3d0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x11fc0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1d6d0
movsd %xmm0, -0x58(%rbp)
testb $0x1, -0x39(%rbp)
je 0x30220
movq -0x50(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x110a0
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x2a8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10590
movq %rax, %rdi
callq 0x11170
movsd -0x2a8(%rbp), %xmm0
subsd (%rax), %xmm0
movsd 0x90e28(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x78(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x116b0
movsd %xmm0, -0x2a0(%rbp)
jmp 0x3028f
movq -0x50(%rbp), %rsi
leaq -0x10(%rbp), %rdi
callq 0x110a0
movsd %xmm0, -0x88(%rbp)
movsd %xmm1, -0x80(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x2b0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10590
movq %rax, %rdi
callq 0x11170
movsd -0x2b0(%rbp), %xmm0
subsd (%rax), %xmm0
movsd 0x90dbd(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x116b0
movsd %xmm0, -0x2a0(%rbp)
movsd -0x2a0(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x90d5f(%rip), %xmm1    # 0xc1008
ucomisd %xmm1, %xmm0
jbe 0x3031e
movsd -0x30(%rbp), %xmm0
divsd -0x58(%rbp), %xmm0
movsd 0x911ef(%rip), %xmm1    # 0xc14b0
divsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x32500
movsd 0x911cf(%rip), %xmm1    # 0xc14b0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd 0x91403(%rip), %xmm0    # 0xc16f8
movsd %xmm0, -0xa8(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x12a90
movsd (%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
jmp 0x30329
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x48(%rbp), %rdi
callq 0x11650
movq %rax, -0xb0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x11670
movq %rax, -0xb8(%rbp)
movq -0x48(%rbp), %rdi
callq 0x32590
movq %rax, -0xc0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x11740
movq %rax, -0xc8(%rbp)
movq -0x48(%rbp), %rdi
callq 0x1d810
movq %rax, -0xd0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x10a80
movq %rax, -0xd8(%rbp)
movq -0x48(%rbp), %rdi
callq 0x11170
movq %rax, -0xe0(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0xe8(%rbp)
movsd -0x60(%rbp), %xmm0
movaps 0x90ca7(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x325d0
movsd %xmm0, -0xf8(%rbp)
movsd 0x90c2a(%rip), %xmm0    # 0xc1008
ucomisd -0x30(%rbp), %xmm0
jbe 0x30410
movsd -0x58(%rbp), %xmm0
movsd 0x91e7e(%rip), %xmm1    # 0xc2270
ucomisd %xmm1, %xmm0
jbe 0x30410
movsd 0x91e70(%rip), %xmm0    # 0xc2270
addsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0xf8(%rbp)
testb $0x1, -0x3a(%rbp)
jne 0x3043e
movsd -0xf0(%rbp), %xmm1
movsd -0xf8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x3043e
movsd 0x91e44(%rip), %xmm0    # 0xc2278
ucomisd -0xe8(%rbp), %xmm0
jbe 0x30463
movq -0x28(%rbp), %rax
movl $0x1, 0x4(%rax)
movsd -0x60(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x30cec
movsd 0x9128d(%rip), %xmm1    # 0xc16f8
addsd -0xf0(%rbp), %xmm1
movsd 0x90bad(%rip), %xmm0    # 0xc1028
divsd %xmm1, %xmm0
movsd 0x90b89(%rip), %xmm1    # 0xc1010
subsd %xmm1, %xmm0
movq -0xc0(%rbp), %rax
divsd (%rax), %xmm0
movsd %xmm0, -0x100(%rbp)
movsd -0x100(%rbp), %xmm0
movq -0xc8(%rbp), %rax
divsd (%rax), %xmm0
movsd %xmm0, -0x110(%rbp)
movq -0xd0(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x12a60
movsd (%rax), %xmm0
movsd %xmm0, -0x2b8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x325f0
movsd -0x2b8(%rbp), %xmm0
movsd 0x90b1b(%rip), %xmm1    # 0xc1010
addsd (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x108(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x10520
movq -0xe0(%rbp), %rax
subsd (%rax), %xmm0
movsd 0x90b0c(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x118(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x116b0
movaps 0x90b21(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd 0x90af5(%rip), %xmm1    # 0xc1040
ucomisd %xmm1, %xmm0
jbe 0x30578
movsd -0xe8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xe8(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x2d0(%rbp)
movq -0xb8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x2d8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movsd -0x2d8(%rbp), %xmm0
movsd -0x2d0(%rbp), %xmm1
movsd (%rax), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x128(%rbp)
movsd -0x108(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x12a90
movsd (%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x2c0(%rbp)
movq -0xb8(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x2c8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movsd -0x2c8(%rbp), %xmm0
movsd -0x2c0(%rbp), %xmm1
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x140(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x12a60
movsd (%rax), %xmm0
movsd %xmm0, -0x138(%rbp)
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
movq -0xe0(%rbp), %rdx
leaq -0x158(%rbp), %rdi
callq 0x1fde0
movsd -0x120(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movsd 0x9093a(%rip), %xmm1    # 0xc1010
addsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x170(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x32610
movsd %xmm0, -0x168(%rbp)
movsd %xmm1, -0x160(%rbp)
movsd -0x138(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movsd 0x908f0(%rip), %xmm1    # 0xc1010
addsd (%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x188(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x32610
movsd %xmm0, -0x180(%rbp)
movsd %xmm1, -0x178(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1a0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1a8(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
callq 0x11a10
leaq -0x1e0(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x32670
leaq -0x1c8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0x32720
leaq -0x1c8(%rbp), %rdi
leaq -0x168(%rbp), %rsi
leaq -0x180(%rbp), %rdx
callq 0x1f130
testb $0x1, %al
jne 0x307d0
jmp 0x30880
movq -0xe0(%rbp), %rax
movsd (%rax), %xmm0
subsd -0x60(%rbp), %xmm0
movsd 0x90848(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0x1e8(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x116b0
movaps %xmm0, %xmm1
movaps 0x9085a(%rip), %xmm0    # 0xc1060
pand %xmm0, %xmm1
movsd 0x9082e(%rip), %xmm0    # 0xc1040
ucomisd %xmm1, %xmm0
jbe 0x3084c
movq -0x180(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x190(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x138(%rbp), %xmm0
seta %al
andb $0x1, %al
movb %al, -0x1a9(%rbp)
jmp 0x3087e
movq -0x168(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x160(%rbp), %rax
movq %rax, -0x190(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x120(%rbp), %xmm0
seta %al
andb $0x1, %al
movb %al, -0x1a9(%rbp)
jmp 0x308e3
leaq -0x158(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0x471c0
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x1a9(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x32610
movsd %xmm0, -0x200(%rbp)
movsd %xmm1, -0x1f8(%rbp)
movq -0x200(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1d6d0
movsd %xmm0, -0x208(%rbp)
movsd -0xf8(%rbp), %xmm0
movq -0xc0(%rbp), %rax
movsd (%rax), %xmm2
movsd -0xe8(%rbp), %xmm1
movaps 0x90743(%rip), %xmm3    # 0xc1060
pand %xmm3, %xmm1
mulsd %xmm1, %xmm2
movq -0xc8(%rbp), %rax
movsd (%rax), %xmm1
mulsd %xmm1, %xmm2
movsd 0x906d4(%rip), %xmm1    # 0xc1010
addsd %xmm1, %xmm2
movsd 0x906e0(%rip), %xmm1    # 0xc1028
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x210(%rbp)
movsd -0x210(%rbp), %xmm0
ucomisd -0xf0(%rbp), %xmm0
jbe 0x309ee
movq -0x48(%rbp), %rdi
movl $0x2, %esi
callq 0x11fc0
movq %rax, -0x218(%rbp)
movq -0x218(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1d6d0
movsd %xmm0, -0x220(%rbp)
movsd -0x220(%rbp), %xmm1
movsd -0x208(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x309c7
movsd -0xf0(%rbp), %xmm0
movsd 0x918bf(%rip), %xmm1    # 0xc2280
ucomisd %xmm1, %xmm0
jbe 0x309ec
movq -0x28(%rbp), %rax
movl $0x1, 0x4(%rax)
movsd -0x60(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x30cec
jmp 0x309ee
testb $0x1, -0x1a9(%rbp)
je 0x30a67
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0x110a0
movsd %xmm0, -0x238(%rbp)
movsd %xmm1, -0x230(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x104e0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0xc8(%rbp), %rax
movsd 0x905bb(%rip), %xmm1    # 0xc1010
addsd (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x228(%rbp)
jmp 0x30abe
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x198(%rbp), %rdi
callq 0x110a0
movsd %xmm0, -0x248(%rbp)
movsd %xmm1, -0x240(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x104e0
movq -0xc8(%rbp), %rax
movsd 0x90562(%rip), %xmm1    # 0xc1010
addsd (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x228(%rbp)
movq -0xc0(%rbp), %rax
movsd (%rax), %xmm1
movsd -0x228(%rbp), %xmm0
movaps 0x90588(%rip), %xmm2    # 0xc1060
pand %xmm2, %xmm0
mulsd %xmm0, %xmm1
movq -0xc8(%rbp), %rax
movsd (%rax), %xmm0
mulsd %xmm0, %xmm1
movsd 0x90519(%rip), %xmm0    # 0xc1010
addsd %xmm0, %xmm1
movsd 0x90525(%rip), %xmm0    # 0xc1028
divsd %xmm1, %xmm0
movsd 0x90e61(%rip), %xmm1    # 0xc1970
subsd %xmm1, %xmm0
movsd %xmm0, -0x250(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x110a0
movsd %xmm0, -0x268(%rbp)
movsd %xmm1, -0x260(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x258(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x1d7c0
ucomisd -0x250(%rbp), %xmm0
jbe 0x30b91
movq -0x28(%rbp), %rax
movl $0x1, 0x4(%rax)
movsd -0x60(%rbp), %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x30cec
movsd -0x228(%rbp), %xmm0
subsd -0xe8(%rbp), %xmm0
movq -0xb8(%rbp), %rax
divsd (%rax), %xmm0
movq -0xb0(%rbp), %rax
divsd (%rax), %xmm0
movsd %xmm0, -0x270(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x278(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x12b60
movq %rax, %rdx
leaq -0x278(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x12a20
movq -0x290(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x270(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, 0x4(%rax)
movq -0x48(%rbp), %rsi
movq -0x198(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x280(%rbp)
movsd -0x270(%rbp), %xmm3
movsd -0x288(%rbp), %xmm0
movsd -0x280(%rbp), %xmm1
movsd 0x90398(%rip), %xmm2    # 0xc1008
callq 0x30d00
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq -0x20(%rbp), %rdi
callq 0x10590
movq %rax, %rdi
movq -0x28(%rbp), %rax
movsd 0x20(%rax), %xmm0
callq 0x7c940
movq -0x28(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq -0x28(%rbp), %rax
movsd 0x20(%rax), %xmm0
movaps 0x903af(%rip), %xmm1    # 0xc1060
pand %xmm1, %xmm0
movsd 0x9034b(%rip), %xmm1    # 0xc1008
ucomisd %xmm1, %xmm0
jbe 0x30ccc
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x30cea
movq -0x28(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
jmp 0x30cec
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
nopw %cs:(%rax,%rax)