// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Kicker.cpp
// Function: Kicker::Kicker()
Kicker::Kicker() {
  /** POINTS_NUM = 81 = 18 + 27 + 36 */
  mNlayer[0] = 18;
  mNlayer[1] = 27;
  mNlayer[2] = 36;

  mD1 = 0.585; /** (mDlayer[0] + mDlayer[1]) / 2.0 */
  mD2 = 0.835; /** (mDlayer[1] + mDlayer[2]) / 2.0 */
  mDlayer[0] = 0.46;
  mDlayer[1] = 0.71;
  mDlayer[2] = 0.96; /** 球员的kick_area是0.985到1.185之间 */

  /** 计算所有的点 */
  int k = 0;
  AngleDeg angle = 0.0;
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < mNlayer[i]; ++j) {
      angle = 360.0 * j / mNlayer[i];
      mPoint[k] = Polar2Vector(mDlayer[i], angle);
      ++k;
    }
  }

  mOppCurve.SetOutMinMax(0.0, 1.0);
  mOppCurve.Interpolate(0.0, 0.0, 1.0, 0.8, 2.0,
                        1.0); /** 输入为近身对手离球的距离减去球员的kick_area */
  mRandCurve.SetOutMinMax(0.6, 1.0);
  mRandCurve.Interpolate(0.0, 1.0, 1.0, 0.9, 2.0,
                         0.6); /** 输入为max_rand中属于球位置因素的部分 */
  mSpeedCurve.SetOutMinMax(0.0, 1.0);
  mSpeedCurve.Interpolate(0.0, 0.0, 1.6, 0.8,
                          ServerParam::instance().ballSpeedMax(), 1.0);

  //==========================================================================

  mInput.mPlayerType = -1;
  mKickSpeed = 0.0;
  mKickTarget = Vector(0.0, 0.0);

  for (int i = 0; i < POINTS_NUM; ++i) {
    mKickRate[i] = 0.0;
    mMaxAccel[i] = 0.0;
    mRandEva[i] = 0.0;
    mPointEva[i] = 0.0;
  }

  mMaxRandFactor = 0.0;

  for (int i = 0; i < 360; ++i) {
    for (int j = 0; j < 3; ++j) {
      mMaxSpeed[i][j] = 0.0;
    }
  }

  /** 将要读取或计算mKickerValue表 */
  memset(mKickerValue, 0, sizeof(mKickerValue));

  if (PlayerParam::instance().KickerMode() == 0) {
    ReadUtilityTable();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0x10(%rbp), %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
xorl %edx, %edx
callq 0x13c70
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rdx
xorl %ecx, %ecx
movl %ecx, %esi
callq 0x41970
movq -0x230(%rbp), %rdi
addq $0x10, %rdi
callq 0x4ad30
movq -0x230(%rbp), %rdi
addq $0x30, %rdi
callq 0x4ad50
movq -0x230(%rbp), %rdi
addq $0x48, %rdi
callq 0x563c0
movq -0x230(%rbp), %rdi
addq $0x2b4508, %rdi         # imm = 0x2B4508
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x71bcc(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x38(%rbp)
leaq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rcx
leaq -0x30(%rbp), %r8
leaq -0x38(%rbp), %r9
callq 0x56430
movq -0x230(%rbp), %rdi
addq $0x2b4530, %rdi         # imm = 0x2B4530
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd 0x71b78(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x60(%rbp)
leaq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
leaq -0x60(%rbp), %r9
callq 0x56430
movq -0x230(%rbp), %rdi
addq $0x2b4558, %rdi         # imm = 0x2B4558
xorps %xmm0, %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd 0x71b24(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x88(%rbp)
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %rcx
leaq -0x80(%rbp), %r8
leaq -0x88(%rbp), %r9
callq 0x56430
movq -0x230(%rbp), %rdi
addq $0x2b4580, %rdi         # imm = 0x2B4580
callq 0x564a0
movq -0x230(%rbp), %rdi
addq $0x2b45d8, %rdi         # imm = 0x2B45D8
xorps %xmm0, %xmm0
movsd %xmm0, -0x90(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x98(%rbp)
leaq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x11a10
movq -0x230(%rbp), %rdi
addq $0x2b45e8, %rdi         # imm = 0x2B45E8
callq 0x56550
movq -0x230(%rbp), %rdi
addq $0x2b4870, %rdi         # imm = 0x2B4870
callq 0x56550
movq -0x230(%rbp), %rdi
addq $0x2b4af8, %rdi         # imm = 0x2B4AF8
callq 0x56550
movq -0x230(%rbp), %rdi
addq $0x2b4d80, %rdi         # imm = 0x2B4D80
callq 0x56550
movq -0x230(%rbp), %rdi
addq $0x2b5010, %rdi         # imm = 0x2B5010
callq 0x56560
movq -0x230(%rbp), %rdi
addq $0x2b9390, %rdi         # imm = 0x2B9390
callq 0x565b0
movq -0x230(%rbp), %rdi
addq $0x2bb550, %rdi         # imm = 0x2BB550
callq 0x56600
movq -0x230(%rbp), %rdi
addq $0x2bf8d0, %rdi         # imm = 0x2BF8D0
callq 0x56600
movq -0x230(%rbp), %rdi
addq $0x2c3c50, %rdi         # imm = 0x2C3C50
callq 0x56600
movq -0x230(%rbp), %rdi
addq $0x10, %rdi
movq $0x0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x4aaa0
movq -0x230(%rbp), %rdi
movl $0x12, (%rax)
addq $0x10, %rdi
movq $0x1, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x4aaa0
movq -0x230(%rbp), %rdi
movl $0x1b, (%rax)
addq $0x10, %rdi
movq $0x2, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x4aaa0
movq -0x230(%rbp), %rdi
movl $0x24, (%rax)
movsd 0x731cc(%rip), %xmm0    # 0xc2858
movsd %xmm0, 0x20(%rdi)
movsd 0x731b7(%rip), %xmm0    # 0xc2850
movsd %xmm0, 0x28(%rdi)
addq $0x30, %rdi
movq $0x0, -0xb8(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x4aae0
movq -0x230(%rbp), %rdi
movsd 0x73180(%rip), %xmm0    # 0xc2848
movsd %xmm0, (%rax)
addq $0x30, %rdi
movq $0x1, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x4aae0
movq -0x230(%rbp), %rdi
movsd 0x7314a(%rip), %xmm0    # 0xc2840
movsd %xmm0, (%rax)
addq $0x30, %rdi
movq $0x2, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x4aae0
movsd 0x7311b(%rip), %xmm0    # 0xc2838
movsd %xmm0, (%rax)
movl $0x0, -0xcc(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xd8(%rbp)
movl $0x0, -0xdc(%rbp)
cmpl $0x3, -0xdc(%rbp)
jge 0x4f8a9
movl $0x0, -0xe0(%rbp)
movq -0x230(%rbp), %rdi
movl -0xe0(%rbp), %eax
movl %eax, -0x234(%rbp)
addq $0x10, %rdi
movslq -0xdc(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0x4aaa0
movq %rax, %rcx
movl -0x234(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4f893
movq -0x230(%rbp), %rdi
cvtsi2sdl -0xe0(%rbp), %xmm1
movsd 0x71898(%rip), %xmm0    # 0xc1048
mulsd %xmm1, %xmm0
movsd %xmm0, -0x240(%rbp)
addq $0x10, %rdi
movslq -0xdc(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x4aaa0
movsd -0x240(%rbp), %xmm0
movq -0x230(%rbp), %rdi
cvtsi2sdl (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
addq $0x30, %rdi
movslq -0xdc(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rsi
callq 0x4aae0
movq %rax, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x112c0
movq -0x230(%rbp), %rdi
movsd %xmm0, -0x100(%rbp)
movsd %xmm1, -0xf8(%rbp)
addq $0x48, %rdi
movslq -0xcc(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x110(%rbp), %rsi
callq 0x56650
movq -0x100(%rbp), %rcx
movq %rcx, (%rax)
movq -0xf8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
movl -0xe0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe0(%rbp)
jmp 0x4f757
jmp 0x4f895
movl -0xdc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xdc(%rbp)
jmp 0x4f740
movq -0x230(%rbp), %rdi
addq $0x2b4508, %rdi         # imm = 0x2B4508
xorps %xmm0, %xmm0
movsd %xmm0, -0x118(%rbp)
movsd 0x71746(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x120(%rbp)
leaq -0x118(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x56670
movq -0x230(%rbp), %rdi
addq $0x2b4508, %rdi         # imm = 0x2B4508
xorps %xmm0, %xmm0
movsd %xmm0, -0x128(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x130(%rbp)
movsd 0x716ff(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x138(%rbp)
movsd 0x72bf7(%rip), %xmm0    # 0xc2518
movsd %xmm0, -0x140(%rbp)
movsd 0x71b7f(%rip), %xmm0    # 0xc14b0
movsd %xmm0, -0x148(%rbp)
movsd 0x716cf(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x150(%rbp)
leaq -0x128(%rbp), %rsi
leaq -0x130(%rbp), %rdx
leaq -0x138(%rbp), %rcx
leaq -0x140(%rbp), %r8
leaq -0x148(%rbp), %r9
leaq -0x150(%rbp), %rax
movq %rax, (%rsp)
callq 0x566a0
movq -0x230(%rbp), %rdi
addq $0x2b4530, %rdi         # imm = 0x2B4530
movsd 0x71fd6(%rip), %xmm0    # 0xc1968
movsd %xmm0, -0x158(%rbp)
movsd 0x7166e(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x160(%rbp)
leaq -0x158(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x56670
movq -0x230(%rbp), %rdi
addq $0x2b4530, %rdi         # imm = 0x2B4530
xorps %xmm0, %xmm0
movsd %xmm0, -0x168(%rbp)
movsd 0x71632(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x170(%rbp)
movsd 0x71622(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x178(%rbp)
movsd 0x72e6a(%rip), %xmm0    # 0xc2868
movsd %xmm0, -0x180(%rbp)
movsd 0x71aa2(%rip), %xmm0    # 0xc14b0
movsd %xmm0, -0x188(%rbp)
movsd 0x71f4a(%rip), %xmm0    # 0xc1968
movsd %xmm0, -0x190(%rbp)
leaq -0x168(%rbp), %rsi
leaq -0x170(%rbp), %rdx
leaq -0x178(%rbp), %rcx
leaq -0x180(%rbp), %r8
leaq -0x188(%rbp), %r9
leaq -0x190(%rbp), %rax
movq %rax, (%rsp)
callq 0x566a0
movq -0x230(%rbp), %rdi
addq $0x2b4558, %rdi         # imm = 0x2B4558
xorps %xmm0, %xmm0
movsd %xmm0, -0x198(%rbp)
movsd 0x71596(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x1a0(%rbp)
leaq -0x198(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x56670
movq -0x230(%rbp), %rax
addq $0x2b4558, %rax         # imm = 0x2B4558
movq %rax, -0x248(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1a8(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1b0(%rbp)
movsd 0x72d99(%rip), %xmm0    # 0xc2860
movsd %xmm0, -0x1b8(%rbp)
movsd 0x72a41(%rip), %xmm0    # 0xc2518
movsd %xmm0, -0x1c0(%rbp)
callq 0x855e0
movq %rax, %rdi
callq 0x23d60
movq -0x248(%rbp), %rdi
movq %rax, %r9
movsd 0x71512(%rip), %xmm0    # 0xc1010
movsd %xmm0, -0x1c8(%rbp)
leaq -0x1a8(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
leaq -0x1b8(%rbp), %rcx
leaq -0x1c0(%rbp), %r8
leaq -0x1c8(%rbp), %rax
movq %rax, (%rsp)
callq 0x566a0
movq -0x230(%rbp), %rax
movl $0xffffffff, 0x2b4580(%rax) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movsd %xmm0, 0x2b45d0(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1e0(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x1e8(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x1e8(%rbp), %rdx
callq 0x11a10
movq -0x230(%rbp), %rax
movq -0x1d8(%rbp), %rcx
movq %rcx, 0x2b45d8(%rax)
movq -0x1d0(%rbp), %rcx
movq %rcx, 0x2b45e0(%rax)
movl $0x0, -0x1ec(%rbp)
cmpl $0x51, -0x1ec(%rbp)
jge 0x4fc88
movq -0x230(%rbp), %rdi
addq $0x2b45e8, %rdi         # imm = 0x2B45E8
movslq -0x1ec(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq -0x1f8(%rbp), %rsi
callq 0x568c0
movq -0x230(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x2b4870, %rdi         # imm = 0x2B4870
movslq -0x1ec(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq -0x200(%rbp), %rsi
callq 0x568c0
movq -0x230(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x2b4af8, %rdi         # imm = 0x2B4AF8
movslq -0x1ec(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0x208(%rbp), %rsi
callq 0x568c0
movq -0x230(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x2b4d80, %rdi         # imm = 0x2B4D80
movslq -0x1ec(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x210(%rbp), %rsi
callq 0x568c0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl -0x1ec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1ec(%rbp)
jmp 0x4fbab
movq -0x230(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x2b5008(%rax)
movl $0x0, -0x214(%rbp)
cmpl $0x168, -0x214(%rbp)    # imm = 0x168
jge 0x4fd3a
movl $0x0, -0x218(%rbp)
cmpl $0x3, -0x218(%rbp)
jge 0x4fd24
movq -0x230(%rbp), %rdi
addq $0x2b9390, %rdi         # imm = 0x2B9390
movslq -0x214(%rbp), %rax
movq %rax, -0x220(%rbp)
leaq -0x220(%rbp), %rsi
callq 0x568e0
movq %rax, %rdi
movslq -0x218(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x228(%rbp), %rsi
callq 0x4aae0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movl -0x218(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x218(%rbp)
jmp 0x4fcbe
jmp 0x4fd26
movl -0x214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x214(%rbp)
jmp 0x4fca4
movq -0x230(%rbp), %rdi
addq $0x558, %rdi            # imm = 0x558
xorl %esi, %esi
movl $0x2b3fb0, %edx         # imm = 0x2B3FB0
callq 0xa310
callq 0x798a0
movq %rax, %rdi
callq 0x56900
cmpl $0x0, (%rax)
jne 0x4fd72
movq -0x230(%rbp), %rdi
callq 0x4fd80
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopl (%rax,%rax)