// File: 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
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x80230
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq %rcx, -0x10(%rbp)
movq 0x10(%rax), %rdi
callq 0x10590
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x32f60
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq %rcx, -0x20(%rbp)
movb $0x1, 0x41(%rax)
callq 0x855e0
movq %rax, %rdi
callq 0x1d830
movq %rax, -0x158(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x158(%rbp), %rdi
movq %rax, %rsi
movsd 0x37ee2(%rip), %xmm0    # 0xc1008
movsd %xmm0, -0x28(%rbp)
leaq -0x28(%rbp), %rdx
callq 0x1d850
testb $0x1, %al
jne 0x8913d
jmp 0x89239
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, -0x168(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a80
movq %rax, %rdi
callq 0x10520
movq -0x168(%rbp), %rsi
movsd %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x1fde0
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x11a10
callq 0x855e0
movq %rax, %rdi
callq 0x1d830
movq %rax, %rdi
leaq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x47cb0
testb $0x1, %al
jne 0x891bf
jmp 0x89226
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x1d6d0
movsd %xmm0, -0x70(%rbp)
callq 0x855e0
movq %rax, -0x170(%rbp)
movq -0x20(%rbp), %rdi
callq 0x10a80
movq %rax, %rdi
callq 0x104e0
movq -0x170(%rbp), %rdi
movsd %xmm0, -0x78(%rbp)
leaq -0x78(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x8b0a0
movq -0x160(%rbp), %rax
cvttsd2si %xmm0, %ecx
movl %ecx, 0xa0(%rax)
jmp 0x89237
movq -0x160(%rbp), %rax
movl $0x0, 0xa0(%rax)
jmp 0x8924a
movq -0x160(%rbp), %rax
movl $0x0, 0xa0(%rax)
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x48(%rax)
movq 0x30(%rax), %rdi
callq 0x495c0
movq %rax, %rdi
callq 0x8b130
movq %rax, -0x80(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b150
movq -0x80(%rbp), %rdi
callq 0x8b170
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq %rcx, -0x90(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0xa0(%rbp)
movq -0x90(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movl $0x96, 0x44(%rax)
movq -0x80(%rbp), %rdi
callq 0x8b1a0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
callq 0x8b170
movq %rax, -0xb8(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x89315
jmp 0x897d5
leaq -0x88(%rbp), %rdi
callq 0x8b210
cmpl $0x0, 0x8(%rax)
jge 0x8956f
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl 0x8(%rcx), %ecx
movl %ecx, -0x174(%rbp)
movq 0x18(%rax), %rdi
callq 0x25310
movl %eax, %edx
movl -0x174(%rbp), %eax
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jne 0x89368
jmp 0x897c4
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rcx
movq (%rax), %rax
movl 0x74(%rax), %eax
cmpl 0x6c(%rcx), %eax
jge 0x8944f
leaq -0x88(%rbp), %rdi
callq 0x8b210
cmpl $0x10, 0xc(%rax)
jge 0x8944d
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rcx
movl 0x74(%rcx), %ecx
movl %ecx, 0x6c(%rax)
movq %rax, %rcx
addq $0x44, %rcx
movq %rcx, -0x180(%rbp)
cvtsi2sdl 0x6c(%rax), %xmm0
movsd %xmm0, -0x188(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movsd -0x188(%rbp), %xmm1
movq -0x180(%rbp), %rdi
cvtsi2sdl 0xc(%rax), %xmm0
movsd 0x37c1e(%rip), %xmm2    # 0xc1020
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
leaq -0xbc(%rbp), %rsi
callq 0x13150
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x44(%rax)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq %rax, %rdx
movq -0x160(%rbp), %rax
xorl %ecx, %ecx
subl 0x8(%rdx), %ecx
movl %ecx, 0x78(%rax)
jmp 0x8944f
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
movl 0x74(%rax), %eax
movl %eax, -0x18c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rcx
movq %rax, %rdx
movl -0x18c(%rbp), %eax
addl 0xc(%rdx), %eax
cmpl 0x80(%rcx), %eax
jge 0x8956a
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
movl 0x74(%rax), %eax
movl %eax, -0x190(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movl -0x190(%rbp), %ecx
movq %rax, %rdx
movq -0x160(%rbp), %rax
addl 0xc(%rdx), %ecx
movl %ecx, 0x80(%rax)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rsi
movq %rax, %rcx
xorl %eax, %eax
subl 0x8(%rcx), %eax
movl %eax, 0x8c(%rsi)
movq -0x88(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq 0x18(%rsi), %rdi
addq $0x8c, %rsi
callq 0x1d480
movq %rax, %rdi
callq 0x32880
testb $0x1, %al
jne 0x89568
movq -0x160(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x8c, %rsi
callq 0x1d480
movq %rax, %rdi
callq 0x10a80
movq %rax, %rdi
callq 0x104e0
movaps %xmm0, %xmm1
movsd 0x38714(%rip), %xmm0    # 0xc1c60
ucomisd %xmm1, %xmm0
jbe 0x89568
movq -0x160(%rbp), %rax
movl 0x80(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x80(%rax)
jmp 0x8956a
jmp 0x897c2
leaq -0x88(%rbp), %rdi
callq 0x8b210
movl 0x8(%rax), %eax
movl %eax, -0x194(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x194(%rbp), %eax
cmpl %ecx, %eax
jne 0x895e7
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rsi
movq (%rax), %rax
movl 0x74(%rax), %eax
movl %eax, 0x64(%rsi)
movq %rsi, %rdi
addq $0x44, %rdi
addq $0x64, %rsi
callq 0x13150
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x44(%rax)
movq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0x897c0
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rcx
movq (%rax), %rax
movl 0x74(%rax), %eax
cmpl 0x68(%rcx), %eax
jge 0x896b4
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rcx
movl 0x74(%rcx), %ecx
movl %ecx, 0x68(%rax)
movq %rax, %rcx
addq $0x44, %rcx
movq %rcx, -0x1a0(%rbp)
cvtsi2sdl 0x68(%rax), %xmm0
movsd %xmm0, -0x1a8(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movsd -0x1a8(%rbp), %xmm1
movq -0x1a0(%rbp), %rdi
cvtsi2sdl 0xc(%rax), %xmm0
movsd 0x379b5(%rip), %xmm2    # 0xc1020
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x13150
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x44(%rax)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl 0x8(%rcx), %ecx
movl %ecx, 0x74(%rax)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
movl 0x74(%rax), %eax
movl %eax, -0x1ac(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rcx
movq %rax, %rdx
movl -0x1ac(%rbp), %eax
addl 0xc(%rdx), %eax
cmpl 0x7c(%rcx), %eax
jge 0x897be
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq (%rax), %rax
movl 0x74(%rax), %eax
movl %eax, -0x1b0(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movl -0x1b0(%rbp), %ecx
movq %rax, %rdx
movq -0x160(%rbp), %rax
addl 0xc(%rdx), %ecx
movl %ecx, 0x7c(%rax)
leaq -0x88(%rbp), %rdi
callq 0x8b210
movq -0x160(%rbp), %rsi
movl 0x8(%rax), %eax
movl %eax, 0x88(%rsi)
movq -0x88(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x32880
testb $0x1, %al
jne 0x897bc
movq -0x160(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x10a80
movq %rax, %rdi
callq 0x104e0
movaps %xmm0, %xmm1
movsd 0x384ba(%rip), %xmm0    # 0xc1c60
ucomisd %xmm1, %xmm0
jbe 0x897bc
movq -0x160(%rbp), %rax
movl 0x7c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x7c(%rax)
jmp 0x897be
jmp 0x897c0
jmp 0x897c2
jmp 0x897c4
leaq -0x88(%rbp), %rdi
callq 0x8b230
jmp 0x892e9
movq -0x160(%rbp), %rsi
movq %rsi, %rdi
addq $0x80, %rdi
addq $0x7c, %rsi
callq 0x13150
movq -0x160(%rbp), %rsi
movl (%rax), %eax
movl %eax, 0x84(%rsi)
movq %rsi, %rdi
addq $0x84, %rdi
addq $0x64, %rsi
callq 0x13150
movq -0x160(%rbp), %rsi
movl (%rax), %eax
movl %eax, 0x84(%rsi)
movq %rsi, %rdi
addq $0x6c, %rdi
addq $0x68, %rsi
callq 0x13150
movq -0x160(%rbp), %rsi
movl (%rax), %eax
movl %eax, 0x70(%rsi)
movq %rsi, %rdi
addq $0x64, %rdi
addq $0x70, %rsi
callq 0x13150
movq %rax, %rcx
movq -0x160(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x70(%rax)
cmpl $0x0, 0x88(%rax)
jne 0x89898
movq -0x160(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x88(%rax)
movl 0x64(%rax), %ecx
movl %ecx, 0x7c(%rax)
movl 0x64(%rax), %ecx
movl %ecx, 0x68(%rax)
movl 0x88(%rax), %ecx
movl %ecx, 0x74(%rax)
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x5, %esi
callq 0x18520
testb $0x1, %al
jne 0x898b6
jmp 0x8998b
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x18b10
cmpl $0x5, 0x98(%rax)
jne 0x8998b
movq -0x160(%rbp), %rax
testb $0x1, 0x50(%rax)
je 0x8991f
movq -0x160(%rbp), %rcx
movl 0x64(%rcx), %eax
movl 0x84(%rcx), %ecx
addl $0x6, %ecx
cmpl %ecx, %eax
jl 0x8991f
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x12100
movq -0x160(%rbp), %rsi
movq %rax, %rdi
addq $0x54, %rsi
callq 0x9ed10
cmpl $0x8, %eax
jge 0x8998b
movq -0x160(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x48(%rax)
leaq -0x98(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x89954
jmp 0x89986
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0x64(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
jmp 0x89fff
movq -0x160(%rbp), %rcx
movl 0x64(%rcx), %eax
cmpl 0x84(%rcx), %eax
jg 0x89e92
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x48(%rax)
leaq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x899d2
jmp 0x89d5b
leaq -0xa0(%rbp), %rdi
callq 0x8b210
cmpl $0x3, 0xc(%rax)
jge 0x89d5b
movq -0x160(%rbp), %rdi
callq 0x88c40
testb $0x1, %al
jne 0x899fd
jmp 0x89d59
movq -0x160(%rbp), %rcx
movl 0x7c(%rcx), %eax
cmpl 0x64(%rcx), %eax
jg 0x89d27
movq -0x160(%rbp), %rcx
movl 0x64(%rcx), %eax
cmpl 0x80(%rcx), %eax
jg 0x89d27
movq -0x160(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x28a30
cmpl $0x0, %eax
je 0x89aff
movq -0x160(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x1ddd0
cmpl $0x0, %eax
jne 0x89d25
movq -0x160(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq %rcx, -0x1c8(%rbp)
movl 0x88(%rax), %ecx
movl %ecx, -0x1bc(%rbp)
movq 0x28(%rax), %rdi
callq 0x1b470
movq -0x1c8(%rbp), %rdi
movl -0x1bc(%rbp), %esi
movl %eax, %edx
callq 0x7efb0
movsd (%rax), %xmm0
movsd %xmm0, -0x1b8(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x8b250
movsd -0x1b8(%rbp), %xmm1
movsd (%rax), %xmm0
movsd 0x3752f(%rip), %xmm2    # 0xc1020
subsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x89d25
movq -0x160(%rbp), %rax
movq 0x20(%rax), %rdi
movl 0x7c(%rax), %esi
callq 0x11fc0
movq -0x160(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xc8(%rbp)
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
addq $0x8, %rdi
callq 0x11090
movq (%rax), %rcx
movq %rcx, -0xe0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xd8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1d6d0
movq -0x160(%rbp), %rsi
movsd %xmm0, -0x1d0(%rbp)
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movsd -0x1d0(%rbp), %xmm1
movsd (%rax), %xmm0
leaq 0x74a8b(%rip), %rax     # 0xfe638
subsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x89bcc
movq -0x160(%rbp), %rax
movl 0x88(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89d23
movq -0x160(%rbp), %rsi
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x10a80
movq (%rax), %rcx
movq %rcx, -0xf0(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xe8(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x104e0
movsd %xmm0, -0x1e8(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x10520
movsd %xmm0, -0x1f0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x110a0
movsd %xmm0, -0x110(%rbp)
movsd %xmm1, -0x108(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x10520
movaps %xmm0, %xmm1
movsd -0x1f0(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x100(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x32950
movq -0x160(%rbp), %rsi
movaps %xmm0, %xmm1
movsd -0x1e8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x1d810
movq -0x160(%rbp), %rsi
movsd (%rax), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movq 0x18(%rsi), %rdi
addq $0x88, %rsi
callq 0x12520
movq %rax, %rdi
callq 0x1d690
movsd -0x1e0(%rbp), %xmm1
movsd -0x1d8(%rbp), %xmm0
mulsd (%rax), %xmm1
movsd 0x38b61(%rip), %xmm2    # 0xc2868
mulsd %xmm2, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x89d21
movq -0x160(%rbp), %rax
movl 0x88(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89d23
jmp 0x89d25
jmp 0x89d57
movq -0x160(%rbp), %rcx
movl 0x7c(%rcx), %eax
cmpl 0x64(%rcx), %eax
jge 0x89d55
movq -0x160(%rbp), %rcx
movl 0x64(%rcx), %eax
cmpl 0x6c(%rcx), %eax
jg 0x89d55
movq -0x160(%rbp), %rax
movl 0x88(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89d57
jmp 0x89d59
jmp 0x89d5b
movq -0x160(%rbp), %rax
movl 0x48(%rax), %ecx
movl %ecx, -0x1f4(%rbp)
movq 0x28(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x1f4(%rbp), %eax
cmpl %ecx, %eax
jne 0x89e52
leaq -0x98(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x89d9d
jmp 0x89dd1
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0x64(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
jmp 0x89e50
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
cmpl $0x0, %eax
jle 0x89e4e
jmp 0x89df0
movq 0x741f9(%rip), %rdi     # 0xfdff0
leaq 0x3ae73(%rip), %rsi     # 0xc4c71
callq 0xa5a0
movq %rax, %rdi
leaq 0x3b444(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, %rdi
movl $0x126, %esi            # imm = 0x126
callq 0xaa40
movq %rax, %rdi
leaq 0x39736(%rip), %rsi     # 0xc355f
callq 0xa5a0
movq %rax, %rdi
leaq 0x383c5(%rip), %rsi     # 0xc21fd
callq 0xa5a0
movq %rax, %rdi
movq 0x74169(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x89e4e
jmp 0x89e50
jmp 0x89e8d
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0x7c(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
movl 0x88(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89ffd
leaq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x89eab
jmp 0x89efd
movq -0x160(%rbp), %rcx
movl 0x7c(%rcx), %eax
cmpl 0x84(%rcx), %eax
jg 0x89efd
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0x7c(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
movl 0x88(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89ffb
leaq -0xa8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x8b1d0
testb $0x1, %al
jne 0x89f16
jmp 0x89f5b
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0x80(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
xorl %ecx, %ecx
subl 0x8c(%rax), %ecx
movl %ecx, 0x48(%rax)
jmp 0x89ff9
movq -0x160(%rbp), %rcx
movl 0x70(%rcx), %eax
movl 0xa0(%rcx), %ecx
addl $0x5, %ecx
cmpl %ecx, %eax
jle 0x89fb0
movq -0x160(%rbp), %rax
movq -0x20(%rbp), %rdi
movl 0xa0(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
movl $0x0, 0x48(%rax)
jmp 0x89ff7
movq -0x160(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x20(%rbp), %rdi
movl 0x64(%rax), %esi
callq 0x11fc0
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
jmp 0x89ff9
jmp 0x89ffb
jmp 0x89ffd
jmp 0x89fff
movq -0x160(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x80c50
movl %eax, -0x114(%rbp)
cmpl $0x0, -0x114(%rbp)
jne 0x8a04a
movq -0x160(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x80d40
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x114(%rbp)
cmpl $0x0, -0x114(%rbp)
je 0x8a071
movq -0x160(%rbp), %rax
movl -0x114(%rbp), %ecx
movl %ecx, 0x48(%rax)
movb $0x0, 0x41(%rax)
movl $0x3e8, 0xa0(%rax)      # imm = 0x3E8
movq -0x18(%rbp), %rdi
callq 0x10ef0
testb $0x1, %al
jne 0x8a083
jmp 0x8a38d
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x48(%rax)
movb $0x0, 0x41(%rax)
movl $0x0, 0x84(%rax)
movl $0x0, 0x70(%rax)
movl $0x0, 0x64(%rax)
movl $0x0, 0x68(%rax)
movl $0x0, 0x7c(%rax)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rcx
movq -0x160(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x98(%rax)
movl $0x0, 0x44(%rax)
movb $0x1, 0x40(%rax)
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x80d40
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq 0x28(%rax), %rdi
callq 0x1d780
testb $0x1, %al
jne 0x8a38b
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, -0x200(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, -0x1f8(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x200(%rbp), %rdi
movl -0x1f8(%rbp), %esi
movq %rax, %rdx
callq 0x3db00
movsd %xmm0, -0x130(%rbp)
movsd %xmm1, -0x128(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x130(%rbp), %rdi
callq 0x49040
movsd %xmm0, -0x120(%rbp)
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
movq %rax, -0x208(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1d7a0
movq %rax, %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
jae 0x8a389
movq -0x10(%rbp), %rdi
movl -0x134(%rbp), %eax
movl %eax, %esi
callq 0x1b610
movl (%rax), %eax
movl %eax, -0x138(%rbp)
cmpl $0x0, -0x138(%rbp)
jle 0x8a373
movl -0x138(%rbp), %eax
movl %eax, -0x20c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x20c(%rbp), %eax
cmpl %ecx, %eax
je 0x8a373
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x138(%rbp), %rsi
callq 0x23eb0
movq %rax, %rdi
callq 0x10ef0
testb $0x1, %al
jne 0x8a249
jmp 0x8a36f
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10ed0
cmpl $0x1, %eax
je 0x8a2b2
movq -0x160(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x138(%rbp), %rsi
callq 0x23eb0
movq %rax, %rdi
callq 0x1d780
testb $0x1, %al
jne 0x8a283
jmp 0x8a2b2
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a3d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x7d290
movq -0x160(%rbp), %rax
movl -0x138(%rbp), %ecx
movl %ecx, 0x48(%rax)
jmp 0x8a389
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a4c0
movq %rax, -0x218(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x210(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq -0x218(%rbp), %rdi
movl -0x210(%rbp), %esi
movq %rax, %rdx
callq 0x3db00
movsd %xmm0, -0x150(%rbp)
movsd %xmm1, -0x148(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x11090
movq %rax, %rsi
leaq -0x150(%rbp), %rdi
callq 0x49040
movsd %xmm0, -0x140(%rbp)
movsd -0x140(%rbp), %xmm1
movsd -0x120(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x8a36d
movq -0x160(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1a3d0
movq %rax, %rdi
xorl %esi, %esi
callq 0x7d290
movq -0x160(%rbp), %rax
movl -0x138(%rbp), %ecx
movl %ecx, 0x48(%rax)
jmp 0x8a389
jmp 0x8a371
jmp 0x8a389
jmp 0x8a373
jmp 0x8a375
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x8a1ad
jmp 0x8a38b
jmp 0x8a3f3
cmpl $0x0, -0x114(%rbp)
je 0x8a3f1
movl -0x114(%rbp), %eax
movl %eax, -0x21c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1b470
movl %eax, %ecx
movl -0x21c(%rbp), %eax
cmpl %ecx, %eax
je 0x8a3f1
movq -0x160(%rbp), %rax
movb $0x0, 0x41(%rax)
cmpl $0x0, -0x114(%rbp)
jle 0x8a3ef
movq -0x160(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x49590
movq %rax, %rdi
callq 0x80d40
movl %eax, %ecx
movq -0x160(%rbp), %rax
movl %ecx, 0x4c(%rax)
jmp 0x8a3f1
jmp 0x8a3f3
movq -0x160(%rbp), %rdi
callq 0x8a6f0
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax,%rax)