LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/CommunicateSystem.cpp
// Function: CommunicateSystem::DoCommunication()
void CommunicateSystem::DoCommunication() {
  if (!mpAgent)
    return;

  PositionInfo &position_info = mpAgent->GetInfoState().GetPositionInfo();
  const Unum closest_tm = position_info.GetClosestTeammateToBall();

  if (closest_tm == mpAgent->GetSelfUnum()) {
    mpAgent->AttentiontoOff();
  } else if (closest_tm) {
    if (closest_tm != mpAgent->GetSelf().GetFocusOnUnum()) {
      mpAgent->Attentionto(closest_tm);
    }
  }

  SendBallStatus(mpAgent->GetWorldState().GetBall());
  SendTeammateStatus(&mpAgent->GetWorldState(), mpAgent->GetSelfUnum());

  const vector<Unum> &o2b =
      mpAgent->GetInfoState().GetPositionInfo().GetCloseOpponentToTeammate(
          mpAgent->GetSelfUnum());
  const vector<Unum> &t2b =
      mpAgent->GetInfoState().GetPositionInfo().GetCloseTeammateToTeammate(
          mpAgent->GetSelfUnum());

  for (uint i = 0; i < TEAMSIZE; ++i) {
    if (i < o2b.size()) {
      SendOpponentStatus(&mpAgent->GetWorldState(), o2b[i]);
    }
    if (i < t2b.size()) {
      SendTeammateStatus(&mpAgent->GetWorldState(), t2b[i]);
    }
  }
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x19f54
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rax), %rdi
callq 0x244e8
movq %rax, %rdi
callq 0x114f0
movq 0x10(%rbx), %rdi
cmpl 0x8(%rdi), %eax
jne 0x19e62
callq 0x1a638
jmp 0x19e83
movl %eax, %r14d
testl %eax, %eax
je 0x19e83
callq 0xcd42
cmpl 0xfc(%rax), %r14d
je 0x19e83
movq 0x10(%rbx), %rdi
movl %r14d, %esi
callq 0x1a64a
movq 0x10(%rbx), %rax
movq 0x18(%rax), %rsi
addq $0x30, %rsi
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1972c
movq 0x10(%rbx), %rax
movq 0x18(%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x199e2
movq 0x10(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x244e8
movq 0x10(%rbx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x3c402
movq %rax, %r14
movq 0x10(%rbx), %rax
movq 0x20(%rax), %rdi
callq 0x244e8
movq 0x10(%rbx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x3c39e
movq %rax, %r15
cmpq $0xb, %r12
je 0x19f4c
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x19f1e
movq 0x10(%rbx), %rcx
movq 0x18(%rcx), %rsi
movl (%rax,%r12,4), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x19b7a
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x19f47
movq 0x10(%rbx), %rcx
movq 0x18(%rcx), %rsi
movl (%rax,%r12,4), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x199e2
incq %r12
jmp 0x19eef
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.cpp
// Function: Dasher::Dasher()
Dasher::Dasher() {
  Assert(std::fabs(ServerParam::instance().dashAngleStep() - 45.0) < FLOAT_EPS);

  for (int i = 0; i < 8; ++i) {
    DASH_DIR[i] =
        GetNormalizeAngleDeg(ServerParam::instance().dashAngleStep() * i);
    DIR_RATE[i] = GetDashDirRate(DASH_DIR[i]);
  }

  for (int i = 0; i < 8; ++i) {
    ANTI_DIR_IDX[i] = GetDashDirIdx(DASH_DIR[i] + 180.0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r15d, %r15d
leaq -0x30(%rbp), %rbx
leaq 0x63740(%rip), %r14     # 0x7de18
leaq 0x63799(%rip), %r13     # 0x7de78
xorl %r12d, %r12d
cmpq $0x8, %r12
je 0x1a72a
callq 0x3db2c
cvtsi2sd %r12d, %xmm0
mulsd 0x33a8(%rax), %xmm0
movabsq $-0x3f99800000000000, %rax # imm = 0xC066800000000000
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0xd305
movsd %xmm0, (%r15,%r14)
callq 0xd187
movsd %xmm0, (%r15,%r13)
incq %r12
addq $0x8, %r15
jmp 0x1a6e2
xorl %r15d, %r15d
leaq -0x30(%rbp), %rbx
leaq 0x63720(%rip), %r12     # 0x7de58
cmpq $0x20, %r15
je 0x1a766
movsd (%r14), %xmm0
addsd 0x3c91d(%rip), %xmm0    # 0x57068
movsd %xmm0, -0x30(%rbp)
movq %rbx, %rdi
callq 0x1cb50
movl %eax, (%r15,%r12)
addq $0x4, %r15
addq $0x8, %r14
jmp 0x1a738
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.cpp
// Function: Dasher::GoToPoint(Agent&, Vector, double, double, bool, bool)
bool Dasher::GoToPoint(Agent &agent, Vector pos, double buffer, double power,
                       bool can_inverse, bool turn_first) {
  AtomicAction act;

  GoToPoint(agent, act, agent.GetStrategy().AdjustTargetForSetplay(pos), buffer,
            power, can_inverse, turn_first);
  return act.Execute(agent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %ebx
movl %edx, %r15d
movsd %xmm3, -0x48(%rbp)
movsd %xmm2, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r13
leaq -0x78(%rbp), %r12
movb $0x0, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r12)
movups %xmm0, 0x14(%r12)
movups %xmm0, 0x20(%r12)
movq %rsi, %rdi
callq 0xdd50
movq %rax, %rdi
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
callq 0x40a88
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm3
movl %r15d, %ecx
movl %ebx, %r8d
callq 0x1a7d4
movq %r12, %rdi
movq %r14, %rsi
callq 0xa74c
addq $0x58, %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/Dasher.cpp
// Function: Dasher::GetTurnBodyToAngleAction(Agent const&, double)
AtomicAction Dasher::GetTurnBodyToAngleAction(const Agent &agent,
                                              AngleDeg ang) {
  AtomicAction action;
  action.mType = CT_Turn;

  double angle_turn = GetNormalizeAngleDeg(ang - agent.GetSelf().GetBodyDir());
  if (fabs(angle_turn) < agent.GetSelf().GetMaxTurnAngle()) {
    action.mSucceed = true;
    action.mTurnAngle = angle_turn;
  } else {
    action.mSucceed = false;
    action.mTurnAngle = Sign(angle_turn) * agent.GetSelf().GetMaxTurnAngle();
  }
  return action;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movsd %xmm0, -0x20(%rbp)
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x8(%rdi)
andq $0x0, 0x28(%rdi)
movl $0x1, 0x4(%rdi)
movq %rdx, %rdi
callq 0xcd42
movsd -0x20(%rbp), %xmm0
subsd 0xb0(%rax), %xmm0
movabsq $-0x3f99800000000000, %rax # imm = 0xC066800000000000
leaq -0x38(%rbp), %rdi
movq %rax, (%rdi)
callq 0xd305
movapd 0x3b04c(%rip), %xmm1    # 0x57010
movapd %xmm0, -0x20(%rbp)
andpd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
movq %r14, %rdi
callq 0xcd42
movsd 0x158(%rax), %xmm0
ucomisd -0x30(%rbp), %xmm0
jbe 0x1bff3
movb $0x1, (%rbx)
movapd -0x20(%rbp), %xmm2
jmp 0x1c028
movb $0x0, (%rbx)
movq %r14, %rdi
callq 0xcd42
movsd 0x158(%rax), %xmm0
movapd 0x3b012(%rip), %xmm1    # 0x57020
xorpd %xmm0, %xmm1
xorpd %xmm2, %xmm2
cmplesd -0x20(%rbp), %xmm2
andpd %xmm2, %xmm0
andnpd %xmm1, %xmm2
orpd %xmm0, %xmm2
movsd %xmm2, 0x18(%rbx)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.cpp
// Function: Dasher::GetBall(Agent&, int, bool, bool)
bool Dasher::GetBall(Agent &agent, int int_cycle, bool can_inverse,
                     bool turn_first) {
  AtomicAction act;
  GetBall(agent, act, int_cycle, can_inverse, turn_first);
  if (act.mSucceed) {
    return act.Execute(agent);
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %r8d, %r9d
movl %ecx, %r8d
movl %edx, %ecx
movq %rsi, %rbx
leaq -0x40(%rbp), %r14
movb $0x0, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r14)
movups %xmm0, 0x14(%r14)
movups %xmm0, 0x20(%r14)
movq %r14, %rdx
callq 0x1c19e
cmpb $0x1, (%r14)
jne 0x1c3cc
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xa74c
jmp 0x1c3ce
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.cpp
// Function: Dasher::CorrectTurnForDash(PlayerState const&, Vector const&, double)
Vector Dasher::CorrectTurnForDash(const PlayerState &player,
                                  const Vector &target, double fix) {
  if (player.GetPosConf() > 0.99 - FLOAT_EPS &&
      player.GetBodyDirConf() > 0.99 - FLOAT_EPS) {
    Ray body_ray(player.GetPos(), player.GetBodyDir());
    Line body_line(body_ray);
    Vector closest_pt = body_line.GetProjectPoint(target);

    double buffer = 0.05 + ServerParam::instance().ballSize();
    if (closest_pt.Dist(player.GetPos()) >
        player.GetKickableArea() + buffer - fix) {
      if (closest_pt.Dist(target) < player.GetKickableArea() - buffer + fix) {
        return closest_pt;
      }
    }
  }
  return target;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movsd 0x20(%rsi), %xmm1
ucomisd 0x3bedb(%rip), %xmm1    # 0x582d0
jbe 0x1c511
movq %rsi, %r14
movsd 0xc0(%rsi), %xmm1
ucomisd 0x3bec2(%rip), %xmm1    # 0x582d0
jbe 0x1c511
movups 0x8(%r14), %xmm1
leaq -0x60(%rbp), %rsi
movaps %xmm1, (%rsi)
movsd 0xb0(%r14), %xmm1
movsd %xmm1, 0x10(%rsi)
leaq -0x78(%rbp), %r15
movq %r15, %rdi
movsd %xmm0, -0x40(%rbp)
callq 0x1cc46
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ccb4
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x28(%rbp)
callq 0x3db2c
movsd 0x30d8(%rax), %xmm0
addsd 0x3be2f(%rip), %xmm0    # 0x58298
movsd %xmm0, -0x38(%rbp)
movsd -0x30(%rbp), %xmm0
subsd 0x8(%r14), %xmm0
movsd -0x28(%rbp), %xmm1
subsd 0x10(%r14), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movsd -0x40(%rbp), %xmm1
movsd (%rax), %xmm0
addsd -0x38(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd -0x20(%rbp), %xmm2
ucomisd %xmm0, %xmm2
jbe 0x1c511
movsd -0x30(%rbp), %xmm0
subsd (%rbx), %xmm0
movsd -0x28(%rbp), %xmm1
subsd 0x8(%rbx), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movsd (%rax), %xmm0
subsd -0x38(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0x1c511
movsd -0x30(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
jmp 0x1c51a
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Dasher.h
// Function: Dasher::GetDashDirIdx(double const&)
static int GetDashDirIdx(const AngleDeg &dir) {
    for (int i = 0; i < 8; ++i) {
      if (GetAngleDegDiffer(dir, DASH_DIR[i]) < FLOAT_EPS)
        return i;
    }
    Assert(0);
    return -1;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
leaq 0x612b3(%rip), %r15     # 0x7de18
xorl %r12d, %r12d
pushq $-0x1
popq %rbx
cmpq $0x8, %r12
je 0x1cb96
movq %r14, %rdi
movq %r15, %rsi
callq 0x124e1
movsd 0x3a4bc(%rip), %xmm1    # 0x57040
ucomisd %xmm0, %xmm1
ja 0x1cb93
incq %r12
addq $0x8, %r15
jmp 0x1cb6b
movl %r12d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DecisionTree.cpp
// Function: DecisionTree::Decision(Agent&)
bool DecisionTree::Decision(Agent &agent) {
  Assert(agent.GetSelf().IsAlive());

  ActiveBehavior beh = Search(agent, 1);

  if (beh.GetType() != BT_None) {
    agent.SetActiveBehaviorInAct(beh.GetType());
    Assert(&beh.GetAgent() == &agent);
    return beh.Execute();
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0xb8(%rbp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1cecc
movl (%r14), %esi
testl %esi, %esi
je 0x1cebe
movq %rbx, %rdi
callq 0xdc44
leaq -0xb8(%rbp), %rdi
callq 0x10a40
jmp 0x1cec0
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DecisionTree.cpp
// Function: DecisionTree::Search(Agent&, int)
ActiveBehavior DecisionTree::Search(Agent &agent, int step) {
  if (step == 1) {
    if (agent.GetSelf().IsIdling()) {
      return ActiveBehavior(agent, BT_None);
    }

    std::list<ActiveBehavior> active_behavior_list;

    if (agent.GetSelf().IsGoalie()) {
      MutexPlan<BehaviorPenaltyPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorSetplayPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorAttackPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorGoaliePlanner>(agent, active_behavior_list);
    } else {
      MutexPlan<BehaviorPenaltyPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorSetplayPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorAttackPlanner>(agent, active_behavior_list) ||
          MutexPlan<BehaviorDefensePlanner>(agent, active_behavior_list);
    }

    if (!active_behavior_list.empty()) {
      return GetBestActiveBehavior(agent, active_behavior_list);
    } else {
      return ActiveBehavior(agent, BT_None);
    }
  } else {
    return ActiveBehavior(agent, BT_None);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x1, %ecx
jne 0x1cf79
movq %rsi, %r15
movq %r14, %rdi
callq 0xcd42
cmpl $0x0, 0xc8(%rax)
jg 0x1cf79
cmpl $0x0, 0x124(%rax)
jg 0x1cf79
leaq -0x38(%rbp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
andq $0x0, 0x10(%r12)
movq %r14, %rdi
callq 0xcd42
cmpb $0x1, 0x175(%rax)
jne 0x1cf8a
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d0c6
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d118
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d16a
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d1bc
jmp 0x1cfd2
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1d062
jmp 0x1d001
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d0c6
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d118
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d16a
testb %al, %al
jne 0x1cfd2
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1d20e
cmpq %r12, -0x38(%rbp)
je 0x1cfe9
leaq -0x38(%rbp), %rcx
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1d026
jmp 0x1cff8
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1d062
leaq -0x38(%rbp), %rdi
callq 0x10570
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x10570
movq %rbx, %rdi
callq 0x98b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DecisionTree.cpp
// Function: DecisionTree::GetBestActiveBehavior(Agent&, std::__cxx11::list<ActiveBehavior, std::allocator<ActiveBehavior>>&)
ActiveBehavior
DecisionTree::GetBestActiveBehavior(Agent &agent,
                                    std::list<ActiveBehavior> &behavior_list) {
  agent.SaveActiveBehaviorList(
      behavior_list); // behavior_list里面存储了本周期所有behavior决策出的最优activebehavior，这里统一保存一下，供特定behavior下周期plan时用

  behavior_list.sort(std::greater<ActiveBehavior>());

  return behavior_list.front();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movq %rdi, %r14
movq %rdx, %rdi
movq %rcx, %rsi
callq 0xdc56
movq %rbx, %rdi
callq 0x10370
movq (%rbx), %rsi
addq $0x10, %rsi
movl $0xa8, %edx
movq %r14, %rdi
callq 0x9400
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::DynamicDebug()
DynamicDebug::DynamicDebug() {
  mpObserver = 0;
  mInitialOK = false;

  mpIndex = 0;
  mpParserTime = 0;
  mpDecisionTime = 0;
  mpCommandSendTime = 0;
  mpCurrentIndex = 0;

  mpFile = 0;
  mpFileStream = 0;
  mpStreamBuffer = std::cin.rdbuf(); // 保存std::cin的流，后面要重定向

  mRunning = false;
  mShowMessage = false;
  mRuntoCycle = Time(-3, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xfffffff6, %eax       # imm = 0xFFFFFFF6
movq %rax, 0x10(%rdi)
leaq 0x58(%rdi), %r14
addq $0xf8, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movups %xmm0, 0xb8(%rbx)
andq $0x0, 0xc8(%rbx)
callq 0x42058
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
movq %rax, 0x13c(%rbx)
andq $0x0, (%rbx)
movb $0x0, 0x8(%rbx)
andq $0x0, 0xf0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%rbx)
movups %xmm0, 0xe0(%rbx)
movups %xmm0, 0x120(%rbx)
movq 0x59ce0(%rip), %rcx     # 0x76fd8
movq (%rcx), %rdx
movq -0x18(%rdx), %rdx
movq 0xe8(%rcx,%rdx), %rcx
movq %rcx, 0x130(%rbx)
andw $0x0, 0x138(%rbx)
movq %rax, 0x13c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq 0xb8(%rbx), %rdi
leaq 0xa0(%rbx), %r12
leaq 0x88(%rbx), %r13
addq $0x70, %rbx
callq 0x1e6fe
movq %r12, %rdi
callq 0x1e9b6
movq %r13, %rdi
callq 0x1e9b6
movq %rbx, %rdi
callq 0x1e9b6
movq %r14, %rdi
callq 0x1e978
movq %r15, %rdi
callq 0x98b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::~DynamicDebug()
DynamicDebug::~DynamicDebug() {
  Flush();

  if (mpIndex != 0) {
    delete[] mpIndex;
  }

  if (mpParserTime != 0) {
    delete[] mpParserTime;
  }

  if (mpDecisionTime != 0) {
    delete[] mpDecisionTime;
  }

  if (mpCommandSendTime != 0) {
    delete[] mpCommandSendTime;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x1d41c
movq 0xd0(%rbx), %rdi
testq %rdi, %rdi
je 0x1d395
callq 0x9630
movq 0xd8(%rbx), %rdi
testq %rdi, %rdi
je 0x1d3a6
callq 0x9630
movq 0xe0(%rbx), %rdi
testq %rdi, %rdi
je 0x1d3b7
callq 0x9630
movq 0xe8(%rbx), %rdi
testq %rdi, %rdi
je 0x1d3c8
callq 0x9630
leaq 0xf8(%rbx), %rdi
callq 0x42064
leaq 0xb8(%rbx), %rdi
callq 0x1e6fe
leaq 0xa0(%rbx), %rdi
callq 0x1e9b6
leaq 0x88(%rbx), %rdi
callq 0x1e9b6
leaq 0x70(%rbx), %rdi
callq 0x1e9b6
addq $0x58, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1e978
movq %rax, %rdi
callq 0x10599
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::AddMessage(char const*, MessageType)
void DynamicDebug::AddMessage(const char *msg, MessageType msg_type) {
  if (PlayerParam::instance().SaveServerMessage() &&
      !PlayerParam::instance().DynamicDebugMode()) {
    if (!mInitialOK) {
      return; // 没有初始化或者不用记录server信息都返回
    }

    mFileMutex.Lock(); // 有可能多个线程同时在写文件，所以要保证互斥

    MessageIndexTableUnit index_table_unit;
    index_table_unit.mServerTime = mpObserver->CurrentTime();
    index_table_unit.mDataSize = strlen(msg);

    switch (msg_type) {
    case MT_Parse:
      index_table_unit.mTimeOffset = mParserTimeTable.size();
      break;
    case MT_Run:
      index_table_unit.mTimeOffset = mDecisionTimeTable.size();
      break;
    case MT_Send:
      index_table_unit.mTimeOffset = mCommandSendTimeTable.size();
      break;
    default:
      break;
    }

    mMessageTable.push_back(Message(msg_type, msg));
    mIndexTable.push_back(index_table_unit);
    mFileHead.mMaxCycle =
        Max(mFileHead.mMaxCycle, index_table_unit.mServerTime);

    mFileMutex.UnLock();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
callq 0x38d94
cmpb $0x1, 0x5c42(%rax)
jne 0x1db5c
callq 0x38d94
cmpb $0x0, 0x5c40(%rax)
jne 0x1db5c
cmpb $0x1, 0x8(%rbx)
jne 0x1db5c
leaq 0xf8(%rbx), %rdi
movq %rdi, -0x30(%rbp)
callq 0x4206e
movq (%rbx), %rax
movq 0xc(%rax), %rax
movq %rax, -0x50(%rbp)
movq %r15, %rdi
callq 0x9210
movq %rax, -0x48(%rbp)
leal -0x1(%r12), %eax
cmpl $0x2, %eax
ja 0x1db03
movl %eax, %eax
imulq $0x18, %rax, %rax
movq 0x78(%rbx,%rax), %rcx
subq 0x70(%rbx,%rax), %rcx
sarq $0x4, %rcx
movq %rcx, -0x38(%rbp)
leaq 0xb8(%rbx), %r13
leaq -0x78(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x1e894
movq %r13, %rdi
movq %r14, %rsi
callq 0x1eb74
leaq -0x70(%rbp), %rdi
callq 0x9240
leaq 0x58(%rbx), %rdi
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x1e8b8
leaq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x1edf4
movq (%rax), %rax
movq %rax, 0x10(%rbx)
movq -0x30(%rbp), %rdi
callq 0x4208a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x9240
movq %rbx, %rdi
callq 0x98b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::GetMessage(char*)
MessageType DynamicDebug::GetMessage(char *msg) {
  if (mpCurrentIndex == 0) {
    return MT_Null;
  }

  if (mpCurrentIndex->mServerTime >= mFileHead.mMaxCycle) {
    std::cerr << "End ..." << std::endl;
    return MT_Null;
  } else {
    ++mpCurrentIndex;
  }

  fseek(mpFile, mpCurrentIndex->mDataOffset, SEEK_SET);
  if (fread(msg, 1, 1, mpFile) < 1) // 读取信息类型
  {
    Assert(0);
  }
  MessageType msg_type = (MessageType)msg[0];

  if (mpCurrentIndex->mDataSize > 0 &&
      fread(msg, mpCurrentIndex->mDataSize, 1, mpFile) < 1) // 读取信息内容
  {
    Assert(0);
  }
  msg[mpCurrentIndex->mDataSize] = '\0';

  if (mShowMessage == true) {
    std::cerr << msg << std::endl;
  }

  return msg_type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0xf0(%rdi), %rdi
testq %rdi, %rdi
je 0x1e544
movq %rsi, %rbx
leaq 0x10(%r14), %rsi
callq 0x1e908
testb %al, %al
je 0x1e54c
xorl %r15d, %r15d
leaq 0x39faf(%rip), %rbx     # 0x584ee
jmp 0x1e5c4
xorl %r15d, %r15d
jmp 0x1e5db
movq 0xf0(%r14), %rax
movq 0x120(%r14), %rdi
leaq 0x20(%rax), %rcx
movq %rcx, 0xf0(%r14)
movq 0x30(%rax), %rsi
xorl %edx, %edx
callq 0x9530
movq 0x120(%r14), %rcx
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x9740
movsbl (%rbx), %r15d
movq 0xf0(%r14), %rax
movq 0x8(%rax), %rsi
testq %rsi, %rsi
jle 0x1e5b6
movq 0x120(%r14), %rcx
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x9740
movq 0xf0(%r14), %rax
movq 0x8(%rax), %rsi
movb $0x0, (%rbx,%rsi)
cmpb $0x1, 0x139(%r14)
jne 0x1e5db
movq 0x58a25(%rip), %rdi     # 0x76ff0
movq %rbx, %rsi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::FindCycle(int)
bool DynamicDebug::FindCycle(int cycle) {
  Time cycle_time(cycle, 0);
  if (cycle_time == mpObserver->CurrentTime()) {
    return true;
  }

  int begin = 0;
  int end = mFileHead.mIndexTableSize - 1;
  int mid;
  while (begin < end) {
    mid = (begin + end) / 2;
    if (mpIndex[mid].mServerTime == cycle_time) {
      mpCurrentIndex = &mpIndex[mid];
      return true;
    } else if (mpIndex[mid].mServerTime < cycle_time) {
      begin = mid;
    } else {
      end = mid;
    }
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %rcx
cmpl $0x0, 0x10(%rcx)
movb $0x1, %al
jne 0x1e601
cmpl %esi, 0xc(%rcx)
je 0x1e66e
movl 0x18(%rdi), %r8d
decl %r8d
movq 0xd0(%rdi), %rcx
xorl %edx, %edx
cmpl %r8d, %edx
jge 0x1e660
leal (%r8,%rdx), %r9d
shrl %r9d
movq %r9, %r11
shlq $0x5, %r11
movl (%rcx,%r11), %r10d
movl 0x4(%rcx,%r11), %ebx
movl %r10d, %r14d
xorl %esi, %r14d
orl %ebx, %r14d
je 0x1e664
testl %ebx, %ebx
movl %edx, %r11d
cmovsl %r9d, %r11d
movl %r9d, %ebx
cmovsl %r8d, %ebx
cmpl %esi, %r10d
cmovll %r9d, %edx
cmovll %r8d, %r9d
cmovel %r11d, %edx
cmovel %ebx, %r9d
movl %r9d, %r8d
jmp 0x1e611
xorl %eax, %eax
jmp 0x1e66e
addq %r11, %rcx
movq %rcx, 0xf0(%rdi)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Evaluation.cpp
// Function: Evaluation::EvaluatePosition(Vector const&, bool)
double Evaluation::EvaluatePosition(const Vector &pos, bool ourside) {
  static double input[2];
  static double output[1];

  input[0] = pos.X() / (ServerParam::instance().PITCH_LENGTH * 0.5);
  input[1] =
      fabs(pos.Y()) / (ServerParam::instance().PITCH_WIDTH * 0.5) * 2.0 - 1.0;
  if (!ourside) {
    input[0] *= -1.0;
  }
  mSensitivityNet->Run(input, output);

  return output[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x3db2c
leaq 0x3ae45(%rip), %rax     # 0x59ec8
movsd (%rax), %xmm0
mulsd 0x387b9(%rip), %xmm0    # 0x57848
movsd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x5efb0(%rip)    # 0x7e050
movsd 0x8(%r15), %xmm0
andps 0x37f63(%rip), %xmm0    # 0x57010
movaps %xmm0, -0x30(%rbp)
callq 0x3db2c
leaq 0x3ae13(%rip), %rax     # 0x59ed0
movsd 0x38783(%rip), %xmm0    # 0x57848
mulsd (%rax), %xmm0
movapd -0x30(%rbp), %xmm1
divsd %xmm0, %xmm1
addsd %xmm1, %xmm1
addsd 0x37f92(%rip), %xmm1    # 0x57070
movsd %xmm1, 0x5ef72(%rip)    # 0x7e058
testl %r14d, %r14d
jne 0x1f103
movsd 0x5ef5d(%rip), %xmm0    # 0x7e050
xorpd 0x37f25(%rip), %xmm0    # 0x57020
movlpd %xmm0, 0x5ef4d(%rip)    # 0x7e050
movq (%rbx), %rdi
leaq 0x5ef43(%rip), %rsi     # 0x7e050
leaq 0x5ef4c(%rip), %rdx     # 0x7e060
callq 0x2ea0e
movsd 0x5ef3f(%rip), %xmm0    # 0x7e060
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: FormationBase::GetFormationCenter(WorldState const&, bool, double)
const Vector &FormationBase::GetFormationCenter(const WorldState &world_state,
                                                bool is_teammate,
                                                double min_conf) {
  double conf = 0.0;
  double total_conf = 0.0;
  Vector center = Vector(0.0, 0.0);

  for (int i = 1; i <= TEAMSIZE; ++i) {
    if (is_teammate) {
      if (mIndex2Unum[i] == world_state.GetTeammateGoalieUnum()) {
        continue;
      }
      conf = world_state.GetTeammate(i).GetPosConf();
      if (conf > min_conf) {
        center += (world_state.GetTeammate(i).GetPos() +
                   mOffsetMatrix[mUnum2Index[i]][0]) *
                  conf;
        total_conf += conf;
      }
    } else {
      if (mIndex2Unum[i] == world_state.GetOpponentGoalieUnum()) {
        continue;
      }
      conf = world_state.GetOpponent(i).GetPosConf();
      if (conf > min_conf) {
        center += (world_state.GetOpponent(i).GetPos() +
                   mOffsetMatrix[mUnum2Index[i]][0]) *
                  conf;
        total_conf += conf;
      }
    }
  }

  mFormationCT = center / total_conf;
  return mFormationCT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x2110(%rsi), %eax
movl 0x2114(%rsi), %ecx
leaq 0x10d0(%rsi), %rdi
leaq 0x380(%rbx), %r8
addq $0x10f0, %rsi           # imm = 0x10F0
xorpd %xmm2, %xmm2
pushq $0x1
popq %r9
pushq $-0xb
popq %r10
xorpd %xmm3, %xmm3
xorpd %xmm1, %xmm1
testq %r10, %r10
je 0x1f385
movl 0x350(%rbx,%r10,4), %r11d
testb %dl, %dl
je 0x1f318
cmpl %eax, %r11d
je 0x1f373
movsd -0x1028(%rsi), %xmm4
ucomisd %xmm0, %xmm4
jbe 0x1f373
leaq -0x1040(%rsi), %r11
jmp 0x1f338
cmpl %ecx, %r11d
je 0x1f373
movsd (%rsi), %xmm4
ucomisd %xmm0, %xmm4
jbe 0x1f373
imulq $0x178, %r9, %r11       # imm = 0x178
addq %rdi, %r11
addq $-0x170, %r11           # imm = 0xFE90
movslq 0x380(%rbx,%r10,4), %r14
imulq $0xc0, %r14, %r14
movsd (%r11), %xmm5
addsd (%r8,%r14), %xmm5
movsd 0x8(%r11), %xmm6
addsd 0x8(%r8,%r14), %xmm6
mulsd %xmm4, %xmm5
mulsd %xmm4, %xmm6
addsd %xmm5, %xmm3
addsd %xmm6, %xmm2
addsd %xmm4, %xmm1
incq %r9
incq %r10
addq $0x178, %rsi            # imm = 0x178
jmp 0x1f2e7
leaq -0x20(%rbp), %rdi
movsd %xmm3, (%rdi)
movsd %xmm2, 0x8(%rdi)
movapd %xmm1, %xmm0
callq 0x218ee
leaq 0xc80(%rbx), %rax
movsd %xmm0, 0xc80(%rbx)
movsd %xmm1, 0xc88(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: FormationBase::GetFormationPoint(WorldState const&, bool, int, double)
Vector FormationBase::GetFormationPoint(const WorldState &world_state,
                                        bool is_teammate, Unum unum,
                                        double min_conf) {
  if (is_teammate) {
    return GetFormationCenter(world_state, is_teammate, min_conf) +
           mOffsetMatrix[0][mUnum2Index[unum]];
  } else {
    return GetFormationCenter(world_state, is_teammate, min_conf) -
           mOffsetMatrix[0][mUnum2Index[unum]];
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x380(%rdi), %r14
movslq %ecx, %r15
testl %edx, %edx
je 0x1f47c
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x1f2a4
movslq 0x350(%rbx,%r15,4), %rcx
shlq $0x4, %rcx
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
addsd (%r14,%rcx), %xmm0
addsd 0x8(%r14,%rcx), %xmm1
jmp 0x1f4a8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1f2a4
movslq 0x350(%rbx,%r15,4), %rcx
shlq $0x4, %rcx
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
subsd (%r14,%rcx), %xmm0
subsd 0x8(%r14,%rcx), %xmm1
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: TeammateFormation::SetTeammateRole()
void TeammateFormation::SetTeammateRole() {
  for (int i = 1; i <= TEAMSIZE; ++i) {
    mPlayerRole[i].mLineType = LineType(mPlayerRole[i].mIndexX);

    /** 确定mPositionType */
    double midoffset = mPlayerRole[i].mIndexY -
                       (mLineArrange[mPlayerRole[i].mIndexX] + 1) * 0.5;
    if (fabs(midoffset) < FLOAT_EPS) {
      mPlayerRole[i].mPositionType = PT_Middle;
    } else if (fabs(midoffset - 0.5) < FLOAT_EPS) {
      mPlayerRole[i].mPositionType = PT_RightMiddle;
    } else if (fabs(midoffset + 0.5) < FLOAT_EPS) {
      mPlayerRole[i].mPositionType = PT_LeftMiddle;
    } else if (fabs(midoffset - 1.25) < 0.25 + FLOAT_EPS) { // 1.5 or 1.0
      mPlayerRole[i].mPositionType = PT_Right;
    } else if (fabs(midoffset + 1.25) < 0.25 + FLOAT_EPS) { // 1.5 or 1.0
      mPlayerRole[i].mPositionType = PT_Left;
    } else if (midoffset > 2.0 - FLOAT_EPS) {
      mPlayerRole[i].mPositionType = PT_RightRight;
    } else {
      mPlayerRole[i].mPositionType = PT_LeftLeft;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movsd 0x37280(%rip), %xmm0    # 0x57060
movapd 0x37228(%rip), %xmm1    # 0x57010
movsd 0x37250(%rip), %xmm2    # 0x57040
movsd 0x37a50(%rip), %xmm3    # 0x57848
movsd 0x387a8(%rip), %xmm4    # 0x585a8
movsd 0x387a8(%rip), %xmm5    # 0x585b0
movsd 0x387a8(%rip), %xmm6    # 0x585b8
movsd 0x387a8(%rip), %xmm7    # 0x585c0
cmpq $0xb0, %rax
je 0x1ff09
movslq 0x60(%rdi,%rax), %rcx
movl %ecx, 0x68(%rdi,%rax)
cvtsi2sdl 0x64(%rdi,%rax), %xmm9
movl 0x40(%rdi,%rcx,4), %ecx
incl %ecx
cvtsi2sd %ecx, %xmm8
mulsd %xmm0, %xmm8
addsd %xmm9, %xmm8
movapd %xmm8, %xmm9
andpd %xmm1, %xmm9
ucomisd %xmm9, %xmm2
jbe 0x1fe67
movl $0x2, 0x6c(%rdi,%rax)
jmp 0x1ff00
movapd %xmm8, %xmm9
addsd %xmm0, %xmm9
andpd %xmm1, %xmm9
ucomisd %xmm9, %xmm2
jbe 0x1fe87
movl $0x5, 0x6c(%rdi,%rax)
jmp 0x1ff00
movapd %xmm8, %xmm9
addsd %xmm3, %xmm9
andpd %xmm1, %xmm9
ucomisd %xmm9, %xmm2
jbe 0x1fea7
movl $0x6, 0x6c(%rdi,%rax)
jmp 0x1ff00
movapd %xmm8, %xmm9
addsd %xmm4, %xmm9
andpd %xmm1, %xmm9
ucomisd %xmm9, %xmm5
jbe 0x1fec7
movl $0x3, 0x6c(%rdi,%rax)
jmp 0x1ff00
movapd %xmm8, %xmm9
addsd %xmm6, %xmm9
andpd %xmm1, %xmm9
ucomisd %xmm9, %xmm5
jbe 0x1fee7
movl $0x1, 0x6c(%rdi,%rax)
jmp 0x1ff00
ucomisd %xmm7, %xmm8
jbe 0x1fef8
movl $0x4, 0x6c(%rdi,%rax)
jmp 0x1ff00
movl $0x7, 0x6c(%rdi,%rax)
addq $0x10, %rax
jmp 0x1fe18
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: OpponentFormation::OpponentFormation(int, FormationType)
OpponentFormation::OpponentFormation(Unum goalie_unum, FormationType type)
    : FormationBase(type), mGoalieUnum(goalie_unum) {
  mTactics.bzero();
  map<string, FormationTacticType> formation_tactic_map;

  mUsedTimes = 0;
  mHIntervalTimes[0] = 0;
  mHIntervalTimes[1] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl %edx, %esi
callq 0x1f186
leaq 0x564b6(%rip), %rax     # 0x767b0
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0xc90(%r14)
movups %xmm0, 0xca0(%r14)
movups %xmm0, 0xcb0(%r14)
movups %xmm0, 0xcc0(%r14)
andq $0x0, 0xcd0(%r14)
movl %ebx, 0xce8(%r14)
andq $0x0, 0xcf0(%r14)
leaq -0x38(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movups %xmm0, 0xcd8(%r14)
leaq -0x40(%rbp), %rdi
callq 0x21d7c
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::GetTeammateExpectedGoaliePos(Vector, double)
Vector Formation::GetTeammateExpectedGoaliePos(Vector bp, double run) {
  const WorldState &world_state = mAgent.GetWorldState();

  Vector gPos;
  int Uncyc;
  if (world_state.GetTeammateGoalieUnum() == 0 ||
      world_state.GetTeammate(world_state.GetTeammateGoalieUnum())
              .GetPosConf() < FLOAT_EPS) { //取守门员的位置以及没有见到的周期
    gPos = Vector(ServerParam::instance().PITCH_LENGTH / 2.0, 0.0); // 估值而已

    Vector p[2];
    double dist[2];
    p[0] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  -ServerParam::instance().goalWidth() / 2.0 + 0.1); // top
    p[1] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  ServerParam::instance().goalWidth() / 2.0 - 0.1); // down
    dist[0] = bp.Dist(p[0]);
    dist[1] = bp.Dist(p[1]);
    Uncyc = (int)(Min(dist[0], dist[1]) / 5.0);
  } else {
    gPos =
        world_state.GetTeammate(world_state.GetTeammateGoalieUnum()).GetPos();
    Uncyc = world_state.GetTeammate(world_state.GetTeammateGoalieUnum())
                .GetPosDelay();
  }

  return mpTeammateFormation->GetExpectedGoaliePos(bp, run, gPos, Uncyc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rax
movslq 0x2110(%rax), %rcx
testq %rcx, %rcx
je 0x20afe
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd 0x36551(%rip), %xmm3    # 0x57040
ucomisd -0xb0(%rcx,%rax), %xmm3
jbe 0x20bd4
movsd %xmm2, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
leaq 0x393af(%rip), %rax     # 0x59ec8
movsd (%rax), %xmm0
mulsd 0x36d23(%rip), %xmm0    # 0x57848
movsd %xmm0, -0x20(%rbp)
movsd %xmm0, -0x10(%rbp)
andq $0x0, -0x8(%rbp)
callq 0x3db2c
callq 0x3db2c
movsd 0x3008(%rax), %xmm0
mulsd 0x36cfa(%rip), %xmm0    # 0x57848
movsd 0x37a3a(%rip), %xmm1    # 0x58590
subsd %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
callq 0x3db2c
callq 0x3db2c
movsd -0x38(%rbp), %xmm2
movsd 0x36cd2(%rip), %xmm0    # 0x57848
mulsd 0x3008(%rax), %xmm0
addsd 0x37a12(%rip), %xmm0    # 0x58598
movapd %xmm0, %xmm4
movsd -0x28(%rbp), %xmm3
subsd -0x20(%rbp), %xmm3
movsd -0x30(%rbp), %xmm1
movapd %xmm1, %xmm0
subsd -0x18(%rbp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm3, %xmm0
sqrtsd %xmm0, %xmm0
subsd %xmm4, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
sqrtsd %xmm1, %xmm1
minsd %xmm0, %xmm1
divsd 0x36dca(%rip), %xmm1    # 0x57998
cvttsd2si %xmm1, %ecx
jmp 0x20be9
addq %rcx, %rax
addq $-0xc8, %rax
movupd (%rax), %xmm0
movapd %xmm0, -0x10(%rbp)
movl 0x10(%rax), %ecx
leaq -0x48(%rbp), %rsi
leaq -0x10(%rbp), %rdx
movaps %xmm2, %xmm0
callq 0x1f4b4
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::GetTeammateFormationPoint(int, Vector const&)
Vector Formation::GetTeammateFormationPoint(Unum unum, const Vector &ball_pos) {
  Assert(unum >= 1 && unum <= TEAMSIZE);

  Vector point;
  if (unum == mAgent.GetWorldState().GetTeammateGoalieUnum()) {
    return Vector(-47.5, 0);
  }

  point.SetX(ball_pos.X() * mpTeammateFormation->GetHBallFactor() +
             mpTeammateFormation->GetOffside(0, unum).X());
  point.SetY(ball_pos.Y() * mpTeammateFormation->GetVBallFactor() +
             mpTeammateFormation->GetOffside(0, unum).Y());
  return point;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rax
cmpl %esi, 0x2110(%rax)
jne 0x20c22
xorpd %xmm1, %xmm1
movsd 0x379c0(%rip), %xmm0    # 0x585e0
jmp 0x20c6b
movq 0x10(%rdi), %rax
movslq 0x350(%rax), %rcx
imulq $0xc0, %rcx, %rcx
addq %rax, %rcx
movslq %esi, %rsi
movslq 0x350(%rax,%rsi,4), %rsi
shlq $0x4, %rsi
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm1
mulsd 0x50(%rax), %xmm0
addsd 0x380(%rsi,%rcx), %xmm0
mulsd 0x58(%rax), %xmm1
addsd 0x388(%rsi,%rcx), %xmm1
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::GetTeammateFormationPoint(int, int, Vector)
Vector Formation::GetTeammateFormationPoint(Unum unum, Unum focusTm,
                                            Vector focusPt) {
  Assert(unum >= 1 && unum <= TEAMSIZE);
  if (unum == mAgent.GetWorldState().GetTeammateGoalieUnum()) {
    return Vector(-47.5, 0);
  }

  if (focusTm == mAgent.GetWorldState().GetTeammateGoalieUnum()) {
    int back_center = mpTeammateFormation->GetLineArrange(1) / 2 + 1; // 中后卫
    focusTm = mpTeammateFormation->GetUnumFromPos(1, back_center);
    focusPt.SetX(focusPt.X() + 9.0);
  } else if (focusTm <= Unum_Unknown ||
             mAgent.GetWorldState().CurrentTime().T() < 1) {
    return GetTeammateFormationPoint(unum);
  }

  focusPt = mpTeammateFormation->GetActiveField(focusTm).AdjustToWithin(
      focusPt); //调整到有效范围
  if (focusTm == unum) {
    return focusPt;
  }
  return focusPt + mpTeammateFormation->GetOffside(focusTm, unum);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x28(%rbp)
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rax
movl 0x2110(%rax), %ecx
cmpl %esi, %ecx
jne 0x20caa
xorpd %xmm1, %xmm1
movsd 0x3793b(%rip), %xmm0    # 0x585e0
jmp 0x20d7b
movl %esi, %ebx
movq %rdi, %r14
cmpl %edx, %ecx
jne 0x20ce0
movq 0x10(%r14), %rcx
movl 0x44(%rcx), %eax
pushq $0x2
popq %rsi
cltd
idivl %esi
cltq
movslq 0x29c(%rcx,%rax,4), %rax
movl 0x320(%rcx,%rax,4), %edx
addsd 0x3790f(%rip), %xmm0    # 0x585e8
movsd %xmm0, -0x30(%rbp)
jmp 0x20cf2
testl %edx, %edx
jle 0x20d69
cmpl $0x0, 0x10(%rax)
jle 0x20d69
movq 0x10(%r14), %rcx
movslq %edx, %r12
movslq 0x350(%rcx,%r12,4), %rax
shlq $0x5, %rax
leaq (%rax,%rcx), %rdi
addq $0xf0, %rdi
leaq -0x30(%rbp), %r15
movq %r15, %rsi
callq 0x21940
movsd %xmm0, (%r15)
movsd %xmm1, 0x8(%r15)
cmpl %ebx, %r12d
je 0x20d7b
movq 0x10(%r14), %rax
movslq 0x350(%rax,%r12,4), %rcx
imulq $0xc0, %rcx, %rcx
addq %rax, %rcx
movslq %ebx, %rdx
movslq 0x350(%rax,%rdx,4), %rax
shlq $0x4, %rax
movsd 0x380(%rax,%rcx), %xmm2
addsd %xmm2, %xmm0
movsd 0x388(%rax,%rcx), %xmm2
addsd %xmm2, %xmm1
jmp 0x20d7b
movsd 0x36c1f(%rip), %xmm0    # 0x57990
movq %r14, %rdi
movl %ebx, %esi
callq 0x20a9c
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/Formation.cpp
// Function: Formation::GetOpponentExpectedGoaliePos(Vector, double)
Vector Formation::GetOpponentExpectedGoaliePos(Vector bp, double run) {
  const WorldState &world_state = mAgent.GetWorldState();

  Vector gPos;
  int Uncyc;
  if (world_state.GetOpponentGoalieUnum() == 0 ||
      world_state.GetOpponent(world_state.GetOpponentGoalieUnum())
              .GetPosConf() < FLOAT_EPS) { //取守门员的位置以及没有见到的周期
    gPos = Vector(ServerParam::instance().PITCH_LENGTH / 2.0, 0.0); // 估值而已

    Vector p[2];
    double dist[2];
    p[0] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  -ServerParam::instance().goalWidth() / 2.0 + 0.1); // top
    p[1] = Vector(ServerParam::instance().PITCH_LENGTH / 2.0,
                  ServerParam::instance().goalWidth() / 2.0 - 0.1); // down
    dist[0] = bp.Dist(p[0]);
    dist[1] = bp.Dist(p[1]);
    Uncyc = (int)(Min(dist[0], dist[1]) / 5.0);
  } else {
    gPos =
        world_state.GetOpponent(world_state.GetOpponentGoalieUnum()).GetPos();
    Uncyc = world_state.GetOpponent(world_state.GetOpponentGoalieUnum())
                .GetPosDelay();
  }

  return mpOpponentFormation->GetExpectedGoaliePos(bp, run, gPos, Uncyc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x48(%rbp)
movsd %xmm1, -0x40(%rbp)
movq 0x8(%rdi), %rax
movq 0x18(%rax), %rax
movslq 0x2114(%rax), %rcx
testq %rcx, %rcx
je 0x20e0c
imulq $0x178, %rcx, %rcx      # imm = 0x178
movsd 0x36243(%rip), %xmm3    # 0x57040
ucomisd 0xf78(%rcx,%rax), %xmm3
jbe 0x20ee2
movsd %xmm2, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm0, -0x28(%rbp)
callq 0x3db2c
leaq 0x390a1(%rip), %rax     # 0x59ec8
movsd (%rax), %xmm0
mulsd 0x36a15(%rip), %xmm0    # 0x57848
movsd %xmm0, -0x20(%rbp)
movsd %xmm0, -0x10(%rbp)
andq $0x0, -0x8(%rbp)
callq 0x3db2c
callq 0x3db2c
movsd 0x3008(%rax), %xmm0
mulsd 0x369ec(%rip), %xmm0    # 0x57848
movsd 0x3772c(%rip), %xmm1    # 0x58590
subsd %xmm0, %xmm1
movsd %xmm1, -0x18(%rbp)
callq 0x3db2c
callq 0x3db2c
movsd -0x38(%rbp), %xmm2
movsd 0x369c4(%rip), %xmm0    # 0x57848
mulsd 0x3008(%rax), %xmm0
addsd 0x37704(%rip), %xmm0    # 0x58598
movapd %xmm0, %xmm4
movsd -0x28(%rbp), %xmm3
subsd -0x20(%rbp), %xmm3
movsd -0x30(%rbp), %xmm1
movapd %xmm1, %xmm0
subsd -0x18(%rbp), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm3, %xmm3
addsd %xmm3, %xmm0
sqrtsd %xmm0, %xmm0
subsd %xmm4, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm3, %xmm1
sqrtsd %xmm1, %xmm1
minsd %xmm0, %xmm1
divsd 0x36abc(%rip), %xmm1    # 0x57998
cvttsd2si %xmm1, %ecx
jmp 0x20ef7
addq %rcx, %rax
addq $0xf60, %rax            # imm = 0xF60
movupd (%rax), %xmm0
movapd %xmm0, -0x10(%rbp)
movl 0x10(%rax), %ecx
leaq -0x48(%rbp), %rsi
leaq -0x10(%rbp), %rdx
movaps %xmm2, %xmm0
callq 0x1f4b4
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::GetOpponentFormationPoint(int, Vector const&)
Vector Formation::GetOpponentFormationPoint(Unum unum, const Vector &ball_pos) {
  double x = ball_pos.X() * mpOpponentFormation->GetHBallFactor() -
             mpOpponentFormation->GetOffside(0, unum).X();
  if (mAgent.GetWorldState().GetPlayMode() == PM_Our_Kick_Off && x > 0) {
    x = 0.0;
  }
  double y = ball_pos.Y() * mpOpponentFormation->GetVBallFactor() -
             mpOpponentFormation->GetOffside(0, unum).Y();
  return Vector(x, y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %r8
movq 0x18(%rdi), %rax
movslq 0x350(%rax), %rcx
imulq $0xc0, %rcx, %rcx
addq %rax, %rcx
movslq %esi, %rsi
movslq 0x350(%rax,%rsi,4), %rsi
shlq $0x4, %rsi
movsd (%rdx), %xmm2
mulsd 0x50(%rax), %xmm2
subsd 0x380(%rsi,%rcx), %xmm2
movsd 0x8(%rdx), %xmm1
movq 0x18(%r8), %rdx
cmpl $0x2, 0x1c(%rdx)
je 0x20f61
movapd %xmm2, %xmm0
jmp 0x20f69
xorpd %xmm0, %xmm0
minsd %xmm2, %xmm0
mulsd 0x58(%rax), %xmm1
subsd 0x388(%rsi,%rcx), %xmm1
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::IsOpponentRoleValid()
bool Formation::IsOpponentRoleValid() {
  return mAgent.IsReverse()
             ? true
             : (static_cast<OpponentFormation *>(mpOpponentFormation)
                    ->IsRoleValid());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
cmpb $0x0, 0xc(%rax)
je 0x20f8c
movb $0x1, %al
popq %rbp
retq
movq 0x18(%rdi), %rdi
movq (%rdi), %rax
popq %rbp
jmpq *0x10(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: Formation::Rollback(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Formation::Rollback(std::string update_name) {
  if (!mFormationTypeStack.empty()) {
    mFormationTypeStack.pop();
    if (!mFormationTypeStack.empty()) {
      SetTeammateFormationType(mFormationTypeStack.top().first);
      SetOpponentFormationType(mFormationTypeStack.top().second);
    }
  } else {
    Assert(!"mFormationTypeStack.empty()");
  }

  Logger::instance().GetTextLogger("formation_update")
      << mAgent.GetWorldState().CurrentTime() << ", " << mAgent.GetAgentID()
      << ", -, " << mFormationTypeStack.size() << ": " << update_name << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x20(%rdi), %r14
movq 0x50(%rdi), %rax
cmpq 0x30(%rdi), %rax
je 0x212cb
movq %r14, %rdi
callq 0x22b4c
movq 0x50(%r15), %rax
cmpq 0x30(%r15), %rax
je 0x212cb
movq 0x58(%r15), %rsi
movq %rax, %rdi
cmpq %rsi, %rax
jne 0x2127c
movq 0x68(%r15), %rcx
movl $0x200, %edi            # imm = 0x200
addq -0x8(%rcx), %rdi
movq 0x8(%r15), %rcx
movzbl 0xc(%rcx), %edx
movl %edx, %r8d
shll $0x5, %r8d
leaq 0x5cdde(%rip), %rcx     # 0x7e070
addq %rcx, %r8
movl -0x8(%rdi), %edi
movq 0x40(%r8,%rdi,8), %rdi
movq %rdi, 0x10(%r15)
cmpq %rsi, %rax
jne 0x212b3
movq 0x68(%r15), %rsi
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rsi), %rax
movl -0x4(%rax), %eax
xorb $0x1, %dl
movzbl %dl, %edx
shll $0x5, %edx
addq %rdx, %rcx
movq 0x40(%rcx,%rax,8), %rax
movq %rax, 0x18(%r15)
callq 0x2ca2e
leaq 0x37339(%rip), %rsi     # 0x58610
movq %rax, %rdi
callq 0x2cc3e
movq 0x8(%r15), %rcx
movq 0x18(%rcx), %rsi
addq $0x10, %rsi
movq %rax, %rdi
callq 0x10e94
leaq 0x3732a(%rip), %rsi     # 0x58624
movq %rax, %rdi
callq 0x21b92
movq %rax, %r12
movq 0x8(%r15), %rdi
callq 0x21bf6
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movl %edx, 0x8(%rsi)
shrq $0x20, %rdx
movb %dl, 0xc(%rsi)
movq %r12, %rdi
callq 0x21bc4
leaq 0x372f9(%rip), %rsi     # 0x58627
movq %rax, %rdi
callq 0x21c1c
movq %rax, %r15
movq %r14, %rdi
callq 0x2296e
leaq -0x28(%rbp), %rsi
movq %rax, (%rsi)
movq %r15, %rdi
callq 0x21c4e
leaq 0x380c9(%rip), %rsi     # 0x59420
movq %rax, %rdi
callq 0x21b92
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c80
movq 0x55c3f(%rip), %rsi     # 0x76fb0
movq %rax, %rdi
callq 0x10f5c
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq