// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Trainer.cpp
// Function: Trainer::PrepareForTrain()
void Trainer::PrepareForTrain() {
  static uint i = 0;

  if (i == 0) {
    if (mpAgent->World().CurrentTime().T()) {
      std::cerr << "#" << PlayerParam::instance().teamName()
                << " Trainer: episode " << mTrainCount - 1 << " last "
                << mpAgent->World().CurrentTime().T() - mLastStopTime
                << " cycles" << std::endl;
    }

    std::cerr << "#" << PlayerParam::instance().teamName()
              << " Trainer: episode " << mTrainCount << " prepair @ "
              << mpAgent->World().CurrentTime() << std::endl;
  }

  mLastStopTime = mpAgent->World().CurrentTime().T();

  if (!mConverse)
    MoveBall(mBallStateList[i].first, mBallStateList[i].second);
  else
    MoveBall(-mBallStateList[i].first, -mBallStateList[i].second);

  for (std::vector<Trainer::PlayerState>::const_iterator it =
           mPlayerStatesList[i].begin();
       it != mPlayerStatesList[i].end(); it++) {
    if (!mConverse) {
      MovePlayer(it->mUnum, it->mPos, it->mVel, it->mBodyDir);
    } else {
      if (it->mUnum > 0) {
        MovePlayer(-mTm2Opp[it->mUnum], -it->mPos, -it->mVel,
                   GetNormalizeAngleDeg(-180 + it->mBodyDir));
      } else {
        MovePlayer(mOpp2Tm[-it->mUnum], -it->mPos, -it->mVel,
                   GetNormalizeAngleDeg(-180 + it->mBodyDir));
      }
    }
  }
  mpAgent->ChangePlayMode(mServerPlayModeList[i]);
  Recover();
  i++;

  if (i >= mPlayerStatesList.size()) {
    i = 0;
    mPrepared = true;
    std::cerr << "#" << PlayerParam::instance().teamName()
              << " Trainer: episode " << mTrainCount << " start @ "
              << mpAgent->World().CurrentTime() << std::endl;

    mTrainCount++;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpl $0x0, 0x34ccef(%rip)    # 0x3e1250
jne 0x94708
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
cmpl $0x0, %eax
je 0x9465f
movq 0x69a59(%rip), %rdi     # 0xfdff0
leaq 0x309cc(%rip), %rsi     # 0xc4f6a
callq 0xa5a0
movq %rax, -0xf0(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x11db0
movq -0xf0(%rbp), %rdi
movq %rax, %rsi
callq 0xa4f0
movq %rax, %rdi
leaq 0x30cbc(%rip), %rsi     # 0xc528c
callq 0xa5a0
movq %rax, %rdi
movq -0xe0(%rbp), %rax
movl 0x9c(%rax), %esi
subl $0x1, %esi
callq 0xa7f0
movq %rax, %rdi
leaq 0x30ca8(%rip), %rsi     # 0xc529f
callq 0xa5a0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
movq -0xe8(%rbp), %rdi
movl %eax, %esi
movq -0xe0(%rbp), %rax
subl 0x194(%rax), %esi
callq 0xa7f0
movq %rax, %rdi
leaq 0x30c5b(%rip), %rsi     # 0xc52a6
callq 0xa5a0
movq %rax, %rdi
movq 0x69956(%rip), %rsi     # 0xfdfb0
callq 0xa630
movq 0x6998a(%rip), %rdi     # 0xfdff0
leaq 0x308fd(%rip), %rsi     # 0xc4f6a
callq 0xa5a0
movq %rax, -0x100(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x11db0
movq -0x100(%rbp), %rdi
movq %rax, %rsi
callq 0xa4f0
movq %rax, %rdi
leaq 0x30bed(%rip), %rsi     # 0xc528c
callq 0xa5a0
movq %rax, %rdi
movq -0xe0(%rbp), %rax
movl 0x9c(%rax), %esi
callq 0xa7f0
movq %rax, %rdi
leaq 0x30beb(%rip), %rsi     # 0xc52ae
callq 0xa5a0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x12100
movq -0xf8(%rbp), %rdi
movq %rax, %rsi
callq 0x11d40
movq %rax, %rdi
movq 0x698ad(%rip), %rsi     # 0xfdfb0
callq 0xa630
movq -0xe0(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x12100
movq %rax, %rdi
callq 0x13040
movl %eax, %ecx
movq -0xe0(%rbp), %rax
movl %ecx, 0x194(%rax)
testb $0x1, 0x33(%rax)
jne 0x947b4
movq -0xe0(%rbp), %rdi
addq $0x160, %rdi            # imm = 0x160
movl 0x34caff(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98f60
movq -0xe0(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
addq $0x160, %rdi            # imm = 0x160
movl 0x34cad5(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98f60
movq -0xe0(%rbp), %rdi
movq 0x10(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x28(%rbp), %xmm2
movsd -0x20(%rbp), %xmm3
callq 0x95250
jmp 0x94832
movq -0xe0(%rbp), %rdi
addq $0x160, %rdi            # imm = 0x160
movl 0x34ca88(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98f60
movq %rax, %rdi
callq 0x6f560
movq -0xe0(%rbp), %rdi
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
addq $0x160, %rdi            # imm = 0x160
movl 0x34ca5b(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98f60
movq %rax, %rdi
addq $0x10, %rdi
callq 0x6f560
movq -0xe0(%rbp), %rdi
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x48(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
callq 0x95250
movq -0xe0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movl 0x34ca0a(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98c80
movq %rax, %rdi
callq 0x98ca0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x98cd0
movq -0xe0(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movl 0x34c9d6(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98c80
movq %rax, %rdi
callq 0x98d50
movq %rax, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x98d10
testb $0x1, %al
jne 0x948a3
jmp 0x94b03
movq -0xe0(%rbp), %rax
testb $0x1, 0x33(%rax)
jne 0x9492c
leaq -0x50(%rbp), %rdi
callq 0x98f80
movl (%rax), %eax
movl %eax, -0x104(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq 0x8(%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq 0x18(%rax), %rcx
movq %rcx, -0x80(%rbp)
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq -0xe0(%rbp), %rdi
movl -0x104(%rbp), %esi
movsd 0x28(%rax), %xmm4
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
movsd -0x80(%rbp), %xmm2
movsd -0x78(%rbp), %xmm3
callq 0x950a0
jmp 0x94aea
leaq -0x50(%rbp), %rdi
callq 0x98f80
cmpl $0x0, (%rax)
jle 0x94a13
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq -0xe0(%rbp), %rcx
movslq (%rax), %rdx
xorl %eax, %eax
subl 0x34(%rcx,%rdx,4), %eax
movl %eax, -0x108(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq %rax, %rdi
addq $0x8, %rdi
callq 0x6f560
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq %rax, %rdi
addq $0x18, %rdi
callq 0x6f560
movsd %xmm0, -0xa0(%rbp)
movsd %xmm1, -0x98(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movsd 0x2c678(%rip), %xmm0    # 0xc1030
addsd 0x28(%rax), %xmm0
movsd 0x2c66b(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0xa8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x116b0
movq -0xe0(%rbp), %rdi
movl -0x108(%rbp), %esi
movaps %xmm0, %xmm4
movsd -0x90(%rbp), %xmm0
movsd -0x88(%rbp), %xmm1
movsd -0xa0(%rbp), %xmm2
movsd -0x98(%rbp), %xmm3
callq 0x950a0
jmp 0x94ae8
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq %rax, %rdx
movq -0xe0(%rbp), %rax
xorl %ecx, %ecx
subl (%rdx), %ecx
movslq %ecx, %rcx
movl 0x64(%rax,%rcx,4), %eax
movl %eax, -0x10c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq %rax, %rdi
addq $0x8, %rdi
callq 0x6f560
movsd %xmm0, -0xb8(%rbp)
movsd %xmm1, -0xb0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movq %rax, %rdi
addq $0x18, %rdi
callq 0x6f560
movsd %xmm0, -0xc8(%rbp)
movsd %xmm1, -0xc0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x98f80
movsd 0x2c59e(%rip), %xmm0    # 0xc1030
addsd 0x28(%rax), %xmm0
movsd 0x2c591(%rip), %xmm1    # 0xc1030
movsd %xmm1, -0xd0(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x116b0
movq -0xe0(%rbp), %rdi
movl -0x10c(%rbp), %esi
movaps %xmm0, %xmm4
movsd -0xb8(%rbp), %xmm0
movsd -0xb0(%rbp), %xmm1
movsd -0xc8(%rbp), %xmm2
movsd -0xc0(%rbp), %xmm3
callq 0x950a0
jmp 0x94aea
jmp 0x94aec
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x98d80
movq %rax, -0xd8(%rbp)
jmp 0x94866
movq -0xe0(%rbp), %rdi
movq 0x18(%rdi), %rax
movq %rax, -0x120(%rbp)
addq $0x178, %rdi            # imm = 0x178
movl 0x34c72e(%rip), %eax    # 0x3e1250
movl %eax, %esi
callq 0x98fa0
movq -0x120(%rbp), %rdi
movl (%rax), %esi
callq 0x97cc0
movq -0xe0(%rbp), %rdi
callq 0x95300
movq -0xe0(%rbp), %rdi
movl 0x34c700(%rip), %eax    # 0x3e1250
addl $0x1, %eax
movl %eax, 0x34c6f7(%rip)    # 0x3e1250
movl 0x34c6f1(%rip), %eax    # 0x3e1250
movq %rax, -0x118(%rbp)
addq $0x120, %rdi            # imm = 0x120
callq 0x98fc0
movq %rax, %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
jb 0x94c59
movq -0xe0(%rbp), %rax
movl $0x0, 0x34c6ba(%rip)    # 0x3e1250
movb $0x1, 0x31(%rax)
movq 0x6944f(%rip), %rdi     # 0xfdff0
leaq 0x303c2(%rip), %rsi     # 0xc4f6a
callq 0xa5a0
movq %rax, -0x130(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x11db0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0xa4f0
movq %rax, %rdi
leaq 0x306b2(%rip), %rsi     # 0xc528c
callq 0xa5a0
movq %rax, %rdi
movq -0xe0(%rbp), %rax
movl 0x9c(%rax), %esi
callq 0xa7f0
movq %rax, %rdi
leaq 0x306bc(%rip), %rsi     # 0xc52ba
callq 0xa5a0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, -0x128(%rbp)
movq 0x18(%rax), %rdi
callq 0x1a9b0
movq %rax, %rdi
callq 0x12100
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x11d40
movq %rax, %rdi
movq 0x69372(%rip), %rsi     # 0xfdfb0
callq 0xa630
movq -0xe0(%rbp), %rax
movl 0x9c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x9c(%rax)
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)