// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl %r8d, -0x50(%rbp)
movl %ecx, %r13d
movaps %xmm2, -0xb0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm0, -0x70(%rbp)
movq %rdx, %rbx
movq %rsi, %r15
movb $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdx)
movups %xmm0, 0x14(%rdx)
movups %xmm0, 0x20(%rdx)
testl %ecx, %ecx
jne 0x20658
andps 0x4a9ba(%rip), %xmm3    # 0x6b010
jmp 0x2065f
orps 0x4a9c1(%rip), %xmm3    # 0x6b020
movaps %xmm3, -0x40(%rbp)
movq %r15, %rdi
callq 0xe85a
movq %rax, %rdi
movaps -0x40(%rbp), %xmm0
callq 0x470e2
movq %r15, %rdi
callq 0x134ce
movq %rax, %r12
movq 0x68(%rax), %r14
movl $0x1, -0x150(%rbp)
cmpl $0x0, 0x668(%r14)
jle 0x206a0
addq $0x18, %r14
jmp 0x206c4
leaq -0x150(%rbp), %rsi
movq %r14, %rdi
callq 0xf062
leaq -0x150(%rbp), %rax
movslq (%rax), %rax
shlq $0x4, %rax
addq %rax, %r14
addq $0x8, %r14
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
subsd -0x70(%rbp), %xmm0
movapd -0x90(%rbp), %xmm3
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x206fc
sqrtsd %xmm0, %xmm0
jmp 0x20709
callq 0x93c0
movapd -0x90(%rbp), %xmm3
movsd %xmm0, -0x58(%rbp)
movsd (%r14), %xmm1
movsd 0x8(%r14), %xmm0
testb %r13b, %r13b
je 0x207b3
subsd -0x70(%rbp), %xmm1
subsd %xmm3, %xmm0
movapd 0x4a8dd(%rip), %xmm2    # 0x6b010
movapd %xmm1, %xmm4
andpd %xmm2, %xmm4
movsd 0x4a8fd(%rip), %xmm3    # 0x6b040
ucomisd %xmm4, %xmm3
jbe 0x20757
andpd %xmm0, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm2, %xmm3
ja 0x20770
callq 0x90d0
movapd %xmm0, %xmm4
mulsd 0x4a8e0(%rip), %xmm4    # 0x6b048
divsd 0x4a8e0(%rip), %xmm4    # 0x6b050
movapd %xmm4, -0x40(%rbp)
movq %r15, %rdi
callq 0xe85a
movapd -0x40(%rbp), %xmm2
subsd 0xb0(%rax), %xmm2
movsd 0x4a8ce(%rip), %xmm0    # 0x6b060
ucomisd %xmm2, %xmm0
jbe 0x20849
movsd 0x4a8cc(%rip), %xmm1    # 0x6b070
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x207a4
jmp 0x20893
movapd -0x70(%rbp), %xmm2
subsd %xmm1, %xmm2
movapd %xmm3, %xmm1
subsd %xmm0, %xmm1
movapd 0x4a844(%rip), %xmm5    # 0x6b010
movapd %xmm2, %xmm4
andpd %xmm5, %xmm4
movsd 0x4a864(%rip), %xmm3    # 0x6b040
ucomisd %xmm4, %xmm3
jbe 0x207f0
andpd %xmm1, %xmm5
xorpd %xmm0, %xmm0
ucomisd %xmm5, %xmm3
ja 0x2080d
movapd %xmm1, %xmm0
movapd %xmm2, %xmm1
callq 0x90d0
mulsd 0x4a843(%rip), %xmm0    # 0x6b048
divsd 0x4a843(%rip), %xmm0    # 0x6b050
movapd %xmm0, -0x40(%rbp)
movq %r15, %rdi
callq 0xe85a
movapd -0x40(%rbp), %xmm2
subsd 0xb0(%rax), %xmm2
movsd 0x4a831(%rip), %xmm0    # 0x6b060
ucomisd %xmm2, %xmm0
jbe 0x2086f
movsd 0x4a833(%rip), %xmm1    # 0x6b070
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0x2083d
jmp 0x20893
ucomisd 0x4a7f7(%rip), %xmm2    # 0x6b048
jb 0x20893
movsd 0x4a80d(%rip), %xmm0    # 0x6b068
movsd 0x4a7e5(%rip), %xmm1    # 0x6b048
addsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0x20863
jmp 0x20893
ucomisd 0x4a7d1(%rip), %xmm2    # 0x6b048
jb 0x20893
movsd 0x4a7e7(%rip), %xmm0    # 0x6b068
movsd 0x4a7bf(%rip), %xmm1    # 0x6b048
addsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0x20889
movapd %xmm2, -0x40(%rbp)
movq %r15, -0x118(%rbp)
movq %rbx, -0x30(%rbp)
movapd -0xb0(%rbp), %xmm0
ucomisd 0x4a78d(%rip), %xmm0    # 0x6b040
jbe 0x208e5
movapd -0xb0(%rbp), %xmm0
divsd -0x58(%rbp), %xmm0
mulsd 0x4afae(%rip), %xmm0    # 0x6b878
movapd 0x4a73e(%rip), %xmm1    # 0x6b010
andpd %xmm0, %xmm1
ucomisd 0x4b9f2(%rip), %xmm1    # 0x6c2d0
jae 0x208e5
callq 0x9840
callq 0x450ba
movq 0x5c38(%rax), %rax
movq %rax, -0xe0(%rbp)
movslq 0x114(%r12), %rax
movq %rax, -0xd0(%rbp)
callq 0x450ba
movq 0x5c38(%rax), %rax
movq %rax, -0xa0(%rbp)
movslq 0x114(%r12), %r13
callq 0x450ba
movq 0x5c38(%rax), %r15
movslq 0x114(%r12), %r14
movsd 0x30(%r12), %xmm0
movq %r12, %rbx
movsd 0x38(%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x20963
sqrtsd %xmm0, %xmm0
jmp 0x20968
callq 0x93c0
movapd -0x40(%rbp), %xmm3
cmpb $0x0, -0x50(%rbp)
je 0x2098b
movq -0x30(%rbp), %rax
movl $0x1, 0x4(%rax)
movsd %xmm3, 0x18(%rax)
movb $0x1, (%rax)
jmp 0x21287
movsd 0x4b975(%rip), %xmm1    # 0x6c308
ucomisd %xmm0, %xmm1
ja 0x20973
movapd 0x4a66f(%rip), %xmm4    # 0x6b010
andpd %xmm3, %xmm4
movsd 0x158(%rbx), %xmm5
movsd 0x4b94b(%rip), %xmm1    # 0x6c300
movapd %xmm5, %xmm2
addsd %xmm1, %xmm2
cmpltsd -0x58(%rbp), %xmm1
andpd %xmm1, %xmm2
andnpd %xmm5, %xmm1
orpd %xmm2, %xmm1
movapd -0xb0(%rbp), %xmm2
cmpltsd 0x4a660(%rip), %xmm2    # 0x6b040
andpd %xmm2, %xmm1
andnpd %xmm5, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, -0xb0(%rbp)
ucomisd %xmm4, %xmm2
jae 0x20973
movapd %xmm0, -0xf0(%rbp)
imulq $0x3700, -0xd0(%rbp), %rax # imm = 0x3700
imulq $0x3700, %r13, %rcx     # imm = 0x3700
imulq $0x3700, %r14, %rdx     # imm = 0x3700
movq -0xe0(%rbp), %rsi
leaq (%rsi,%rax), %r12
addq $0x3030, %r12           # imm = 0x3030
movq -0xa0(%rbp), %rax
leaq (%rax,%rcx), %r13
addq $0x3028, %r13           # imm = 0x3028
leaq (%r15,%rdx), %rax
addq $0x3020, %rax           # imm = 0x3020
movq %rbx, %r14
addq $0x30, %r14
movsd 0x4ad04(%rip), %xmm0    # 0x6b760
movapd %xmm4, -0xd0(%rbp)
addsd %xmm4, %xmm0
movsd 0x4a5d8(%rip), %xmm1    # 0x6b048
divsd %xmm0, %xmm1
addsd 0x4a61c(%rip), %xmm1    # 0x6b098
divsd (%r13), %xmm1
movq %rax, -0x58(%rbp)
divsd (%rax), %xmm1
movsd 0x60(%rbx), %xmm0
minsd %xmm1, %xmm0
movapd %xmm0, -0x50(%rbp)
callq 0x4a75c
movsd 0x3028(%rax), %xmm0
addsd 0x4a5ab(%rip), %xmm0    # 0x6b058
movapd -0x50(%rbp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, -0x50(%rbp)
movq %r14, %rdi
callq 0xe804
subsd 0xb0(%rbx), %xmm0
movsd 0x4a58d(%rip), %xmm3    # 0x6b060
ucomisd %xmm0, %xmm3
movq %r13, -0xb8(%rbp)
jbe 0x20afc
movsd 0x4a588(%rip), %xmm1    # 0x6b070
movapd -0xf0(%rbp), %xmm4
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm3
ja 0x20af0
jmp 0x20b32
ucomisd 0x4a544(%rip), %xmm0    # 0x6b048
jae 0x20b10
movapd -0xf0(%rbp), %xmm4
jmp 0x20b32
movsd 0x4a550(%rip), %xmm1    # 0x6b068
movsd 0x4a528(%rip), %xmm2    # 0x6b048
movapd -0xf0(%rbp), %xmm4
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x20b28
andpd 0x4a4d6(%rip), %xmm0    # 0x6b010
movapd %xmm4, %xmm1
xorpd 0x4a4da(%rip), %xmm1    # 0x6b020
movsd 0x4a562(%rip), %xmm3    # 0x6b0b0
cmpltsd %xmm0, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm4, %xmm3
orpd %xmm1, %xmm3
movapd %xmm3, -0xe0(%rbp)
movsd (%r12), %xmm0
movsd %xmm0, -0xa0(%rbp)
callq 0x4a75c
movsd -0xa0(%rbp), %xmm1
mulsd 0x33c0(%rax), %xmm1
movapd -0xe0(%rbp), %xmm0
subsd %xmm1, %xmm0
movapd -0x50(%rbp), %xmm1
xorpd 0x4a47d(%rip), %xmm1    # 0x6b020
maxsd %xmm0, %xmm1
movapd %xmm1, -0xa0(%rbp)
movq %r12, -0x110(%rbp)
movsd (%r12), %xmm0
movsd %xmm0, -0x78(%rbp)
callq 0x4a75c
movsd -0x78(%rbp), %xmm0
mulsd 0x33c0(%rax), %xmm0
addsd -0xe0(%rbp), %xmm0
movapd %xmm0, %xmm1
movapd -0x50(%rbp), %xmm0
minsd %xmm1, %xmm0
movapd %xmm0, -0x50(%rbp)
movups 0x8(%rbx), %xmm0
movq %rbx, %r15
leaq -0x150(%rbp), %r12
movaps %xmm0, (%r12)
movsd 0xb0(%rbx), %xmm0
movsd %xmm0, 0x10(%r12)
movq -0x58(%rbp), %rbx
movsd (%rbx), %xmm1
addsd 0x4a439(%rip), %xmm1    # 0x6b058
mulsd -0xa0(%rbp), %xmm1
movsd %xmm1, -0x78(%rbp)
mulsd 0x4a41c(%rip), %xmm0    # 0x6b050
divsd 0x4a40c(%rip), %xmm0    # 0x6b048
leaq -0x178(%rbp), %r14
leaq -0x108(%rbp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r13), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd (%r14), %xmm1
addsd (%r12), %xmm0
addsd 0x8(%r12), %xmm1
leaq -0x130(%rbp), %rax
movsd %xmm0, (%rax)
movsd %xmm1, 0x8(%rax)
movsd (%rbx), %xmm0
addsd 0x4a3c6(%rip), %xmm0    # 0x6b058
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd 0x4a3ac(%rip), %xmm0    # 0x6b050
mulsd 0x10(%r12), %xmm0
divsd 0x4a395(%rip), %xmm0    # 0x6b048
movq %r14, %rdi
movq %r13, %rsi
callq 0x92d0
movsd (%r13), %xmm0
movsd -0x78(%rbp), %xmm1
mulsd %xmm1, %xmm0
mulsd (%r14), %xmm1
addsd (%r12), %xmm0
addsd 0x8(%r12), %xmm1
leaq -0x160(%rbp), %r13
movsd %xmm0, (%r13)
movsd %xmm1, 0x8(%r13)
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2276a
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movapd 0x4a30b(%rip), %xmm2    # 0x6b020
xorpd %xmm0, %xmm2
movsd %xmm1, (%r14)
mulsd -0x70(%rbp), %xmm1
mulsd -0x90(%rbp), %xmm0
subsd %xmm1, %xmm0
movlpd %xmm2, 0x8(%r14)
movsd %xmm0, 0x10(%r14)
leaq -0x178(%rbp), %rdi
leaq -0x130(%rbp), %rsi
movq %r13, %rdx
callq 0x15bea
testb %al, %al
je 0x20daa
movsd 0xb0(%r15), %xmm0
subsd -0x40(%rbp), %xmm0
movsd 0x4a2f5(%rip), %xmm3    # 0x6b060
ucomisd %xmm0, %xmm3
movq %r15, %r12
jbe 0x20e46
movsd 0x4a2f0(%rip), %xmm1    # 0x6b070
movapd -0x90(%rbp), %xmm2
movq -0x30(%rbp), %r15
movsd 0x4a2b4(%rip), %xmm5    # 0x6b048
movq -0xb8(%rbp), %r13
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm3
ja 0x20d9b
jmp 0x20e7d
leaq -0x150(%rbp), %r14
leaq -0x178(%rbp), %rsi
leaq -0x120(%rbp), %rdx
movq %r14, %rdi
callq 0x29940
movl %eax, %ebx
xorb $0x1, %bl
movsd 0x10(%r14), %xmm0
mulsd 0x4a276(%rip), %xmm0    # 0x6b050
divsd 0x4a266(%rip), %xmm0    # 0x6b048
leaq -0x108(%rbp), %r13
leaq -0x180(%rbp), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x92d0
leaq -0x120(%rbp), %rax
movsd (%rax), %xmm8
movsd (%r12), %xmm7
mulsd %xmm8, %xmm7
mulsd (%r13), %xmm8
addsd (%r14), %xmm7
addsd 0x8(%r14), %xmm8
movq %r15, %r12
movapd -0x90(%rbp), %xmm2
movq -0x30(%rbp), %r15
movsd 0x4a20e(%rip), %xmm5    # 0x6b048
movq -0xb8(%rbp), %r13
jmp 0x20ecf
ucomisd 0x4a1fa(%rip), %xmm0    # 0x6b048
movapd -0x90(%rbp), %xmm2
movq -0x30(%rbp), %r15
movsd 0x4a1e6(%rip), %xmm5    # 0x6b048
movq -0xb8(%rbp), %r13
jb 0x20e7d
movsd 0x4a1f5(%rip), %xmm1    # 0x6b068
addsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jae 0x20e73
andpd 0x4a18b(%rip), %xmm0    # 0x6b010
movsd 0x4a223(%rip), %xmm1    # 0x6b0b0
ucomisd %xmm0, %xmm1
jbe 0x20eaf
movsd -0x160(%rbp), %xmm7
movsd -0x158(%rbp), %xmm8
xorpd %xmm0, %xmm0
ucomisd -0x50(%rbp), %xmm0
jmp 0x20ecc
movsd -0x130(%rbp), %xmm7
movsd -0x128(%rbp), %xmm8
xorpd %xmm0, %xmm0
ucomisd -0xa0(%rbp), %xmm0
seta %bl
movapd %xmm7, %xmm0
subsd -0x70(%rbp), %xmm0
movapd %xmm8, %xmm1
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movsd %xmm7, -0x30(%rbp)
movsd %xmm8, -0x50(%rbp)
jb 0x20f08
sqrtsd %xmm0, %xmm0
jmp 0x20f20
callq 0x93c0
movsd -0x50(%rbp), %xmm8
movsd -0x30(%rbp), %xmm7
movsd 0x4a128(%rip), %xmm5    # 0x6b048
movapd -0xd0(%rbp), %xmm2
movapd -0xf0(%rbp), %xmm1
andpd 0x4a0d8(%rip), %xmm1    # 0x6b010
mulsd (%r13), %xmm1
movq -0x58(%rbp), %rax
mulsd (%rax), %xmm1
addsd 0x4a10a(%rip), %xmm1    # 0x6b058
movapd %xmm5, %xmm3
divsd %xmm1, %xmm3
movapd -0xb0(%rbp), %xmm1
addsd %xmm3, %xmm1
ucomisd %xmm2, %xmm1
jbe 0x21034
movq 0x68(%r12), %r14
movl $0x2, -0x108(%rbp)
cmpl $0x2, 0x668(%r14)
movsd %xmm0, -0xa0(%rbp)
jge 0x20fb3
leaq -0x108(%rbp), %rsi
movq %r14, %rdi
callq 0xf062
leaq -0x108(%rbp), %rax
movslq (%rax), %rax
shlq $0x4, %rax
addq %rax, %r14
addq $0x8, %r14
jmp 0x20fb7
addq $0x28, %r14
movapd -0x90(%rbp), %xmm2
movsd (%r14), %xmm0
movsd 0x8(%r14), %xmm1
subsd -0x70(%rbp), %xmm0
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x20fef
sqrtsd %xmm0, %xmm0
jmp 0x20ff4
callq 0x93c0
movapd -0x40(%rbp), %xmm2
movsd 0x4a047(%rip), %xmm5    # 0x6b048
movapd -0xd0(%rbp), %xmm1
movsd -0x30(%rbp), %xmm7
movsd -0x50(%rbp), %xmm8
movsd -0xa0(%rbp), %xmm3
ucomisd 0x4b2ec(%rip), %xmm1    # 0x6c310
ja 0x21275
ucomisd %xmm0, %xmm3
ja 0x21275
movapd %xmm7, %xmm0
subsd 0x8(%r12), %xmm0
movapd %xmm8, %xmm1
subsd 0x10(%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x21068
sqrtsd %xmm0, %xmm9
jmp 0x21085
callq 0x93c0
movsd -0x50(%rbp), %xmm8
movsd -0x30(%rbp), %xmm7
movsd 0x49fc8(%rip), %xmm5    # 0x6b048
movapd %xmm0, %xmm9
movapd -0x90(%rbp), %xmm4
testb %bl, %bl
je 0x2109a
xorpd 0x49f86(%rip), %xmm9    # 0x6b020
movq -0x58(%rbp), %rax
movsd (%rax), %xmm0
movapd %xmm0, %xmm1
movsd 0x49faa(%rip), %xmm6    # 0x6b058
addsd %xmm6, %xmm1
divsd %xmm1, %xmm9
movapd 0x49f51(%rip), %xmm3    # 0x6b010
movapd %xmm9, %xmm2
andpd %xmm3, %xmm2
mulsd (%r13), %xmm2
mulsd %xmm0, %xmm2
addsd %xmm6, %xmm2
movapd %xmm5, %xmm10
divsd %xmm2, %xmm10
movapd -0x70(%rbp), %xmm0
subsd %xmm7, %xmm0
subsd %xmm8, %xmm4
movapd %xmm0, %xmm1
andpd %xmm3, %xmm0
movsd 0x49f42(%rip), %xmm2    # 0x6b040
ucomisd %xmm0, %xmm2
jbe 0x21112
andpd %xmm4, %xmm3
xorpd %xmm0, %xmm0
ucomisd %xmm3, %xmm2
ja 0x21151
movapd %xmm4, %xmm0
movapd %xmm9, -0x70(%rbp)
movsd %xmm10, -0xb0(%rbp)
callq 0x90d0
movsd -0xb0(%rbp), %xmm10
movapd -0x70(%rbp), %xmm9
movsd 0x49f07(%rip), %xmm5    # 0x6b048
mulsd 0x49eff(%rip), %xmm0    # 0x6b048
divsd 0x49eff(%rip), %xmm0    # 0x6b050
addsd 0x4b1be(%rip), %xmm10   # 0x6c318
subsd 0xb0(%r12), %xmm0
movsd 0x49ef4(%rip), %xmm3    # 0x6b060
ucomisd %xmm0, %xmm3
jbe 0x2118b
movsd 0x49ef6(%rip), %xmm1    # 0x6b070
movapd -0x40(%rbp), %xmm2
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm3
ja 0x2117f
jmp 0x211ac
ucomisd 0x49eb5(%rip), %xmm0    # 0x6b048
movapd -0x40(%rbp), %xmm2
jb 0x211ac
movsd 0x49ec6(%rip), %xmm1    # 0x6b068
addsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jae 0x211a2
andpd 0x49e5c(%rip), %xmm0    # 0x6b010
ucomisd %xmm10, %xmm0
ja 0x21275
subsd -0xe0(%rbp), %xmm9
movq -0x110(%rbp), %rax
divsd (%rax), %xmm9
divsd 0x80(%r12), %xmm9
movapd %xmm9, -0x70(%rbp)
callq 0x4a75c
movsd 0x33c0(%rax), %xmm0
xorps 0x49e28(%rip), %xmm0    # 0x6b020
movaps %xmm0, -0x40(%rbp)
callq 0x4a75c
movsd 0x33c0(%rax), %xmm3
movapd -0x70(%rbp), %xmm0
maxsd -0x40(%rbp), %xmm0
minsd %xmm0, %xmm3
movl $0x2, 0x4(%r15)
movq %r12, %rsi
movsd -0x30(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd 0x49e0c(%rip), %xmm2    # 0x6b040
callq 0x2129a
movsd %xmm0, 0x20(%r15)
movq -0x118(%rbp), %rdi
callq 0xe85a
movsd 0x20(%r15), %xmm0
movq %rax, %rdi
callq 0x470e2
movsd %xmm0, 0x20(%r15)
andpd 0x49da9(%rip), %xmm0    # 0x6b010
xorpd %xmm2, %xmm2
ucomisd 0x49dcd(%rip), %xmm0    # 0x6b040
ja 0x21283
movl $0x1, 0x4(%r15)
movsd %xmm2, 0x18(%r15)
movb $0x1, (%r15)
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop