LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorHold.cpp
// Function: BehaviorHoldExecuter::Execute(ActiveBehavior const&)
bool BehaviorHoldExecuter::Execute(const ActiveBehavior &hold) {
  Logger::instance().LogDribble(mBallState.GetPos(), hold.mTarget, "@Hold",
                                true);
  //	Logger::instance().GetTextLogger("Hold")<< mWorldState.CurrentTime(). +
  //"Hold";
  if (hold.mDetailType == BDT_Hold_Turn) {
    return Dasher::instance()
        .GetTurnBodyToAngleAction(mAgent, hold.mAngle)
        .Execute(mAgent);
  } else
    return Kicker::instance().KickBallCloseToBody(mAgent, hold.mAngle, 0.6);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2ca2e
movq 0x18(%rbx), %rsi
addq $0x8, %rsi
leaq 0x28(%r14), %rdx
leaq 0x442f8(%rip), %rcx     # 0x579f1
pushq $0x1
popq %r8
movq %rax, %rdi
callq 0x2d324
cmpl $0xa, 0x98(%r14)
jne 0x13742
callq 0x1a77c
movq 0x8(%rbx), %rdx
movsd 0x20(%r14), %xmm0
leaq -0x40(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x1bf64
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0xa74c
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x26f9c
movq 0x8(%rbx), %rsi
movsd 0x20(%r14), %xmm0
movsd 0x44237(%rip), %xmm1    # 0x57990
movq %rax, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x299bc
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorPass.cpp
// Function: BehaviorPassExecuter::Execute(ActiveBehavior const&)
bool BehaviorPassExecuter::Execute(const ActiveBehavior &pass) {
  Logger::instance().LogPass(false, mBallState.GetPos(), pass.mTarget, "@Pass",
                             true);
  if (pass.mDetailType == BDT_Pass_Direct)
    return Kicker::instance().KickBall(mAgent, pass.mTarget, pass.mKickSpeed,
                                       KM_Quick);
  if (pass.mDetailType == BDT_Pass_Clear) {
    //		Logger::instance().GetTextLogger("Clear")<<
    //mWorldState.CurrentTime().S() + "Clear";
    if (Tackler::instance().CanTackleToDir(mAgent, pass.mAngle) &&
        Tackler::instance().GetBallVelAfterTackle(mAgent, pass.mAngle).Mod() >
            Kicker::instance().GetMaxSpeed(mAgent, pass.mTarget, 1) - 0.08)
      return Tackler::instance().TackleToDir(mAgent, pass.mAngle);
    else
      return Kicker::instance().KickBall(mAgent, pass.mTarget,
                                         ServerParam::instance().ballSpeedMax(),
                                         KM_Quick, 0);
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
callq 0x2ca2e
movq 0x18(%r14), %rdx
addq $0x8, %rdx
leaq 0x28(%r15), %rbx
leaq 0x430b0(%rip), %r8      # 0x57c29
xorl %r12d, %r12d
pushq $0x1
popq %r9
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x2d3cc
movl 0x98(%r15), %eax
cmpl $0x4, %eax
je 0x14bd1
cmpl $0x3, %eax
jne 0x14c9a
callq 0x26f9c
movq 0x8(%r14), %rsi
movsd 0x48(%r15), %xmm0
pushq $0x2
popq %rcx
movq %rax, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2929c
callq 0x40e2a
movq 0x8(%r14), %rsi
addq $0x20, %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0x41620
testb %al, %al
je 0x14c67
callq 0x40e2a
movq 0x8(%r14), %rsi
movsd (%r15), %xmm0
movq %rax, %rdi
callq 0x4120e
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x26f9c
movq 0x8(%r14), %rsi
leaq -0x2c(%rbp), %rcx
movl $0x1, (%rcx)
movq %rax, %rdi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2789e
addsd 0x42f8c(%rip), %xmm0    # 0x57bd0
movsd -0x28(%rbp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x14c67
callq 0x40e2a
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x41664
jmp 0x14c97
callq 0x26f9c
movq %rax, %r15
movq 0x8(%r14), %r14
callq 0x3db2c
movsd 0x30f8(%rax), %xmm0
pushq $0x2
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2929c
movl %eax, %r12d
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorPass.h
// Function: BehaviorPassExecuter::SubmitVisualRequest(ActiveBehavior const&, double)
void SubmitVisualRequest(const ActiveBehavior &pass, double plus = 0.0) {
    if (pass.mKickCycle == 1) {
      VisualSystem::instance().RaisePlayer(mAgent, pass.mKeyTm.mUnum,
                                           3.0 + plus);
      VisualSystem::instance().RaisePlayer(mAgent, -pass.mKeyOppGB.mUnum,
                                           3.0 + plus);
      VisualSystem::instance().RaisePlayer(mAgent, -pass.mKeyOppGT.mUnum,
                                           3.0 + plus);
    } else {
      VisualSystem::instance().RaisePlayer(mAgent, pass.mKeyTm.mUnum,
                                           2.0 + plus);
      VisualSystem::instance().RaisePlayer(mAgent, -pass.mKeyOppGB.mUnum,
                                           3.0 + plus);
      VisualSystem::instance().RaisePlayer(mAgent, -pass.mKeyOppGT.mUnum,
                                           2.0 + plus);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, -0x20(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movl 0x18(%rsi), %r15d
callq 0x49230
movq 0x8(%r14), %rsi
movl 0x58(%rbx), %edx
cmpl $0x1, %r15d
jne 0x159f7
movsd -0x20(%rbp), %xmm0
addsd 0x42223(%rip), %xmm0    # 0x57bf0
movsd %xmm0, -0x20(%rbp)
movq %rax, %rdi
callq 0x1270c
callq 0x49230
movq 0x8(%r14), %rsi
xorl %edx, %edx
subl 0x78(%rbx), %edx
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
callq 0x1270c
jmp 0x15a3e
movsd 0x41d59(%rip), %xmm0    # 0x57758
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq %rax, %rdi
callq 0x1270c
callq 0x49230
movq 0x8(%r14), %rsi
xorl %edx, %edx
subl 0x78(%rbx), %edx
movsd -0x20(%rbp), %xmm0
addsd 0x421c4(%rip), %xmm0    # 0x57bf0
movq %rax, %rdi
callq 0x1270c
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x49230
movq 0x8(%r14), %rsi
xorl %edx, %edx
subl 0x88(%rbx), %edx
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1270c
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorPosition.cpp
// Function: BehaviorPositionExecuter::Execute(ActiveBehavior const&)
bool BehaviorPositionExecuter::Execute(const ActiveBehavior &beh) {
  Logger::instance().LogGoToPoint(mSelfState.GetPos(), beh.mTarget,
                                  "@Position");

  return Dasher::instance().GoToPoint(mAgent, beh.mTarget, beh.mBuffer,
                                      beh.mPower, false, true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2ca2e
movq 0x20(%r14), %rsi
addq $0x8, %rsi
leaq 0x28(%rbx), %rdx
leaq 0x41904(%rip), %rcx     # 0x57dd9
movq %rax, %rdi
callq 0x2ceae
callq 0x1a77c
movq 0x8(%r14), %rsi
movsd 0x28(%rbx), %xmm0
movsd 0x30(%rbx), %xmm1
movsd 0xa0(%rbx), %xmm2
movsd 0x38(%rbx), %xmm3
pushq $0x1
popq %rcx
movq %rax, %rdi
xorl %edx, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x1bd48
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorPosition.h
// Function: BehaviorPositionExecuter::SubmitVisualRequest(ActiveBehavior const&, double)
void SubmitVisualRequest(const ActiveBehavior &position, double plus = 0.0) {
    (void)position;
    (void)plus;

    if (fabs(mSelfState.GetPos().X() - mPositionInfo.GetTeammateOffsideLine()) <
        30.0) {
      VisualSystem::instance().RaisePlayer(
          mAgent, -mPositionInfo.GetTeammateOffsideLineOpp(), 3.0);
    }

    if (mSelfState.GetUnum() == mPositionInfo.GetCloseTeammateToBall()[0] ||
        mSelfState.GetUnum() == mPositionInfo.GetCloseTeammateToBall()[1]) {
      VisualSystem::instance().RaiseBall(mAgent, 2);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq 0x28(%rdi), %rdi
movsd 0x8(%rax), %xmm0
subsd 0x17a0(%rdi), %xmm0
andpd 0x404c9(%rip), %xmm0    # 0x57010
movsd 0x40bc1(%rip), %xmm1    # 0x57710
ucomisd %xmm0, %xmm1
jbe 0x16b82
callq 0x49230
movq 0x8(%rbx), %rsi
movq 0x28(%rbx), %rcx
xorl %edx, %edx
subl 0x1798(%rcx), %edx
movsd 0x4107e(%rip), %xmm0    # 0x57bf0
movq %rax, %rdi
callq 0x1270c
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movl 0x11c(%rax), %r14d
callq 0x3c1ae
movq (%rax), %rax
cmpl (%rax), %r14d
je 0x16bb3
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rdi
movl 0x11c(%rax), %r14d
callq 0x3c1ae
movq (%rax), %rax
cmpl 0x4(%rax), %r14d
jne 0x16bd0
callq 0x49230
movq 0x8(%rbx), %rsi
movsd 0x40b94(%rip), %xmm0    # 0x57758
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x163b0
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorSetplay.cpp
// Function: BehaviorSetplayExecuter::Execute(ActiveBehavior const&)
bool BehaviorSetplayExecuter::Execute(const ActiveBehavior &setplay) {
  if (mWorldState.GetPlayMode() == PM_Before_Kick_Off) {
    if (setplay.mDetailType == BDT_Setplay_Move) {
      return mAgent.Move(setplay.mTarget);
    } else if (setplay.mDetailType == BDT_Setplay_Scan) {
      VisualSystem::instance().ForbidDecision(mAgent);
      return mAgent.Turn(50.0);
    } else {
      PRINT_ERROR("Setplay Detail Type Error");
      return false;
    }
  } else {
    if (setplay.mDetailType == BDT_Setplay_Scan) {
      return true; //交给视觉决策
    } else if (setplay.mDetailType == BDT_Setplay_GetBall) {
      return Dasher::instance().GetBall(mAgent);
    }
    if (setplay.mDetailType == BDT_Setplay_Move) {
      return mAgent.Move(setplay.mTarget);
    } else {
      PRINT_ERROR("Setplay Detail Type Error");
      return false;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
cmpl $0x16, 0x1c(%rax)
movl 0x98(%rsi), %eax
jne 0x16ce4
cmpl $0x10, %eax
je 0x16d2c
cmpl $0xf, %eax
je 0x16d13
movq 0x6032e(%rip), %rdi     # 0x76ff0
leaq 0x411b6(%rip), %rsi     # 0x57e7f
callq 0x94b0
leaq 0x4449d(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x45
jmp 0x16d7d
cmpl $0xf, %eax
je 0x16d13
cmpl $0x10, %eax
je 0x16d55
cmpl $0x11, %eax
jne 0x16d59
callq 0x1a77c
movq 0x8(%rbx), %rsi
pushq $-0x1
popq %rdx
pushq $0x1
popq %rcx
movq %rax, %rdi
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1c380
movq 0x8(%rbx), %rdi
movsd 0x28(%rsi), %xmm0
movsd 0x30(%rsi), %xmm1
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1725e
callq 0x49230
movq 0x8(%rbx), %rdi
cmpq %rdi, 0x8(%rax)
jne 0x16d42
movb $0x1, 0x63b(%rax)
movsd 0x410f6(%rip), %xmm0    # 0x57e40
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xccb0
movb $0x1, %al
jmp 0x16dae
movq 0x60290(%rip), %rdi     # 0x76ff0
leaq 0x41118(%rip), %rsi     # 0x57e7f
callq 0x94b0
leaq 0x443ff(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x51
popq %rsi
movq %rax, %rdi
callq 0x9890
leaq 0x42692(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x410fe(%rip), %rsi     # 0x57e9a
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorShoot.cpp
// Function: BehaviorShootExecuter::Execute(ActiveBehavior const&)
bool BehaviorShootExecuter::Execute(const ActiveBehavior &shoot) {
  Logger::instance().LogShoot(mBallState.GetPos(), shoot.mTarget, "@Shoot");
  if (shoot.mDetailType == BDT_Shoot_Tackle)
    return Tackler::instance().TackleToDir(mAgent, shoot.mAngle);
  else
    return Kicker::instance().KickBall(mAgent, shoot.mTarget,
                                       ServerParam::instance().ballSpeedMax(),
                                       KM_Quick, 0, true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2ca2e
movq 0x18(%r14), %rsi
addq $0x8, %rsi
leaq 0x28(%rbx), %r15
leaq 0x40be3(%rip), %rcx     # 0x57f4b
movq %rax, %rdi
movq %r15, %rdx
callq 0x2cf58
cmpl $0x9, 0x98(%rbx)
jne 0x173a0
callq 0x40e2a
movq 0x8(%r14), %rsi
addq $0x20, %rbx
movq %rax, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x41664
callq 0x26f9c
movq %rax, %rbx
movq 0x8(%r14), %r14
callq 0x3db2c
movsd 0x30f8(%rax), %xmm0
pushq $0x2
popq %rcx
pushq $0x1
popq %r9
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2929c
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/BehaviorShoot.h
// Function: BehaviorShootExecuter::SubmitVisualRequest(ActiveBehavior const&, double)
void SubmitVisualRequest(const ActiveBehavior &shoot, double plus = 0.0) {
    Assert(shoot.mKeyOppGT.mUnum >= 0);
    Assert(shoot.mKeyOppGB.mUnum >= 0);

    VisualSystem::instance().RaisePlayer(
        mAgent, -mWorldState.GetOpponentGoalieUnum(), 1.0 + plus);
    VisualSystem::instance().RaisePlayer(mAgent, -shoot.mKeyOppGT.mUnum,
                                         2.0 + plus);
    VisualSystem::instance().RaisePlayer(mAgent, -shoot.mKeyOppGB.mUnum,
                                         2.0 + plus);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, -0x20(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
callq 0x49230
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rcx
xorl %r15d, %r15d
xorl %edx, %edx
subl 0x2114(%rcx), %edx
movsd 0x3f77d(%rip), %xmm0    # 0x57048
addsd -0x20(%rbp), %xmm0
movq %rax, %rdi
callq 0x1270c
callq 0x49230
movq 0x8(%r14), %rsi
xorl %edx, %edx
subl 0x88(%rbx), %edx
movsd -0x20(%rbp), %xmm0
addsd 0x3fe62(%rip), %xmm0    # 0x57758
movsd %xmm0, -0x20(%rbp)
movq %rax, %rdi
callq 0x1270c
callq 0x49230
movq 0x8(%r14), %rsi
subl 0x78(%rbx), %r15d
movq %rax, %rdi
movl %r15d, %edx
movsd -0x20(%rbp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1270c
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::Client()
Client::Client() {
  srand(time(0)); // global srand once
  srand48(time(0));

  /** Observer and World Model */
  mpAgent = 0;
  mpObserver = new Observer;
  mpWorldModel = new WorldModel;

  // instance放在这里创建以节省后面的运行效率，部分instance不能放在这里，需要时创建

  /** Assistant instance */

  TimeTest::instance();
  NetworkTest::instance();
  DynamicDebug::instance();
  Logger::instance().Initial(mpObserver, &(mpWorldModel->World(false)));
  Plotter::instance();

  /** Param */
  ServerParam::instance();
  PlayerParam::instance();

  /** Base Model */
  InterceptModel::instance();

  /** Smart Action */
  Dasher::instance();
  Tackler::instance();
  Kicker::instance();

  /** Other Useful instance */
  BehaviorFactory::instance();
  UDPSocket::instance();
  VisualSystem::instance();
  CommunicateSystem::instance();

  /** Parser thread and CommandSend thread */
  mpCommandSender = new CommandSender(mpObserver);

  // ServerPlayModeMap::instance();

  mpParser = new Parser(mpObserver);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5ec68(%rip), %rax     # 0x765f8
movq %rax, (%rdi)
xorl %edi, %edi
callq 0x9460
movl %eax, %edi
callq 0x9490
xorl %edi, %edi
callq 0x9460
movq %rax, %rdi
callq 0x9840
andq $0x0, 0x18(%rbx)
movl $0x56d0, %edi           # imm = 0x56D0
callq 0x94d0
movq %rax, %r14
movq %rax, %rdi
callq 0x31a60
movq %r14, 0x8(%rbx)
pushq $0x28
popq %rdi
callq 0x94d0
movq %rax, %r14
movq %rax, %rdi
callq 0x4c3f0
movq %r14, 0x10(%rbx)
callq 0x4254e
callq 0x3018a
callq 0x1d7c4
callq 0x2ca2e
movq %rax, %r14
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x4c58a
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2caa8
callq 0x3b114
callq 0x3db2c
callq 0x38d94
callq 0x2561a
callq 0x1a77c
callq 0x40e2a
callq 0x26f9c
callq 0x10b3a
callq 0x471ac
callq 0x49230
callq 0x18f98
pushq $0x20
popq %rdi
callq 0x94d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x18be8
movq %r14, 0x28(%rbx)
pushq $0x60
popq %rdi
callq 0x94d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x3495c
movq %r14, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x60
jmp 0x17aa4
movq %rax, %rbx
pushq $0x20
jmp 0x17aa4
movq %rax, %rbx
pushq $0x28
popq %rsi
jmp 0x17aaf
movq %rax, %rbx
movl $0x56d0, %esi           # imm = 0x56D0
movq %r14, %rdi
callq 0x94f0
movq %rbx, %rdi
callq 0x98b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::~Client()
Client::~Client() {
  delete mpCommandSender;
  delete mpParser;

  delete mpObserver;
  delete mpWorldModel;
  delete mpAgent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5eb28(%rip), %rax     # 0x765f8
movq %rax, (%rdi)
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x17ae2
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x17af1
movq (%rdi), %rax
callq *0x10(%rax)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x17b00
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x17b0f
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x17b24
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::RunDynamicDebug()
void Client::RunDynamicDebug() {
  static char msg[MAX_MESSAGE];
  DynamicDebug::instance().Initial(
      mpObserver); // 动态调试的初始化，注意位置不能移动

  DynamicDebug::instance().Run(msg); // 初始化信息
  mpParser->ParseInitializeMsg(msg);

  ConstructAgent();

  MessageType msg_type;

  bool first_parse = true;

  while (true) {
    msg_type = DynamicDebug::instance().Run(msg);

    switch (msg_type) {
    case MT_Parse:
      if (first_parse) {
        mpObserver->Reset();
        first_parse = false;
      }
      mpParser->Parse(msg);
      break;
    case MT_Run:
      Run();
      Logger::instance().Flush(); // flush log
      mpObserver->SetPlanned();
      break;
    case MT_Send:
      mpCommandSender->Run();
      first_parse = true;
      break;
    default:
      return;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1d7c4
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x1d83e
callq 0x1d7c4
leaq 0x61f94(%rip), %r14     # 0x79af0
movq %rax, %rdi
movq %r14, %rsi
callq 0x1dc4a
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x350ca
movq %rbx, %rdi
callq 0x17bf8
movb $0x1, %r15b
callq 0x1d7c4
movq %rax, %rdi
movq %r14, %rsi
callq 0x1dc4a
cmpl $0x2, %eax
jne 0x17bb6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
callq 0x2ca2e
movq %rax, %rdi
callq 0x2cbaa
movq 0x8(%rbx), %rax
movb $0x1, 0x3385(%rax)
jmp 0x17b7e
cmpl $0x3, %eax
je 0x17be0
cmpl $0x1, %eax
jne 0x17bed
testb $0x1, %r15b
je 0x17bcf
movq 0x8(%rbx), %rdi
callq 0x31d2e
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x34bac
xorl %r15d, %r15d
jmp 0x17b7e
movq 0x28(%rbx), %rdi
xorl %esi, %esi
callq 0x18cb8
jmp 0x17b7b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::ConstructAgent()
void Client::ConstructAgent() {
  Assert(mpAgent == 0);
  if (mpObserver->SelfUnum() > 0 && mpObserver->SelfUnum() < TRAINER_UNUM) {
    mpWorldModel->World(false)
        .Teammate(mpObserver->SelfUnum())
        .SetIsAlive(true);
    std::cout << "WrightEagle 2012: constructing agent for player "
              << mpObserver->SelfUnum() << "..." << std::endl;
  } else if (mpObserver->SelfUnum() == TRAINER_UNUM) {
    std::cout << "WrightEagle 2012: constructing agent for trainer... "
              << std::endl;
  } else {
    std::cout << "WrightEagle 2012: constructing agent for coach..."
              << std::endl;
  }
  mpAgent = new Agent(mpObserver->SelfUnum(), mpWorldModel,
                      false); //要知道号码才能初始化

  Formation::instance.AssignWith(mpAgent);
  mpCommandSender->RegisterAgent(mpAgent);
  CommunicateSystem::instance().Initial(mpObserver,
                                        mpAgent); // init communicate system
  VisualSystem::instance().Initial(mpAgent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl 0x2c(%rax), %eax
testl %eax, %eax
jle 0x17c74
cmpl $0xb, %eax
ja 0x17c5f
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x4c58a
movq 0x8(%rbx), %rcx
movslq 0x2c(%rcx), %rcx
imulq $0x178, %rcx, %rcx      # imm = 0x178
movb $0x1, 0x42(%rax,%rcx)
movq 0x5f388(%rip), %rdi     # 0x76fc0
leaq 0x40397(%rip), %rsi     # 0x57fd6
callq 0x94b0
movq 0x8(%rbx), %rcx
movl 0x2c(%rcx), %esi
movq %rax, %rdi
callq 0x9890
leaq 0x407a1(%rip), %rsi     # 0x583fb
movq %rax, %rdi
jmp 0x17c82
cmpl $0xc, %eax
jne 0x17c74
movq 0x5f355(%rip), %rdi     # 0x76fc0
leaq 0x40395(%rip), %rsi     # 0x58007
jmp 0x17c82
movq 0x5f345(%rip), %rdi     # 0x76fc0
leaq 0x403ba(%rip), %rsi     # 0x5803c
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
movl $0x128, %edi            # imm = 0x128
callq 0x94d0
movq %rax, %r14
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
movl 0x2c(%rax), %esi
movq %r14, %rdi
xorl %ecx, %ecx
callq 0xd98c
movq %r14, 0x18(%rbx)
leaq 0x663b4(%rip), %rdi     # 0x7e070
movq %r14, %rsi
callq 0x21562
movq 0x18(%rbx), %rax
movq 0x28(%rbx), %rcx
movq %rax, 0x18(%rcx)
callq 0x18f98
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq %rax, %rdi
callq 0x18ff8
callq 0x49230
movq 0x18(%rbx), %rsi
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x492aa
movq %rax, %rbx
movl $0x128, %esi            # imm = 0x128
movq %r14, %rdi
callq 0x94f0
movq %rbx, %rdi
callq 0x98b0
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::RunNormal()
void Client::RunNormal() {

  mpCommandSender->Start();   //发送命令线程，向server发送信息
  Logger::instance().Start(); // log线程
  mpParser->Start();          //分析线程，接受server发来的信息

  int past_cycle = 0;
  do {
    WaitFor(100); // wait for the parser thread to connect the server
    if (++past_cycle > 20) {
      std::cout << PlayerParam::instance().teamName()
                << ": Connect Server Error ..." << std::endl;
      return;
    }
  } while (mpParser->IsConnectServerOk() == false);

  ConstructAgent();

  SendOptionToServer();

  MainLoop();

  WaitFor(mpObserver->SelfUnum() * 100);
  if (mpObserver->SelfUnum() == 0) {
    std::cout << PlayerParam::instance().teamName() << " Coach: Bye ..."
              << std::endl;
  } else {
    std::cout << PlayerParam::instance().teamName() << " "
              << mpObserver->SelfUnum() << ": Bye ..." << std::endl;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x420b4
callq 0x2ca2e
movq %rax, %rdi
callq 0x420b4
movq 0x20(%rbx), %rdi
callq 0x420b4
pushq $0x15
popq %r14
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x96b0
decl %r14d
je 0x17dcd
movq 0x20(%rbx), %rdi
callq 0x17eea
testb %al, %al
je 0x17d3f
movq %rbx, %rdi
callq 0x17bf8
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x17e0a
movq 0x8(%rbx), %rax
imull $0x64, 0x2c(%rax), %edi
callq 0x17eda
movq 0x8(%rbx), %rax
movl 0x2c(%rax), %r14d
callq 0x38d94
leaq 0x3138(%rax), %rsi
movq 0x5f224(%rip), %rdi     # 0x76fc0
callq 0x9430
testl %r14d, %r14d
je 0x17dee
leaq 0x42df7(%rip), %rsi     # 0x5aba4
movq %rax, %rdi
callq 0x94b0
movq 0x8(%rbx), %rcx
movl 0x2c(%rcx), %esi
movq %rax, %rdi
callq 0x9890
leaq 0x40201(%rip), %rsi     # 0x57fcc
jmp 0x17df5
callq 0x38d94
leaq 0x3138(%rax), %rsi
movq 0x5f1e0(%rip), %rdi     # 0x76fc0
callq 0x9430
leaq 0x401bf(%rip), %rsi     # 0x57fab
jmp 0x17df5
leaq 0x401d1(%rip), %rsi     # 0x57fc6
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x99e8
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Client.cpp
// Function: Client::MainLoop()
void Client::MainLoop() {
  while (mpObserver->WaitForNewInfo()) // 等待新视觉
  {
    NetworkTest::instance().AddDecisionBegin();

    // 比赛结束，bye ...
    if (mpObserver->GetPlayMode() == PM_Time_Over) {
      mpAgent->CheckCommands(mpObserver);
      mpAgent->Bye();

      mpObserver->SetPlanned();
      mpObserver->SetCommandSend();
      Logger::instance().SetFlushCond();

      break;
    }

    DynamicDebug::instance().AddMessage("\0", MT_Run); // 动态调试记录Run信息
    Run();

    mpObserver->SetPlanned();
    mpObserver->SetCommandSend();      //唤醒发送命令的线程
    Logger::instance().SetFlushCond(); // set flush cond and let the logger
                                       // thread flush the logs to file.

    NetworkTest::instance().AddDecisionEnd(mpObserver->CurrentTime());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x40250(%rip), %r14     # 0x5806e
pushq $0x2
popq %r15
movq 0x8(%rbx), %rdi
callq 0x331e8
testb %al, %al
je 0x17e96
callq 0x3018a
movq %rax, %rdi
callq 0x30a30
movq 0x8(%rbx), %rsi
cmpl $0x1d, 0x1c(%rsi)
je 0x17ea1
callq 0x1d7c4
movq %rax, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1da72
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
movq 0x8(%rbx), %rdi
movb $0x1, 0x3385(%rdi)
callq 0x334d0
callq 0x2ca2e
movq %rax, %rdi
callq 0x2cd0e
callq 0x3018a
movq 0x8(%rbx), %rcx
movq 0xc(%rcx), %rsi
movq %rax, %rdi
callq 0x30a62
jmp 0x17e22
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%rbx), %rdi
callq 0x17f12
movq 0x18(%rbx), %rdi
callq 0x17f46
movq 0x8(%rbx), %rdi
movb $0x1, 0x3385(%rdi)
callq 0x334d0
callq 0x2ca2e
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2cd0e
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.h
// Function: Parser::IsConnectServerOk()
bool IsConnectServerOk() {
    bool ret;
    mOkMutex.Lock();
    ret = mConnectServerOk;
    mOkMutex.UnLock();
    return ret;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x4206e
movb 0x4c(%rbx), %bl
movq %r14, %rdi
callq 0x4208a
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Coach.cpp
// Function: Coach::Run()
void Coach::Run() {
  mpObserver->Lock();

  /** 下面几个更新顺序不能变 */
  Formation::instance.SetTeammateFormations();
  mpAgent->CheckCommands(mpObserver); // 检查上周期发送命令情况
  mpWorldModel->Update(mpObserver);

  mpObserver->UnLock();

  // do planning...

  if (ServerParam::instance().synchMode()) {
    mpAgent->Done();
  }

  Logger::instance().LogSight();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x3548, %r14d          # imm = 0x3548
movq 0x8(%rdi), %rdi
addq %r14, %rdi
callq 0x4206e
leaq 0x65d27(%rip), %rdi     # 0x7e070
callq 0x214fa
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdi
callq 0x17f12
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
callq 0x4c538
addq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x4208a
callq 0x3db2c
cmpb $0x1, 0x32c9(%rax)
jne 0x1838b
movq 0x18(%rbx), %rdi
callq 0x183f0
callq 0x2ca2e
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2cdf0
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Parser.h
// Function: Parser::IsEyeOnOk()
bool IsEyeOnOk() {
    bool ret;
    mOkMutex.Lock();
    ret = mEyeOnOk;
    mOkMutex.UnLock();
    return ret;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x4206e
movb 0x4f(%rbx), %bl
movq %r14, %rdi
callq 0x4208a
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommandSender.cpp
// Function: CommandSender::StartRoutine()
void CommandSender::StartRoutine() {
  static char msg[MAX_MESSAGE];

  while (mpObserver->WaitForCommandSend()) {
    NetworkTest::instance().AddCommandSendBegin();

    strcpy(msg, "record_cmd: ");
    Run(msg);
    DynamicDebug::instance().AddMessage(msg, MT_Send);

    NetworkTest::instance().AddCommandSendEnd(mpObserver->CurrentTime());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movabsq $0x203a646d635f64, %r12 # imm = 0x203A646D635F64
movabsq $0x635f64726f636572, %r13 # imm = 0x635F64726F636572
leaq 0x62ec8(%rip), %r14     # 0x7bb10
pushq $0x3
popq %r15
movq 0x10(%rbx), %rdi
callq 0x33410
testb %al, %al
je 0x18ca9
callq 0x3018a
movq %rax, %rdi
callq 0x30ade
movq %r12, 0x62ea8(%rip)     # 0x7bb15
movq %r13, 0x62e9c(%rip)     # 0x7bb10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18cb8
callq 0x1d7c4
movq %rax, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1da72
callq 0x3018a
movq 0x10(%rbx), %rcx
movq 0xc(%rcx), %rsi
movq %rax, %rdi
callq 0x30b10
jmp 0x18c4c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommandSender.cpp
// Function: CommandSender::Run(char*)
void CommandSender::Run(char *msg) {
  if (mpAgent != 0) {
    mpAgent->SendCommands(msg);
  } else {
    PRINT_ERROR("null agent");
  }
}

// Assembly:
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x18cc6
jmp 0x18d1e
pushq %rbp
movq %rsp, %rbp
movq 0x5e31f(%rip), %rdi     # 0x76ff0
leaq 0x3f3d7(%rip), %rsi     # 0x580af
callq 0x94b0
leaq 0x4248e(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x3e
popq %rsi
movq %rax, %rdi
callq 0x9890
leaq 0x40721(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3f3bb(%rip), %rsi     # 0x580c8
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
popq %rbp
jmp 0x99e8
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::BitCountOfEps(double, CommunicateSystem::CodecType)
int CommunicateSystem::BitCountOfEps(double eps, CodecType type) {
  double min = 0.0, max = 1.0;
  GetCodecRange(type, min, max);

  double range = (max - min) / eps;
  return static_cast<int>(ceil(log(range) / log(2.0)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq -0x28(%rbp), %rbx
andq $0x0, (%rbx)
movsd %xmm0, -0x18(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq -0x20(%rbp), %r14
movq %rax, (%r14)
movq %rbx, %rdx
movq %r14, %rcx
callq 0x19006
movsd (%r14), %xmm0
subsd (%rbx), %xmm0
divsd -0x18(%rbp), %xmm0
callq 0x93f0
divsd 0x3f181(%rip), %xmm0    # 0x580f0
callq 0x90f0
cvttsd2si %xmm0, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::GetCodecRange(CommunicateSystem::CodecType, double&, double&)
void CommunicateSystem::GetCodecRange(CodecType type, double &min,
                                      double &max) {
  switch (type) {
  case POS_X:
    min = -ServerParam::instance().PITCH_LENGTH * 0.5;
    max = ServerParam::instance().PITCH_LENGTH * 0.5;
    break;
  case POS_Y:
    min = -ServerParam::instance().PITCH_WIDTH * 0.5;
    max = ServerParam::instance().PITCH_WIDTH * 0.5;
    break;
  case BALL_SPEED:
    min = 0.0;
    max = ServerParam::instance().ballSpeedMax();
    break;
  case PLAYER_SPEED:
    min = 0.0;
    max = ServerParam::instance().playerSpeedMax();
    break;
  case DIR:
    min = -180.0;
    max = 180.0;
    break;
  default:
    PRINT_ERROR("unknown codec type");
    break;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
cmpl $0x4, %esi
ja 0x190c7
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %eax
leaq 0x3f0df(%rip), %rcx     # 0x58108
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x3db2c
leaq 0x40e8a(%rip), %rax     # 0x59ec8
jmp 0x1908e
movabsq $-0x3f99800000000000, %rax # imm = 0xC066800000000000
movq %rax, (%r14)
movabsq $0x4066800000000000, %rax # imm = 0x4066800000000000
movq %rax, (%rbx)
jmp 0x190be
andq $0x0, (%r14)
callq 0x3db2c
movsd 0x30f8(%rax), %xmm0
jmp 0x190ba
andq $0x0, (%r14)
callq 0x3db2c
movsd 0x3038(%rax), %xmm0
jmp 0x190ba
callq 0x3db2c
leaq 0x40e42(%rip), %rax     # 0x59ed0
movsd (%rax), %xmm1
movsd %xmm1, -0x18(%rbp)
movsd 0x3dfc1(%rip), %xmm0    # 0x57060
mulsd %xmm1, %xmm0
movsd %xmm0, (%r14)
callq 0x3db2c
movsd -0x18(%rbp), %xmm0
mulsd 0x3e78e(%rip), %xmm0    # 0x57848
movsd %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x5df22(%rip), %rdi     # 0x76ff0
leaq 0x3f0c1(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x42091(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0xa0, %esi
callq 0x9890
leaq 0x40322(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3f0a7(%rip), %rsi     # 0x581b3
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x99e8
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::DoubleToBit(double, CommunicateSystem::CodecType)
CommunicateSystem::DWORD64
CommunicateSystem::DoubleToBit(double value,
                               CommunicateSystem::CodecType type) {
  int range = static_cast<int>((*mpCodecMask)[type]); // [0, range]

  double min = 0.0, max = 1.0;
  GetCodecRange(type, min, max);

  if (value > max) {
    value = max - 0.001 * max;
  } else if (value < min) {
    value = min + 0.001 * min;
  }

  return static_cast<DWORD64>(
      ((value - min) / (max - min) * static_cast<double>(range)));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq 0xc8(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %r14
leaq -0x18(%rbp), %rdx
andq $0x0, (%rdx)
movsd %xmm0, -0x20(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq -0x28(%rbp), %rbx
movq %rax, (%rbx)
movq %rbx, %rcx
callq 0x19006
movsd -0x20(%rbp), %xmm2
movsd (%rbx), %xmm0
ucomisd %xmm0, %xmm2
jbe 0x19188
movsd 0x3ef87(%rip), %xmm2    # 0x58100
mulsd %xmm0, %xmm2
addsd %xmm0, %xmm2
movsd -0x18(%rbp), %xmm1
jmp 0x191a3
movsd -0x18(%rbp), %xmm1
ucomisd %xmm2, %xmm1
jbe 0x191a3
movsd 0x3ef5d(%rip), %xmm2    # 0x580f8
mulsd %xmm1, %xmm2
addsd %xmm1, %xmm2
subsd %xmm1, %xmm2
subsd %xmm1, %xmm0
divsd %xmm0, %xmm2
cvtsi2sd %r14d, %xmm0
mulsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::BitToDouble(long, CommunicateSystem::CodecType)
double CommunicateSystem::BitToDouble(DWORD64 bits,
                                      CommunicateSystem::CodecType type) {
  int range = static_cast<int>((*mpCodecMask)[type]); // [0, range]
  DWORD64 mask = (*mpCodecMask)[type];

  double min = 0.0, max = 1.0;
  GetCodecRange(type, min, max);

  return static_cast<double>(bits & mask) / static_cast<double>(range) *
             (max - min) +
         min;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0xc8(%rdi), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %r12
leaq -0x30(%rbp), %rbx
andq $0x0, (%rbx)
movq %rsi, %r14
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
leaq -0x28(%rbp), %r15
movq %rax, (%r15)
movl %edx, %esi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x19006
andq %r12, %r14
cvtsi2sd %r14, %xmm1
cvtsi2sd %r12d, %xmm0
divsd %xmm0, %xmm1
movsd (%r15), %xmm0
movsd (%rbx), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::Encode(long, unsigned char*, bool)
void CommunicateSystem::Encode(DWORD64 bits, unsigned char *msg,
                               bool is_coach) {
  int i = 0, rem;

  while (bits != 0 || (is_coach && i < MAX_MSG_SIZE)) {
    rem = bits % CODE_SIZE;
    bits = (bits - rem) / CODE_SIZE;
    if (i >= MAX_MSG_SIZE) {
      PRINT_ERROR("codec msg size greater than " << MAX_MSG_SIZE);
      break;
    }
    msg[i++] = CODE[rem];
  }
  msg[i] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %rax
xorl %esi, %esi
pushq $0x49
popq %rdi
testq %rax, %rax
setne %dl
cmpq $0xa, %rsi
setb %r8b
andb %cl, %r8b
orb %dl, %r8b
cmpb $0x1, %r8b
jne 0x192ee
cmpq $0xa, %rsi
je 0x1928b
cqto
idivq %rdi
movq 0x5e289(%rip), %r8      # 0x77508
movb (%r8,%rdx), %dl
movb %dl, (%rbx,%rsi)
incq %rsi
jmp 0x1924f
movq 0x5dd5e(%rip), %rdi     # 0x76ff0
leaq 0x3eefd(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x41ecd(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0xcc, %esi
callq 0x9890
leaq 0x4015e(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3eef6(%rip), %rsi     # 0x581c6
movq %rax, %rdi
callq 0x94b0
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x9890
movq %rax, %rdi
callq 0x99e8
pushq $0xa
popq %rsi
movb $0x0, (%rbx,%rsi)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::Decode(unsigned char const*, long&, bool)
void CommunicateSystem::Decode(const unsigned char *msg, DWORD64 &bits,
                               bool is_coach) {
  int n = is_coach ? MAX_MSG_SIZE : strlen((const char *)msg);
  bits = 0;
  DWORD64 plus = 1;
  for (int i = 0; i < n; ++i) {
    bits += CODE_TO_INT[msg[i]] * plus;
    plus *= CODE_SIZE;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
testl %ecx, %ecx
je 0x19310
pushq $0xa
popq %rax
jmp 0x19318
movq %r14, %rdi
callq 0x9210
andq $0x0, (%rbx)
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
pushq $0x1
popq %rdx
leaq 0x647f3(%rip), %rsi     # 0x7db20
xorl %edi, %edi
cmpq %rcx, %rax
je 0x19350
movzbl (%r14,%rcx), %r8d
movslq (%rsi,%r8,4), %r8
imulq %rdx, %r8
addq %r8, %rdi
movq %rdi, (%rbx)
imulq $0x49, %rdx, %rdx
incq %rcx
jmp 0x1932f
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::PrintBits(long)
void CommunicateSystem::PrintBits(DWORD64 bits) {
  UDWORD64 mask = 1;
  mask <<= 63;

  while (mask != 0) {
    if (bits & mask)
      cerr << '1';
    else
      cerr << '0';
    mask >>= 1;
  }
  cerr << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
pushq $0x31
popq %r12
movq 0x5dc77(%rip), %r14     # 0x76ff0
testq %r15, %r15
je 0x1939b
movq %r15, %rax
andq %rbx, %rax
cmpq $0x1, %rax
movl %r12d, %esi
sbbl $0x0, %esi
movq %r14, %rdi
callq 0x9570
shrq %r15
jmp 0x19379
movq 0x5dc4e(%rip), %rdi     # 0x76ff0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x99e8
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::ParseReceivedTeammateMsg(unsigned char*)
void CommunicateSystem::ParseReceivedTeammateMsg(unsigned char *msg) {
  DWORD64 bits;
  // cerr << mpObserver->CurrentTime() << " (h) " << msg << endl;

  Decode(msg, bits);

  DWORD64 mask = 1;
  mask <<= (MAX_BITS_USED + mCommuFlagBitCount);
  mask -= 1;
  bits += ~mask; //高三位补1

  CommuType type = static_cast<CommuType>(bits & mCommuFlagMask);
  bits >>= mCommuFlagBitCount;

  if (type == FREE_FORM) {
    Logger::instance().GetTextLogger("receive") << "freeform" << endl;
    RecvFreeForm(bits);
  } else {
    Logger::instance().GetTextLogger("receive") << "???" << endl;
    PRINT_ERROR(msg);
    // TODO: 其他信息
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x30(%rbp), %r13
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x192fa
movl 0x40(%r14), %r12d
movl 0x5e0e4(%rip), %ecx     # 0x77510
addl %r12d, %ecx
pushq $-0x1
popq %r15
shlq %cl, %r15
addq (%r13), %r15
movl 0x48(%r14), %r13d
callq 0x2ca2e
leaq 0x3ee21(%rip), %rsi     # 0x5826b
movq %rax, %rdi
callq 0x2cc3e
testl %r15d, %r13d
je 0x194d4
leaq 0x3e8c4(%rip), %rsi     # 0x57d22
movq %rax, %rdi
callq 0x1a606
movq 0x5db43(%rip), %rsi     # 0x76fb0
movq %rax, %rdi
callq 0x10f5c
movq 0x5db74(%rip), %rdi     # 0x76ff0
leaq 0x3ed13(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x41ce3(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x258, %esi            # imm = 0x258
callq 0x9890
leaq 0x3ff74(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x94b0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x99e8
movl %r12d, %ecx
sarq %cl, %r15
leaq 0x3ed1a(%rip), %rsi     # 0x581fb
movq %rax, %rdi
callq 0x1a5d4
movq 0x5dac0(%rip), %rsi     # 0x76fb0
movq %rax, %rdi
callq 0x10f5c
movq %r14, %rdi
movq %r15, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x19fac
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::AddDataToCommuBits(double, CommunicateSystem::CodecType)
bool CommunicateSystem::AddDataToCommuBits(double value, CodecType type) {
  if (mBitsUsed + (*mpCodecBitCount)[type] > MAX_BITS_USED) {
    PRINT_ERROR("bits used greater then " << MAX_BITS_USED);
    return false;
  } else {
    mCommuBits <<= (*mpCodecBitCount)[type];
    mCommuBits += DoubleToBit(value, type);
    mBitsUsed += (*mpCodecBitCount)[type];

    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0xc0(%rdi), %rax
movl %esi, %r12d
movl (%rax,%r12,4), %ecx
movl 0x20(%rdi), %r14d
addl %ecx, %r14d
movl 0x5dfd7(%rip), %r15d    # 0x77510
cmpl %r15d, %r14d
jg 0x1955e
movq %rdi, %rbx
shlq %cl, 0x18(%rdi)
callq 0x19124
addq %rax, 0x18(%rbx)
movq 0xc0(%rbx), %rax
movl (%rax,%r12,4), %eax
addl %eax, 0x20(%rbx)
jmp 0x195c1
movq 0x5da8b(%rip), %rdi     # 0x76ff0
leaq 0x3ec2a(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x41bfa(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x107, %esi            # imm = 0x107
callq 0x9890
leaq 0x3fe8b(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3ec40(%rip), %rsi     # 0x581e3
movq %rax, %rdi
callq 0x94b0
movl 0x5df5f(%rip), %esi     # 0x77510
movq %rax, %rdi
callq 0x9890
movq %rax, %rdi
callq 0x99e8
cmpl %r15d, %r14d
setle %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::AddFreeFormFlagToCommuBits(CommunicateSystem::FreeFormType)
bool CommunicateSystem::AddFreeFormFlagToCommuBits(FreeFormType type) {
  if (mBitsUsed + mFreeFormFlagBitCount > MAX_BITS_USED) {
    PRINT_ERROR("bits used greater then " << MAX_BITS_USED);
    return false;
  } else {
    mCommuBits <<= mFreeFormFlagBitCount;
    mCommuBits += static_cast<DWORD64>(type);
    mBitsUsed += mFreeFormFlagBitCount;

    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x50(%rdi), %ecx
movl 0x20(%rdi), %ebx
addl %ecx, %ebx
movl 0x5df2a(%rip), %r14d    # 0x77510
cmpl %r14d, %ebx
jg 0x19600
movq 0x18(%rdi), %rax
shlq %cl, %rax
movl %esi, %ecx
addq %rax, %rcx
movq %rcx, 0x18(%rdi)
movl %ebx, 0x20(%rdi)
jmp 0x19663
movq 0x5d9e9(%rip), %rdi     # 0x76ff0
leaq 0x3eb88(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x41b58(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x114, %esi            # imm = 0x114
callq 0x9890
leaq 0x3fde9(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3eb9e(%rip), %rsi     # 0x581e3
movq %rax, %rdi
callq 0x94b0
movl 0x5debd(%rip), %esi     # 0x77510
movq %rax, %rdi
callq 0x9890
movq %rax, %rdi
callq 0x99e8
cmpl %r14d, %ebx
setle %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::AddUnumToCommuBits(int)
bool CommunicateSystem::AddUnumToCommuBits(Unum num) {
  if (mBitsUsed + mUnumBitCount > MAX_BITS_USED) {
    PRINT_ERROR("bits used greater then " << MAX_BITS_USED);
    return false;
  } else {
    mCommuBits <<= mUnumBitCount;
    mCommuBits += static_cast<DWORD64>(num);
    mBitsUsed += mUnumBitCount;

    return true;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x70(%rdi), %ecx
movl 0x20(%rdi), %ebx
addl %ecx, %ebx
movl 0x5de6e(%rip), %r14d    # 0x77510
cmpl %r14d, %ebx
jg 0x196bd
movq 0x18(%rdi), %rax
shlq %cl, %rax
movslq %esi, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rdi)
movl %ebx, 0x20(%rdi)
jmp 0x19720
movq 0x5d92c(%rip), %rdi     # 0x76ff0
leaq 0x3eacb(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x41a9b(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x129, %esi            # imm = 0x129
callq 0x9890
leaq 0x3fd2c(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3eae1(%rip), %rsi     # 0x581e3
movq %rax, %rdi
callq 0x94b0
movl 0x5de00(%rip), %esi     # 0x77510
movq %rax, %rdi
callq 0x9890
movq %rax, %rdi
callq 0x99e8
cmpl %r14d, %ebx
setle %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::Decision()
void CommunicateSystem::Decision() {
  DoCommunication();

  if (mBitsUsed != 0) {
    unsigned char msg[11]; // MAX_MSG_SIZE == 10

    AddCommuFlagToCommuBits(mCommuType);

    DWORD64 mask = 1;
    mask <<= mBitsUsed;
    mask -= 1;
    mCommuBits += ~mask; //左边补1
    mask = 1;
    mask <<= (MAX_BITS_USED + mCommuFlagBitCount);
    mask -= 1;
    mCommuBits &= mask; //去掉高三位

    Encode(mCommuBits, msg);

    if (strlen((const char *)msg) > 0) {
      mpAgent->Say(string((const char *)msg));
    } else {
      PRINT_ERROR("bug here?");
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0x19e26
movl 0x20(%rbx), %eax
testl %eax, %eax
je 0x19e08
movl 0x40(%rbx), %edx
movq 0x18(%rbx), %rdi
movl %edx, %ecx
shlq %cl, %rdi
movl 0x3c(%rbx), %r8d
addl %edx, %eax
pushq $-0x1
popq %rsi
movq %rsi, %r9
movl %eax, %ecx
shlq %cl, %r9
addq %r8, %rdi
movl %eax, 0x20(%rbx)
addl 0x5d7b1(%rip), %edx     # 0x77510
movl %edx, %ecx
shlq %cl, %rsi
addq %rdi, %r9
notq %rsi
andq %r9, %rsi
movq %rsi, 0x18(%rbx)
leaq -0x1c(%rbp), %r14
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x1923e
cmpb $0x0, (%r14)
je 0x19db3
movq 0x10(%rbx), %rbx
leaq -0x40(%rbp), %r14
leaq -0x1c(%rbp), %rsi
leaq -0x11(%rbp), %rdx
movq %r14, %rdi
callq 0x10e4a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a576
leaq -0x40(%rbp), %rdi
callq 0x9240
jmp 0x19e08
movq 0x5d236(%rip), %rdi     # 0x76ff0
leaq 0x3e3d5(%rip), %rsi     # 0x58196
callq 0x94b0
leaq 0x413a5(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl $0x1eb, %esi            # imm = 0x1EB
callq 0x9890
leaq 0x3f636(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3e430(%rip), %rsi     # 0x58228
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x9240
movq %rbx, %rdi
callq 0x98b0
nop