// File: /workspace/github_cpp_makefile_star2_O3/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 $0x98, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x47984
movq %rax, %r14
movq 0x10(%rbx), %rdi
callq 0xe75a
movq %rax, %r15
movq 0x10(%rbx), %rax
movq 0x18(%rax), %r12
movb $0x1, 0x41(%rbx)
callq 0x49360
leaq 0x38(%r12), %rcx
movq %rcx, -0x58(%rbp)
movq %r12, -0x48(%rbp)
movsd 0x38(%r12), %xmm0
movsd 0x37f0(%rax), %xmm1
addsd 0x1d888(%rip), %xmm1    # 0x69078
ucomisd %xmm1, %xmm0
jb 0x4b845
movsd 0x37f8(%rax), %xmm1
addsd 0x1d83a(%rip), %xmm1    # 0x69040
ucomisd %xmm0, %xmm1
jb 0x4b845
movq -0x48(%rbp), %rcx
movsd 0x40(%rcx), %xmm0
movsd 0x3800(%rax), %xmm1
addsd 0x1d853(%rip), %xmm1    # 0x69078
ucomisd %xmm1, %xmm0
jb 0x4b845
movsd 0x3808(%rax), %xmm1
addsd 0x1d805(%rip), %xmm1    # 0x69040
ucomisd %xmm0, %xmm1
jae 0x4bbcb
movl $0x0, 0xa0(%rbx)
movq %r14, -0xa0(%rbp)
movl 0x11c(%r15), %eax
movl %eax, 0x48(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2a4f2
movq 0xc88(%rax), %r14
movl $0x96, 0x44(%rbx)
movq 0xc80(%rax), %rsi
cmpq %r14, %rsi
movq %r15, -0x98(%rbp)
je 0x4badd
movl 0x11c(%r15), %edi
movq 0x18(%rbx), %r9
leaq 0xa8(%r9), %r15
leaq 0x10d0(%r9), %r12
movl 0x68(%rbx), %r8d
movl 0x7c(%rbx), %r13d
movl 0x6c(%rbx), %eax
movl 0x80(%rbx), %ecx
movl %ecx, -0x30(%rbp)
movl $0x96, %r11d
movsd 0x1dfaf(%rip), %xmm0    # 0x69878
movsd 0x1e9e7(%rip), %xmm1    # 0x6a2b8
movsd 0x1e3f7(%rip), %xmm2    # 0x69cd0
movq %r14, -0x60(%rbp)
movq %r14, -0x38(%rbp)
movq %r14, -0x40(%rbp)
movq %r14, -0x68(%rbp)
movslq 0x8(%rsi), %r10
testq %r10, %r10
js 0x4b918
movq (%rsi), %rcx
movl 0x74(%rcx), %edx
cmpl %edi, %r10d
jne 0x4b9e1
movl %edx, 0x64(%rbx)
cmpl %r11d, %edx
cmovll %edx, %r11d
movl %r11d, 0x44(%rbx)
movq %rsi, -0x60(%rbp)
jmp 0x4bace
movl 0x2114(%r9), %ecx
addl %r10d, %ecx
je 0x4bace
movl %r13d, -0x50(%rbp)
movq %r12, %r14
movq %r15, %r13
movl %edi, %r15d
movl %r8d, %edi
movq %r9, %r12
movq (%rsi), %rcx
movl 0x74(%rcx), %edx
cmpl %eax, %edx
setl %r9b
movl 0xc(%rsi), %ecx
cmpl $0x10, %ecx
setl %r8b
andb %r9b, %r8b
cmpb $0x1, %r8b
jne 0x4b98c
movl %edx, 0x6c(%rbx)
xorps %xmm3, %xmm3
cvtsi2sd %edx, %xmm3
xorps %xmm4, %xmm4
cvtsi2sd %ecx, %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %eax
cmpl %eax, %r11d
cmovgel %eax, %r11d
movl %r11d, 0x44(%rbx)
movl %r10d, %eax
negl %eax
movl %eax, 0x78(%rbx)
movl %edx, %eax
addl %edx, %ecx
cmpl -0x30(%rbp), %ecx
movq %r12, %r9
movl %edi, %r8d
jge 0x4ba82
movl %ecx, 0x80(%rbx)
movl %r10d, %edx
negl %edx
movl %edx, 0x8c(%rbx)
notl %r10d
imulq $0x178, %r10, %rdx      # imm = 0x178
movq %r14, %r12
movsd 0xc0(%r14,%rdx), %xmm3
ucomisd %xmm1, %xmm3
movl %r15d, %edi
jbe 0x4ba91
movl %ecx, -0x30(%rbp)
movq %rsi, -0x40(%rbp)
movq %r13, %r15
jmp 0x4ba8b
cmpl %r8d, %edx
jge 0x4ba1b
xorps %xmm3, %xmm3
cvtsi2sd %edx, %xmm3
movl %edx, 0x68(%rbx)
movl 0xc(%rsi), %ecx
xorps %xmm4, %xmm4
cvtsi2sd %ecx, %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
cvttsd2si %xmm4, %r8d
cmpl %r8d, %r11d
cmovgel %r8d, %r11d
movl %r11d, 0x44(%rbx)
movl %r10d, 0x74(%rbx)
movl %edx, %r8d
jmp 0x4ba1e
movl 0xc(%rsi), %ecx
addl %edx, %ecx
cmpl %r13d, %ecx
jge 0x4bace
movl %ecx, 0x7c(%rbx)
movl %r10d, 0x88(%rbx)
imulq $0x178, %r10, %rdx      # imm = 0x178
movsd -0xb8(%rdx,%r15), %xmm3
ucomisd %xmm1, %xmm3
ja 0x4ba79
addq %r15, %rdx
addq $-0x178, %rdx           # imm = 0xFE88
movsd 0x30(%rdx), %xmm3
movsd 0x38(%rdx), %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
sqrtsd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
jbe 0x4ba79
incl %ecx
movl %ecx, 0x7c(%rbx)
movl %ecx, %r13d
movq %rsi, -0x38(%rbp)
jmp 0x4bace
movl %r15d, %edi
movq %r13, %r15
movq %r14, %r12
movq -0x68(%rbp), %r14
jmp 0x4baca
addq %r12, %rdx
movsd 0x30(%rdx), %xmm3
movsd 0x38(%rdx), %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
sqrtsd %xmm3, %xmm3
ucomisd %xmm3, %xmm2
movq %r13, %r15
movq -0x68(%rbp), %r14
jbe 0x4bac3
incl %ecx
movl %ecx, 0x80(%rbx)
movl %ecx, -0x30(%rbp)
movq %rsi, -0x40(%rbp)
movl -0x50(%rbp), %r13d
addq $0x10, %rsi
cmpq %r14, %rsi
jne 0x4b8e9
jmp 0x4bafd
movl 0x7c(%rbx), %r13d
movl 0x80(%rbx), %eax
movl %eax, -0x30(%rbp)
movl 0x68(%rbx), %r8d
movl 0x6c(%rbx), %eax
movq %r14, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movq %r14, -0x60(%rbp)
movl -0x30(%rbp), %edx
cmpl %edx, %r13d
cmovll %r13d, %edx
movl 0x64(%rbx), %esi
cmpl %edx, %esi
cmovll %esi, %edx
cmpl %eax, %r8d
cmovll %r8d, %eax
cmpl %esi, %eax
cmovgel %esi, %eax
movl %edx, %ecx
movl %edx, 0x84(%rbx)
movl %eax, 0x70(%rbx)
cmpl $0x0, 0x88(%rbx)
jne 0x4bb48
movq 0x28(%rbx), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x88(%rbx)
movl %esi, 0x7c(%rbx)
movl %esi, 0x68(%rbx)
movl %eax, 0x74(%rbx)
movq -0x48(%rbp), %rax
leaq 0x30(%rax), %r13
movq 0x10(%rbx), %rax
movq 0xc0(%rax), %rax
testq %rax, %rax
movq -0xa0(%rbp), %r15
movq -0x98(%rbp), %r12
je 0x4bccb
cmpl $0x5, (%rax)
jne 0x4bccb
cmpl $0x5, 0x98(%rax)
jne 0x4bccb
cmpb $0x1, 0x50(%rbx)
jne 0x4bbaf
addl $0x6, %ecx
cmpl %ecx, %esi
jl 0x4bbaf
movq 0x18(%rbx), %rdi
addq $0x10, %rdi
leaq 0x54(%rbx), %rsi
callq 0x546de
cmpl $0x8, %eax
jge 0x4bcc2
movq 0x28(%rbx), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
cmpq %r14, -0x60(%rbp)
jne 0x4bfab
jmp 0x4bfe4
movq -0x48(%rbp), %rax
leaq 0x60(%rax), %rdi
callq 0xe702
movq -0x58(%rbp), %rax
movupd (%rax), %xmm1
leaq -0xc0(%rbp), %r13
movapd %xmm1, (%r13)
movsd %xmm0, 0x10(%r13)
xorpd %xmm0, %xmm0
leaq -0x80(%rbp), %r12
movapd %xmm0, (%r12)
callq 0x49360
leaq 0x37f0(%rax), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2976c
xorl %ecx, %ecx
testb %al, %al
je 0x4bcb7
movsd -0x80(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movq -0x48(%rbp), %r12
subsd 0x38(%r12), %xmm0
subsd 0x40(%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd 0x60(%r12), %xmm0
movsd 0x68(%r12), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm1
mulsd 0x3460(%rax), %xmm1
sqrtsd %xmm0, %xmm0
divsd %xmm0, %xmm1
movsd 0x1d3c9(%rip), %xmm0    # 0x69058
subsd %xmm1, %xmm0
movl $0x3e8, %ecx            # imm = 0x3E8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4bcb7
movq %rax, %r13
callq 0x93d0
divsd 0x3468(%r13), %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0xa0(%rbx)
jmp 0x4b84f
movl 0x64(%rbx), %esi
movl 0x84(%rbx), %ecx
cmpl %ecx, %esi
jle 0x4bd11
cmpq %r14, -0x38(%rbp)
je 0x4bce0
movl 0x7c(%rbx), %eax
cmpl %ecx, %eax
jle 0x4bf3a
cmpq %r14, -0x40(%rbp)
je 0x4bf44
movl 0x80(%rbx), %esi
movq %r13, %rdi
callq 0x220a4
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
xorl %eax, %eax
subl 0x8c(%rbx), %eax
jmp 0x4bfe1
movl 0x11c(%r12), %eax
movl %eax, 0x48(%rbx)
movq -0x38(%rbp), %rcx
cmpq %r14, %rcx
je 0x4bf92
cmpl $0x2, 0xc(%rcx)
jg 0x4bf92
movq 0x10(%rbx), %rcx
cmpl 0x8(%rcx), %eax
jne 0x4bf92
movl 0x7c(%rbx), %eax
cmpl %esi, %eax
jg 0x4bf80
cmpl 0x80(%rbx), %esi
jg 0x4bf80
movq 0x18(%rbx), %rcx
movslq 0x88(%rbx), %rdx
imulq $0x178, %rdx, %rdx      # imm = 0x178
cmpl $0x0, -0x90(%rdx,%rcx)
je 0x4bdd4
leaq (%rdx,%rcx), %rax
addq $-0xd0, %rax
cmpl $0x0, 0x18(%rax)
jne 0x4bf92
movq 0x30(%rbx), %rdi
callq 0x2a4b4
movl 0x88(%rbx), %esi
movq 0x28(%rbx), %rcx
movl 0x11c(%rcx), %edx
movq %rax, %rdi
callq 0x47086
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x49360
movsd 0x3178(%rax), %xmm0
addsd 0x1d2c2(%rip), %xmm0    # 0x69088
ucomisd -0x30(%rbp), %xmm0
jbe 0x4bf92
movl 0x7c(%rbx), %eax
movq 0x20(%rbx), %rdi
movl %eax, %esi
callq 0x220a4
movsd (%rax), %xmm1
movsd 0x8(%rax), %xmm2
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
leaq (%rcx,%rax), %rdi
addq $-0xd0, %rdi
movsd 0x8(%rdi), %xmm0
movsd 0x10(%rdi), %xmm3
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x50(%rbp)
subsd %xmm1, %xmm0
movsd %xmm3, -0x40(%rbp)
movapd %xmm3, %xmm1
movsd %xmm2, -0x38(%rbp)
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq (%rdi), %rax
callq *0x10(%rax)
movsd (%rax), %xmm0
leaq 0x386c0(%rip), %rax     # 0x84518
subsd (%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
ja 0x4bf89
movq 0x18(%rbx), %rax
movslq 0x88(%rbx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movups -0xa0(%rax,%rcx), %xmm0
leaq -0xc0(%rbp), %rdi
movaps %xmm0, (%rdi)
movsd (%rdi), %xmm0
movsd 0x8(%rdi), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0xe702
movsd %xmm0, -0x88(%rbp)
movsd -0x50(%rbp), %xmm0
subsd -0x90(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
subsd -0x40(%rbp), %xmm1
leaq -0x80(%rbp), %rdi
movsd %xmm0, (%rdi)
movsd %xmm1, 0x8(%rdi)
callq 0xe702
movsd -0x88(%rbp), %xmm1
subsd %xmm0, %xmm1
mulsd 0x1d15d(%rip), %xmm1    # 0x69050
divsd 0x1d14d(%rip), %xmm1    # 0x69048
movapd %xmm1, %xmm0
callq 0x9950
mulsd -0x30(%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 0x20be1(%rip), %xmm1    # 0x6cb10
ucomisd %xmm1, %xmm0
jbe 0x4bf92
movl %eax, 0x48(%rbx)
jmp 0x4bf92
movq %r13, %rdi
movl %eax, %esi
jmp 0x4bfca
movl 0xa0(%rbx), %eax
leal 0x5(%rax), %ecx
cmpl %ecx, 0x70(%rbx)
jle 0x4bf71
movq %r13, %rdi
movl %eax, %esi
callq 0x220a4
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
movl $0x0, 0x48(%rbx)
jmp 0x4bfe4
movq 0x28(%rbx), %rax
movl 0x11c(%rax), %eax
movl %eax, 0x48(%rbx)
jmp 0x4bfae
cmpl %esi, %eax
jge 0x4bf92
cmpl 0x6c(%rbx), %esi
jg 0x4bf92
movl 0x88(%rbx), %eax
movl %eax, 0x48(%rbx)
movl 0x48(%rbx), %eax
movq 0x28(%rbx), %rcx
cmpl 0x11c(%rcx), %eax
jne 0x4bfc4
cmpq %r14, -0x60(%rbp)
je 0x4c1da
movl 0x64(%rbx), %esi
movq %r13, %rdi
callq 0x220a4
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
jmp 0x4bfe4
movl 0x7c(%rbx), %esi
movq %r13, %rdi
callq 0x220a4
movupd (%rax), %xmm0
movupd %xmm0, 0x90(%rbx)
movl 0x88(%rbx), %eax
movl %eax, 0x48(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x48160
testl %eax, %eax
jne 0x4c014
movq 0x30(%rbx), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x481fe
testl %eax, %eax
je 0x4c1d1
negl %eax
movl %eax, 0x48(%rbx)
movb $0x0, 0x41(%rbx)
movl $0x3e8, 0xa0(%rbx)      # imm = 0x3E8
xorl %ecx, %ecx
movl 0x11c(%r12), %edx
cmpb $0x1, 0x128(%r12)
jne 0x4c19f
movl %edx, 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 -0x58(%rbp), %rcx
movupd (%rcx), %xmm0
movupd %xmm0, 0x90(%rbx)
movl %eax, 0x44(%rbx)
movb $0x1, 0x40(%rbx)
movq 0x30(%rbx), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x481fe
movl %eax, 0x4c(%rbx)
movq 0x28(%rbx), %rax
cmpb $0x0, 0x175(%rax)
jne 0x4c290
movq 0x10(%rbx), %rdi
callq 0x13432
movl 0x11c(%r12), %esi
movq %rax, %rdi
movq -0x58(%rbp), %rdx
callq 0x268a6
movq (%r15), %rax
movq 0x8(%r15), %rcx
cmpq %rax, %rcx
je 0x4c290
movq -0x48(%rbp), %rdx
subsd 0x38(%rdx), %xmm0
subsd 0x40(%rdx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movl $0x1, %r14d
xorl %edx, %edx
movl (%rax,%rdx,4), %r13d
testl %r13d, %r13d
jle 0x4c181
cmpl 0x11c(%r12), %r13d
je 0x4c181
movq 0x18(%rbx), %rax
leal -0x1(%r13), %ecx
imulq $0x178, %rcx, %rcx      # imm = 0x178
cmpb $0x1, 0x1d0(%rax,%rcx)
jne 0x4c290
cmpl $0x1, 0x1c(%rax)
je 0x4c139
addq $0xa8, %rax
cmpb $0x1, 0x175(%rax,%rcx)
je 0x4c27c
movq 0x10(%rbx), %rdi
callq 0x13432
movq %rax, %rdi
movl %r13d, %esi
movq -0x58(%rbp), %rdx
callq 0x268a6
movq -0x48(%rbp), %rax
subsd 0x38(%rax), %xmm0
subsd 0x40(%rax), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd -0x30(%rbp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x4c27c
movq (%r15), %rax
movq 0x8(%r15), %rcx
movl %r14d, %edx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
incl %r14d
cmpq %rdx, %rsi
ja 0x4c0eb
jmp 0x4c290
cmpl %edx, %eax
sete %dl
orb %dl, %cl
jne 0x4c290
movb $0x0, 0x41(%rbx)
testl %eax, %eax
jle 0x4c290
movq 0x30(%rbx), %rdi
callq 0x2a4b4
movq %rax, %rdi
callq 0x481fe
movl %eax, 0x4c(%rbx)
jmp 0x4c290
xorl %eax, %eax
movb $0x1, %cl
jmp 0x4c027
movq 0x18(%rbx), %rax
cmpl $0x0, 0x10(%rax)
jle 0x4bfe4
movq 0x37e01(%rip), %r13     # 0x83ff0
leaq 0x20933(%rip), %rsi     # 0x6cb29
movl $0x13, %edx
movq %r13, %rdi
callq 0x9560
leaq 0x20f88(%rip), %rsi     # 0x6d192
movl $0x1, %edx
movq %r13, %rdi
callq 0x9560
movq %r13, %rdi
movl $0x126, %esi            # imm = 0x126
callq 0x9880
movq %rax, %r13
leaq 0x1f229(%rip), %rsi     # 0x6b457
movl $0x3, %edx
movq %rax, %rdi
callq 0x9560
leaq 0x1e026(%rip), %rsi     # 0x6a268
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 0x4bfe4
movq 0x10(%rbx), %rdi
callq 0x13392
movb $0x0, 0x128(%rax)
movl %r13d, 0x48(%rbx)
movq %rbx, %rdi
callq 0x4c400
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq