// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x8(%rax), %rdi
callq 0x11dd0
cmpl $0x0, (%rax)
jle 0x2843a
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x11dd0
cmpl $0xc, (%rax)
jge 0x2843a
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %esi, %esi
callq 0xaaed0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rdi
callq 0x11dd0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x1a9d0
movq %rax, %rdi
movl $0x1, %esi
callq 0x288a0
movq 0xd5bd1(%rip), %rdi     # 0xfdfc0
leaq 0x99bb0(%rip), %rsi     # 0xc1fa6
callq 0xa5a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq 0x8(%rax), %rdi
callq 0x11dd0
movq -0x28(%rbp), %rdi
movl (%rax), %esi
callq 0xaa40
movq %rax, %rdi
leaq 0x99f8f(%rip), %rsi     # 0xc23b3
callq 0xa5a0
movq %rax, %rdi
movq 0xd5b7d(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x28494
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x11dd0
cmpl $0xc, (%rax)
jne 0x28470
movq 0xd5b6d(%rip), %rdi     # 0xfdfc0
leaq 0x99b7d(%rip), %rsi     # 0xc1fd7
callq 0xa5a0
movq %rax, %rdi
movq 0xd5b47(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x28492
movq 0xd5b49(%rip), %rdi     # 0xfdfc0
leaq 0x99b8e(%rip), %rsi     # 0xc200c
callq 0xa5a0
movq %rax, %rdi
movq 0xd5b23(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x28494
movl $0x128, %edi            # imm = 0x128
callq 0xa5c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq 0x8(%rax), %rdi
callq 0x11dd0
movq %rax, -0x38(%rbp)
jmp 0x284b8
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movl (%rcx), %esi
movq 0x10(%rax), %rdx
xorl %ecx, %ecx
callq 0x13580
jmp 0x284d3
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rax), %rsi
leaq 0xdcce6(%rip), %rdi     # 0x1051d0
callq 0x3f000
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x28950
callq 0x2c310
movq %rax, %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x18(%rax), %rdx
callq 0x2c3a0
callq 0xa47b0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xa4840
addq $0x40, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x128, %esi            # imm = 0x128
callq 0xa5e0
movq -0x10(%rbp), %rdi
callq 0xaa60
nopw (%rax,%rax)