// File: /workspace/github_cpp_makefile_star2_O1/wrighteagle2d[P]wrighteaglebase/Debug/../src/Strategy.cpp
// Function: Strategy::BallPossessionAnalyse()
void Strategy::BallPossessionAnalyse() {
  const std::vector<Unum> &p2b =
      mInfoState.GetPositionInfo().GetClosePlayerToBall();
  const PlayerState &self = mAgent.GetSelf();
  BallState &ball = mAgent.World().Ball();

  //假设ball_free，拦截计算
  mIsBallFree = true;
  if (ServerParam::instance().pitchRectanglar().IsWithin(ball.GetPos())) {
    Ray ballcourse(ball.GetPos(), ball.GetVel().Dir());
    Vector outpos;
    if (ServerParam::instance().pitchRectanglar().Intersection(ballcourse,
                                                               outpos)) {
      double distance = outpos.Dist(ball.GetPos());
      mBallOutCycle = (int)ServerParam::instance().GetBallCycle(
          ball.GetVel().Mod(), distance);
    } else {
      mBallOutCycle = 0; // 可能没有交点，比如ball位置的x坐标正好为52.5
    }
  } else {
    mBallOutCycle = 0;
  }
  mController = self.GetUnum();

  //分析谁拿球
  //这里对场上所有其他队员计算拦截时都考虑了cyc_delay,得到的拦截周期是最小拦截周期,
  //认为自己该去拿球的情况是,最快的对手不比自己快太多,最快的队友是自己(暂时不考虑buf)

  const std::vector<OrderedIT> &OIT = mInfoState.GetInterceptInfo().GetOIT();
  std::vector<OrderedIT>::const_iterator it,
      itr_NULL = OIT.end(), pMyInfo = itr_NULL, pTmInfo = itr_NULL,
      pOppInfo = itr_NULL;

  mBallFreeCycleLeft = 150;

  for (it = OIT.begin(); it != OIT.end(); ++it) {
    if (it->mUnum < 0) {
      if (it->mUnum == -mWorldState.GetOpponentGoalieUnum())
        continue; //这里认为对方守门员不会去抢球，否则截球里面就不去抢打身后的球了
      if (it->mpInterceptInfo->mMinCycle < mMinOppInterCycle) {
        if (it->mCycleDelay < 16) {
          mMinOppInterCycle = it->mpInterceptInfo->mMinCycle;
          mBallFreeCycleLeft = Min(
              mBallFreeCycleLeft,
              int(mMinOppInterCycle +
                  it->mCycleDelay * 0.5)); // mOppMinInterCycle + it->cd *
                                           // 0.5是对截球周期的一个权衡的估计
          mFastestOpp = -it->mUnum;
        }
      }
      if (it->mpInterceptInfo->mMinCycle + it->mCycleDelay <
          mSureOppInterCycle) {
        mSureOppInterCycle =
            int(it->mpInterceptInfo->mMinCycle + it->mCycleDelay);
        mSureOpp = -it->mUnum;
        pOppInfo = it;
        if (!mWorldState.GetOpponent(mSureOpp).IsBodyDirValid() &&
            mWorldState.GetOpponent(mSureOpp).GetVel().Mod() <
                0.26) { //无法估计身体方向
          mSureOppInterCycle += 1;
        }
      }
    } else {
      if (it->mUnum == self.GetUnum()) {
        mMyInterCycle = it->mpInterceptInfo->mMinCycle;
        mBallFreeCycleLeft = Min(mBallFreeCycleLeft, mMyInterCycle);
        pMyInfo = it;
      } else {
        if (it->mpInterceptInfo->mMinCycle < mMinTmInterCycle) {
          mMinTmInterCycle = it->mpInterceptInfo->mMinCycle;
          mBallFreeCycleLeft =
              Min(mBallFreeCycleLeft,
                  int(mMinTmInterCycle + it->mCycleDelay * 0.5));
          mFastestTm = it->mUnum;
        }
        if (it->mpInterceptInfo->mMinCycle + it->mCycleDelay <
            mSureTmInterCycle) {
          mSureTmInterCycle =
              int(it->mpInterceptInfo->mMinCycle + it->mCycleDelay);
          mSureTm = it->mUnum;
          pTmInfo = it;
          if (!mWorldState.GetTeammate(mSureTm).IsBodyDirValid() &&
              mWorldState.GetTeammate(mSureTm).GetVel().Mod() <
                  0.26) { //无法估计身体方向
            mSureTmInterCycle += 1;
          }
        }
      }
    }
  }

  mSureInterCycle = Min(mSureOppInterCycle, mSureTmInterCycle);
  mSureInterCycle = Min(mSureInterCycle, mMyInterCycle);

  mMinIntercCycle = Min(mMinOppInterCycle, mMinTmInterCycle);
  mMinIntercCycle = Min(mMyInterCycle, mMinIntercCycle);

  if (mSureTm == 0) {
    mSureTm = mSelfState.GetUnum();
    mSureTmInterCycle = mMyInterCycle;
    mMinTmInterCycle = mMyInterCycle;
    mFastestTm = mSureTm;
  }

  if (mAgent.IsLastActiveBehaviorInActOf(BT_Dribble) &&
      mAgent.GetLastActiveBehaviorInAct()->mDetailType == BDT_Dribble_Fast &&
      (!mIsLastBallFree || mMyInterCycle < mSureInterCycle + 6 ||
       mWorldState.CurrentTime() - mLastBallFreeTime < 8)) {
    mController = mSelfState.GetUnum();
    if (pMyInfo != itr_NULL) {
      mBallInterPos = ball.GetPredictedPos(mMyInterCycle);
    }
  } else if (/*mMyInterCycle < mBallOutCycle + 2 &&*/ mMyInterCycle <=
             mSureInterCycle) { //自己是最快截到球的人
    mController = self.GetUnum();
    if (pTmInfo != itr_NULL && pTmInfo->mCycleDelay < 3) { // 2004_10
      if (IsMyControl()) {
        if (mSureTmInterCycle <= mMyInterCycle &&
            mMyInterCycle <= mSureOppInterCycle) {
          if (mWorldState.GetTeammate(mSureTm).GetVelDelay() == 0 ||
              (mWorldState.GetTeammate(mSureTm).GetPosDelay() == 0 &&
               mInfoState.GetPositionInfo().GetPlayerDistToPlayer(
                   mSureTm, mSelfState.GetUnum()) <
                   ServerParam::instance().visibleDistance() - 0.5)) {
            Vector ball_int_pos = mBallState.GetPredictedPos(mSureTmInterCycle);
            Vector pos = mWorldState.GetTeammate(mSureTm).GetPos();
            if (pos.Dist(ball_int_pos) <
                mWorldState.GetTeammate(mSureTm).GetKickableArea() -
                    Dasher::GETBALL_BUFFER) {
              mController = mSureTm;
            } else {
              Vector vel = mWorldState.GetTeammate(mSureTm).GetVel();
              double speed =
                  vel.Mod() * Cos(vel.Dir() - (ball_int_pos - pos).Dir());
              if (speed >
                  mWorldState.GetTeammate(mSureTm).GetEffectiveSpeedMax() *
                      mWorldState.GetTeammate(mSureTm).GetDecay() *
                      0.9) { //队友正在截球
                mController = mSureTm;
              }
            }
          }
        } else if (mSureTmInterCycle < mMyInterCycle &&
                   mMyInterCycle <= mMinOppInterCycle) {
          mController = mSureTm;
        }
      }
    }

    if (mController == mSelfState.GetUnum()) {
      if (pMyInfo != itr_NULL) {
        mBallInterPos = ball.GetPredictedPos(mMyInterCycle);
      } else if (mWorldState.CurrentTime().T() > 0) {
        PRINT_ERROR("bug here?");
      }
    } else {
      mBallInterPos = ball.GetPredictedPos(mSureTmInterCycle);
      mController = mSureTm;
    }
  } else { //自己拿不到球了,看看队友如何
    if (pTmInfo != itr_NULL &&
        mSureTmInterCycle <= mSureInterCycle) { //有可能拿到
      mBallInterPos = ball.GetPredictedPos(mSureTmInterCycle);
      mController = mSureTm;
    } else {
      if (pOppInfo != itr_NULL) {
        mBallInterPos = ball.GetPredictedPos(mSureOppInterCycle);
        mController = -mSureOpp;
      } else {
        if (mMinIntercCycle >
            mBallOutCycle + 5) { // because ball will be out of field
          mBallInterPos = ball.GetPredictedPos(mBallOutCycle);
          mController = 0;
        } else {
          mController = mSelfState.GetUnum();
          mBallInterPos = ball.GetPredictedPos(mMyInterCycle);
        }
      }
    }
  }

  int kickable_player =
      mInfoState.GetPositionInfo().GetTeammateWithBall(); //这里没有考虑buffer
  if (kickable_player == 0) {
    kickable_player = -mInfoState.GetPositionInfo()
                           .GetOpponentWithBall(); //这里没有考虑buffer
  }

  if (kickable_player != 0) {
    mController = kickable_player;
    mIsBallFree = false;
    mBallOutCycle = 1000;
  }

  //下面判断可踢情况
  //先判断能踢到球的队员
  //过程:看能踢到球的自己人有几个,多于一个按规则决定是谁踢,得到是否自己可以踢球,存为_pMem->ball_kickable
  //规则:球离谁基本战位点谁踢
  if (self.IsKickable()) {
    mController = self.GetUnum();
    mIsBallFree = false;
    mSureInterCycle = 0;
    mMinIntercCycle = 0;
    mMyInterCycle = 0;
    mMinTmInterCycle = 0;
    mSureTmInterCycle = 0;
    mBallInterPos = ball.GetPos();
    mBallFreeCycleLeft = 0;
    mIsBallActuralKickable = true;
    mChallenger = mInfoState.GetPositionInfo().GetOpponentWithBall();

    if (!mSelfState.IsGoalie()) {
      double self_pt_dis =
          mAgent.GetFormation()
              .GetTeammateFormationPoint(self.GetUnum(), ball.GetPos())
              .Dist2(ball.GetPos());

      for (unsigned int i = 0; i < p2b.size(); ++i) {
        Unum unum = p2b[i];
        if (unum > 0 && unum != self.GetUnum()) {
          if (mWorldState.GetPlayer(unum).IsKickable()) {
            if(mWorldState.GetPlayMode() != PM_Play_On && mWorldState.GetPlayer(unum).IsGoalie()/*&& unum == PlayerParam::instance().ourGoalieUnum()*/){
              mAgent.Self().UpdateKickable(
                  false); //非playon时如果守门员可踢把自己强行设置成不可踢
              mController = unum;
              break;
            }
            double tm_pt_dis =
                mAgent.GetFormation()
                    .GetTeammateFormationPoint(unum, ball.GetPos())
                    .Dist2(ball.GetPos());
            if (tm_pt_dis < self_pt_dis) {
              mAgent.Self().UpdateKickable(false);
              mController = unum;
              break;
            }
          } else { //可以认为其他人踢不到了
            break;
          }
        }
      }
    }
  } else if (kickable_player != 0 &&
             kickable_player != self.GetUnum()) { //自己踢不到球,但有人可以
    mIsBallFree = false;
    if (kickable_player > 0) { //自己人可踢
      mChallenger = mInfoState.GetPositionInfo().GetOpponentWithBall();
    }
  }

  SetPlayAnalyse(); //最后分析，作为修正
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x48d4a
movq %rax, -0x58(%rbp)
movq 0x10(%rbx), %rdi
callq 0xe85a
movq %rax, -0x48(%rbp)
movq 0x10(%rbx), %rax
movq 0x18(%rax), %r14
movb $0x1, 0x41(%rbx)
callq 0x4a75c
leaq 0x38(%r14), %rcx
movq %rcx, -0x50(%rbp)
movq %r14, -0x30(%rbp)
movsd 0x38(%r14), %xmm0
movsd 0x37f0(%rax), %xmm1
addsd 0x1e424(%rip), %xmm1    # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x4cca9
movsd 0x37f8(%rax), %xmm1
addsd 0x1e3d6(%rip), %xmm1    # 0x6b040
ucomisd %xmm0, %xmm1
jb 0x4cca9
movq -0x30(%rbp), %rcx
movsd 0x40(%rcx), %xmm0
movsd 0x3800(%rax), %xmm1
addsd 0x1e3ef(%rip), %xmm1    # 0x6b078
ucomisd %xmm1, %xmm0
jb 0x4cca9
movsd 0x3808(%rax), %xmm1
addsd 0x1e3a1(%rip), %xmm1    # 0x6b040
ucomisd %xmm0, %xmm1
jae 0x4d1d8
movl $0x0, 0xa0(%rbx)
movq -0x48(%rbp), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2ae32
movq 0xc88(%rax), %r8
movl $0x96, 0x44(%rbx)
movq 0xc80(%rax), %r12
movq %r8, %r10
movq %r8, %r14
movq %r8, %r15
cmpq %r8, %r12
movq %r8, -0x38(%rbp)
je 0x4cf29
movq %rax, %r13
movsd 0x1eb79(%rip), %xmm2    # 0x6b878
movsd 0x1f5c1(%rip), %xmm3    # 0x6c2c8
xorpd %xmm4, %xmm4
movsd 0x1efbd(%rip), %xmm5    # 0x6bcd0
movq %r8, %r15
movq %r8, %r14
movq %r8, %r10
movslq 0x8(%r12), %rax
testq %rax, %rax
js 0x4cd53
movq (%r12), %rcx
movl 0x74(%rcx), %ecx
movq -0x48(%rbp), %rdx
cmpl 0x11c(%rdx), %eax
jne 0x4ce19
movl %ecx, 0x64(%rbx)
movl 0x44(%rbx), %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0x44(%rbx)
movq %r12, %r15
jmp 0x4cf18
movq 0x18(%rbx), %rcx
movl 0x2114(%rcx), %edx
addl %eax, %edx
je 0x4cf18
movq (%r12), %rdx
movl 0x74(%rdx), %edx
cmpl 0x6c(%rbx), %edx
jge 0x4cdaa
movl 0xc(%r12), %esi
cmpl $0xf, %esi
jg 0x4cdaa
movl %edx, 0x6c(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
movl 0x44(%rbx), %edi
cmpl %esi, %edi
cmovll %edi, %esi
movl %esi, 0x44(%rbx)
movl %eax, %esi
negl %esi
movl %esi, 0x78(%rbx)
addl 0xc(%r12), %edx
cmpl 0x80(%rbx), %edx
jge 0x4cf18
movl %edx, 0x80(%rbx)
movl %eax, %edx
negl %edx
movl %edx, 0x8c(%rbx)
notl %eax
imulq $0x178, %rax, %rax      # imm = 0x178
movsd 0x1190(%rcx,%rax), %xmm0
ucomisd %xmm3, %xmm0
ja 0x4cf15
addq %rcx, %rax
addq $0x10d0, %rax           # imm = 0x10D0
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x4cee4
sqrtsd %xmm0, %xmm0
jmp 0x4cf09
cmpl 0x68(%rbx), %ecx
jge 0x4ce4c
movl %ecx, 0x68(%rbx)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0xc(%r12), %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movl 0x44(%rbx), %esi
cmpl %edx, %esi
cmovll %esi, %edx
movl %edx, 0x44(%rbx)
movl %eax, 0x74(%rbx)
addl 0xc(%r12), %ecx
cmpl 0x7c(%rbx), %ecx
jge 0x4cf18
movl %ecx, 0x7c(%rbx)
movl %eax, 0x88(%rbx)
movq 0x18(%rbx), %rcx
imulq $0x178, %rax, %rax      # imm = 0x178
movsd -0x10(%rax,%rcx), %xmm0
ucomisd %xmm3, %xmm0
ja 0x4cedf
addq %rcx, %rax
addq $-0xd0, %rax
movsd 0x30(%rax), %xmm0
movsd 0x38(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd %xmm4, %xmm0
jb 0x4cea5
sqrtsd %xmm0, %xmm0
jmp 0x4ced6
movq %r15, %r14
movq %r10, %r15
callq 0x93c0
movsd 0x1ee18(%rip), %xmm5    # 0x6bcd0
xorpd %xmm4, %xmm4
movsd 0x1f404(%rip), %xmm3    # 0x6c2c8
movsd 0x1e9ac(%rip), %xmm2    # 0x6b878
movq %r15, %r10
movq %r14, %r15
movq -0x38(%rbp), %r8
ucomisd %xmm0, %xmm5
jbe 0x4cedf
incl 0x7c(%rbx)
movq %r12, %r14
jmp 0x4cf18
callq 0x93c0
movsd 0x1eddf(%rip), %xmm5    # 0x6bcd0
xorpd %xmm4, %xmm4
movsd 0x1f3cb(%rip), %xmm3    # 0x6c2c8
movsd 0x1e973(%rip), %xmm2    # 0x6b878
movq -0x38(%rbp), %r8
ucomisd %xmm0, %xmm5
jbe 0x4cf15
incl 0x80(%rbx)
movq %r12, %r10
addq $0x10, %r12
cmpq 0xc88(%r13), %r12
jne 0x4cd1c
movl 0x7c(%rbx), %ecx
movl 0x80(%rbx), %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
movl 0x64(%rbx), %ecx
movl 0x68(%rbx), %edx
cmpl %eax, %ecx
cmovll %ecx, %eax
movl %eax, 0x84(%rbx)
movl 0x6c(%rbx), %esi
cmpl %esi, %edx
cmovll %edx, %esi
cmpl %ecx, %esi
cmovgel %ecx, %esi
movl %esi, 0x70(%rbx)
cmpl $0x0, 0x88(%rbx)
jne 0x4cf7a
movq 0x28(%rbx), %rdx
movl 0x11c(%rdx), %edx
movl %edx, 0x88(%rbx)
movl %ecx, 0x7c(%rbx)
movl %ecx, 0x68(%rbx)
movl %edx, 0x74(%rbx)
movq 0x10(%rbx), %rdx
movq 0xc0(%rdx), %rdx
testq %rdx, %rdx
je 0x4cfe6
cmpl $0x5, (%rdx)
jne 0x4cfe6
cmpl $0x5, 0x98(%rdx)
jne 0x4cfe6
cmpb $0x1, 0x50(%rbx)
jne 0x4cfcb
addl $0x6, %eax
cmpl %eax, %ecx
jl 0x4cfcb
movq 0x18(%rbx), %rdi
addq $0x10, %rdi
leaq 0x54(%rbx), %rsi
movq %r14, %r12
movq %r10, %r14
callq 0x55ef4
movq %r14, %r10
movq %r12, %r14
movq -0x38(%rbp), %r8
cmpl $0x7, %eax
jg 0x4cfe6
movq 0x28(%rbx), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
cmpq %r8, %r15
jne 0x4d478
jmp 0x4d4c1
movl 0x64(%rbx), %esi
movl 0x84(%rbx), %ecx
cmpl %ecx, %esi
jle 0x4d03b
cmpq %r8, %r14
je 0x4d003
movl 0x7c(%rbx), %eax
cmpl %ecx, %eax
jle 0x4d18a
cmpq %r8, %r10
je 0x4d19c
movl 0x80(%rbx), %esi
movq -0x30(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x22890
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
xorl %eax, %eax
subl 0x8c(%rbx), %eax
jmp 0x4d4be
movq -0x48(%rbp), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
cmpq %r8, %r14
je 0x4d460
cmpl $0x2, 0xc(%r14)
jg 0x4d460
movq 0x10(%rbx), %rcx
cmpl 0x8(%rcx), %eax
jne 0x4d460
movl 0x7c(%rbx), %eax
cmpl %esi, %eax
jg 0x4d274
cmpl 0x80(%rbx), %esi
jg 0x4d274
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpl $0x0, -0x90(%rcx,%rax)
je 0x4d0fd
addq %rcx, %rax
addq $-0xd0, %rax
cmpl $0x0, 0x18(%rax)
jne 0x4d460
movq 0x30(%rbx), %rdi
callq 0x2adf8
movl 0x88(%rbx), %esi
movq 0x28(%rbx), %rcx
movl 0x11c(%rcx), %edx
movq %rax, %rdi
callq 0x4848a
movsd (%rax), %xmm0
movsd %xmm0, -0x40(%rbp)
callq 0x4a75c
movq -0x38(%rbp), %r8
movsd 0x3178(%rax), %xmm0
addsd 0x1df96(%rip), %xmm0    # 0x6b088
ucomisd -0x40(%rbp), %xmm0
jbe 0x4d460
movq 0x20(%rbx), %rax
movl 0x7c(%rbx), %esi
movq 0x68(%rax), %rdi
callq 0x22890
movsd (%rax), %xmm2
movsd 0x8(%rax), %xmm3
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd -0xc8(%rcx,%rax), %xmm5
movsd -0xc0(%rcx,%rax), %xmm4
movapd %xmm5, %xmm0
subsd %xmm2, %xmm0
movapd %xmm4, %xmm1
subsd %xmm3, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movsd %xmm2, -0x98(%rbp)
movsd %xmm3, -0x90(%rbp)
movsd %xmm4, -0x88(%rbp)
movsd %xmm5, -0x80(%rbp)
jb 0x4d31e
sqrtsd %xmm0, %xmm0
jmp 0x4d323
movq -0x30(%rbp), %rcx
movq 0x98(%rcx), %rdi
movl %eax, %esi
jmp 0x4d4a7
movl 0xa0(%rbx), %eax
leal 0x5(%rax), %ecx
cmpl %ecx, 0x70(%rbx)
jle 0x4d262
movq -0x30(%rbp), %rcx
movq 0x98(%rcx), %rdi
movl %eax, %esi
callq 0x22890
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
movl $0x0, 0x48(%rbx)
jmp 0x4d4c1
movq -0x30(%rbp), %rax
leaq 0x60(%rax), %rdi
callq 0xe804
movq -0x50(%rbp), %rax
movupd (%rax), %xmm1
leaq -0xb0(%rbp), %r13
movapd %xmm1, (%r13)
movsd %xmm0, 0x10(%r13)
xorpd %xmm0, %xmm0
leaq -0x70(%rbp), %r14
movapd %xmm0, (%r14)
callq 0x4a75c
leaq 0x37f0(%rax), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2a010
xorl %ecx, %ecx
testb %al, %al
je 0x4d313
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movq -0x30(%rbp), %rax
subsd 0x38(%rax), %xmm0
subsd 0x40(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4d293
sqrtsd %xmm0, %xmm0
jmp 0x4d298
movq 0x28(%rbx), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
jmp 0x4d47b
cmpl %esi, %eax
jge 0x4d460
cmpl 0x6c(%rbx), %esi
jg 0x4d460
movl 0x88(%rbx), %eax
movl %eax, 0x48(%rbx)
jmp 0x4d460
callq 0x93c0
movsd %xmm0, -0x38(%rbp)
callq 0x4a75c
movq %rax, %r13
movq -0x30(%rbp), %rax
movsd 0x60(%rax), %xmm0
movsd 0x68(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
ucomisd 0x1ddc9(%rip), %xmm0    # 0x6b090
jb 0x4d2cf
sqrtsd %xmm0, %xmm0
jmp 0x4d2d4
callq 0x93c0
movsd -0x38(%rbp), %xmm1
mulsd 0x3460(%r13), %xmm1
divsd %xmm0, %xmm1
movsd 0x1dd6a(%rip), %xmm0    # 0x6b058
subsd %xmm1, %xmm0
movl $0x3e8, %ecx            # imm = 0x3E8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4d313
callq 0x93d0
divsd 0x3468(%r13), %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0xa0(%rbx)
jmp 0x4ccb3
callq 0x93c0
movsd %xmm0, -0x40(%rbp)
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
leaq (%rcx,%rax), %rdi
addq $-0xd0, %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
leaq 0x3a1c2(%rip), %rax     # 0x87518
subsd (%rax), %xmm0
ucomisd -0x40(%rbp), %xmm0
jbe 0x4d36f
movl 0x88(%rbx), %eax
movl %eax, 0x48(%rbx)
jmp 0x4d45c
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movups -0xa0(%rax,%rcx), %xmm0
movaps %xmm0, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0xa8(%rbp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4d3bc
sqrtsd %xmm0, %xmm0
jmp 0x4d3c1
callq 0x93c0
movsd %xmm0, -0x40(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xe804
movsd %xmm0, -0x78(%rbp)
movsd -0x98(%rbp), %xmm0
subsd -0x80(%rbp), %xmm0
movsd -0x90(%rbp), %xmm1
subsd -0x88(%rbp), %xmm1
leaq -0x70(%rbp), %rdi
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
callq 0xe804
movsd -0x78(%rbp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x1dc39(%rip), %xmm1    # 0x6b050
divsd 0x1dc29(%rip), %xmm1    # 0x6b048
movapd %xmm1, %xmm0
callq 0x9950
mulsd -0x40(%rbp), %xmm0
movq 0x18(%rbx), %rcx
movslq 0x88(%rbx), %rax
imulq $0x178, %rax, %rdx      # imm = 0x178
movsd -0x70(%rdx,%rcx), %xmm1
mulsd -0x78(%rdx,%rcx), %xmm1
mulsd 0x216ed(%rip), %xmm1    # 0x6eb40
ucomisd %xmm1, %xmm0
jbe 0x4d45c
movl %eax, 0x48(%rbx)
movq -0x38(%rbp), %r8
movl 0x48(%rbx), %eax
movq 0x28(%rbx), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x4d499
cmpq %r8, %r15
je 0x4d705
movl 0x64(%rbx), %esi
movq -0x30(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x22890
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
jmp 0x4d4c1
movl 0x7c(%rbx), %esi
movq -0x30(%rbp), %rax
movq 0x98(%rax), %rdi
callq 0x22890
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
movl 0x88(%rbx), %eax
movl %eax, 0x48(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x494ca
testl %eax, %eax
jne 0x4d4e9
movq 0x30(%rbx), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x49568
negl %eax
testl %eax, %eax
je 0x4d4fe
movl %eax, 0x48(%rbx)
movb $0x0, 0x41(%rbx)
movl $0x3e8, 0xa0(%rbx)      # imm = 0x3E8
movq -0x48(%rbp), %rdx
movl 0x11c(%rdx), %ecx
cmpb $0x1, 0x128(%rdx)
jne 0x4d6c7
movl %ecx, 0x48(%rbx)
movb $0x0, 0x41(%rbx)
xorl %eax, %eax
movl %eax, 0x84(%rbx)
movl %eax, 0x70(%rbx)
movq $0x0, 0x64(%rbx)
movl %eax, 0x7c(%rbx)
movq -0x50(%rbp), %rcx
movupd (%rcx), %xmm0
movupd %xmm0, 0x90(%rbx)
movl %eax, 0x44(%rbx)
movb $0x1, 0x40(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x49568
movl %eax, 0x4c(%rbx)
movq 0x28(%rbx), %rax
cmpb $0x0, 0x175(%rax)
jne 0x4d6eb
movq 0x10(%rbx), %rdi
callq 0x1356e
movq -0x48(%rbp), %rcx
movl 0x11c(%rcx), %esi
movq %rax, %rdi
movq -0x50(%rbp), %rdx
callq 0x27060
movq -0x58(%rbp), %rsi
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x4d6eb
movq -0x30(%rbp), %rcx
subsd 0x38(%rcx), %xmm0
subsd 0x40(%rcx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, %r14d
xorl %ecx, %ecx
movslq (%rax,%rcx,4), %r13
testq %r13, %r13
jle 0x4d6a0
movq -0x48(%rbp), %rax
cmpl 0x11c(%rax), %r13d
je 0x4d6a0
movq 0x18(%rbx), %rax
imulq $0x178, %r13, %rcx      # imm = 0x178
movl $0x7, %r12d
cmpb $0x1, 0x58(%rax,%rcx)
jne 0x4d6a3
cmpl $0x1, 0x1c(%rax)
je 0x4d629
cmpb $0x1, 0xa5(%rax,%rcx)
jne 0x4d629
movq 0x10(%rbx), %rdi
callq 0x134ce
movb $0x0, 0x128(%rax)
movl %r13d, 0x48(%rbx)
movq -0x58(%rbp), %rsi
jmp 0x4d6a3
movq 0x10(%rbx), %rdi
callq 0x1356e
movq %rax, %rdi
movl %r13d, %esi
movq -0x50(%rbp), %rdx
callq 0x27060
movapd %xmm0, %xmm2
movq -0x30(%rbp), %rax
subsd 0x38(%rax), %xmm2
subsd 0x40(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm2, %xmm2
addsd %xmm1, %xmm2
xorl %r12d, %r12d
movsd -0x38(%rbp), %xmm0
ucomisd %xmm2, %xmm0
jbe 0x4d691
movq 0x10(%rbx), %rdi
movsd %xmm2, -0x40(%rbp)
callq 0x134ce
movsd -0x40(%rbp), %xmm2
movb $0x0, 0x128(%rax)
movl %r13d, 0x48(%rbx)
movl $0x7, %r12d
movsd -0x38(%rbp), %xmm0
ucomisd %xmm2, %xmm0
movq -0x58(%rbp), %rsi
ja 0x4d6a3
xorl %r12d, %r12d
testl %r12d, %r12d
jne 0x4d6eb
movl %r14d, %ecx
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %r14d
cmpq %rcx, %rdx
ja 0x4d5c5
jmp 0x4d6eb
testl %eax, %eax
je 0x4d6eb
cmpl %ecx, %eax
je 0x4d6eb
movb $0x0, 0x41(%rbx)
testl %eax, %eax
jle 0x4d6eb
movq 0x30(%rbx), %rdi
callq 0x2adf8
movq %rax, %rdi
callq 0x49568
movl %eax, 0x4c(%rbx)
movq %rbx, %rdi
callq 0x4d8fe
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jle 0x4d4c1
movq 0x398d6(%rip), %r13     # 0x86ff0
leaq 0x21438(%rip), %rsi     # 0x6eb59
movl $0x13, %edx
movq %r13, %rdi
callq 0x9560
leaq 0x21a8d(%rip), %rsi     # 0x6f1c2
movl $0x1, %edx
movq %r13, %rdi
callq 0x9560
movq %r13, %rdi
movl $0x126, %esi            # imm = 0x126
callq 0x9880
movq %rax, %r13
leaq 0x1fd26(%rip), %rsi     # 0x6d47f
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
leaq 0x1eb0c(%rip), %rsi     # 0x6c279
movl $0x9, %edx
movq %r13, %rdi
callq 0x9560
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x9480
movsbl %al, %esi
movq %r13, %rdi
callq 0x9070
movq %rax, %rdi
callq 0x9330
jmp 0x4d4c1
nop