// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: TeammateFormation::TeammateFormation(FormationType, char const*)
TeammateFormation::TeammateFormation(FormationType type,
                                     const char *config_file)
    : FormationBase(type) {
  mTactics.bzero();
  map<string, FormationTacticType> formation_tactic_map;

  formation_tactic_map_register(KickOffPosition);

  ifstream fin(config_file);
  string conf, section;
  vector<string> content;
  while (getline(fin, conf)) {
    if (conf[0] == '[') {
      if (section == "Formation") {
        InitialFormation(content);
      } else if (formation_tactic_map.find(section) !=
                 formation_tactic_map.end()) {
        mTactics[formation_tactic_map[section]]->Initial(
            content, mIndex2Unum.instance(), mUnum2Index.instance());
      }
      section = conf.substr(1, conf.rfind(']') - 1);
      content.clear();
    } else if (conf[0] != '#' && conf.size() > 0) {
      content.push_back(conf);
    }
  }
  if (section == "Formation") {
    InitialFormation(content);
  } else if (formation_tactic_map.find(section) != formation_tactic_map.end()) {
    mTactics[formation_tactic_map[section]]->Initial(
        content, mIndex2Unum.instance(), mUnum2Index.instance());
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x340(%rbp)
movl -0xc(%rbp), %esi
callq 0x38480
movq -0x340(%rbp), %rdi
leaq 0xc4421(%rip), %rax     # 0xfd758
movq %rax, (%rdi)
addq $0xca0, %rdi            # imm = 0xCA0
callq 0x3fd70
jmp 0x39348
movq -0x340(%rbp), %rdi
addq $0xca0, %rdi            # imm = 0xCA0
callq 0x3fd80
jmp 0x3935d
leaq -0x58(%rbp), %rdi
callq 0x3fdb0
leaq -0x79(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0xaa70
movq -0x348(%rbp), %rdx
leaq 0x891e4(%rip), %rsi     # 0xc2568
leaq -0x78(%rbp), %rdi
callq 0x1a540
jmp 0x3938f
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3fdd0
movq %rax, -0x350(%rbp)
jmp 0x393a5
movq -0x350(%rbp), %rax
movl $0x0, (%rax)
leaq -0x78(%rbp), %rdi
callq 0xa370
leaq -0x79(%rbp), %rdi
callq 0xa650
movl $0x178, %edi            # imm = 0x178
callq 0xa5c0
movq %rax, -0x358(%rbp)
jmp 0x393d7
movq -0x358(%rbp), %rdi
callq 0x46ad0
jmp 0x393e5
movq -0x340(%rbp), %rdi
addq $0xca0, %rdi            # imm = 0xCA0
movq $0x0, -0x88(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x3feb0
movq %rax, -0x360(%rbp)
jmp 0x39413
movq -0x360(%rbp), %rax
movq -0x358(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x39426
movq -0x18(%rbp), %rsi
leaq -0x290(%rbp), %rdi
movl $0x8, %edx
callq 0xab00
jmp 0x3943d
leaq -0x2b0(%rbp), %rdi
callq 0xa820
leaq -0x2d0(%rbp), %rdi
callq 0xa820
leaq -0x2e8(%rbp), %rdi
callq 0x3fed0
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0xa140
movq %rax, -0x368(%rbp)
jmp 0x3947d
movq -0x368(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa780
movb %al, -0x369(%rbp)
jmp 0x3949b
movb -0x369(%rbp), %al
testb $0x1, %al
jne 0x394aa
jmp 0x397b4
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b0(%rbp), %rdi
callq 0xac00
movq %rax, -0x378(%rbp)
jmp 0x394c3
movq -0x378(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x3975c
leaq 0x8838f(%rip), %rsi     # 0xc186c
leaq -0x2d0(%rbp), %rdi
callq 0x36110
movb %al, -0x379(%rbp)
jmp 0x394f1
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0x39500
jmp 0x395d0
movq -0x340(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x39980
jmp 0x39515
jmp 0x396f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x39960
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3954e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xa370
leaq -0x79(%rbp), %rdi
callq 0xa650
jmp 0x39957
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x39957
movq -0x358(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x178, %esi            # imm = 0x178
callq 0xa5e0
jmp 0x39957
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x40100
leaq -0x2d0(%rbp), %rdi
callq 0xa370
leaq -0x2b0(%rbp), %rdi
callq 0xa370
leaq -0x290(%rbp), %rdi
callq 0xa1b0
jmp 0x39957
leaq -0x58(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3ff20
movq %rax, -0x388(%rbp)
jmp 0x395e9
movq -0x388(%rbp), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3ff50
movq %rax, -0x2f8(%rbp)
leaq -0x2f0(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x3fef0
testb $0x1, %al
jne 0x39623
jmp 0x396ee
movq -0x340(%rbp), %rax
addq $0xca0, %rax            # imm = 0xCA0
movq %rax, -0x398(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3ff80
movq %rax, -0x390(%rbp)
jmp 0x39650
movq -0x398(%rbp), %rdi
movq -0x390(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x300(%rbp)
leaq -0x300(%rbp), %rsi
callq 0x3feb0
movq %rax, -0x3a0(%rbp)
jmp 0x3967c
movq -0x340(%rbp), %rdi
movq -0x3a0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x3b0(%rbp)
addq $0x320, %rdi            # imm = 0x320
callq 0x40060
movq %rax, -0x3a8(%rbp)
jmp 0x396a9
movq -0x340(%rbp), %rdi
addq $0x350, %rdi            # imm = 0x350
callq 0x40060
movq %rax, -0x3b8(%rbp)
jmp 0x396c5
movq -0x3b8(%rbp), %rcx
movq -0x3a8(%rbp), %rdx
movq -0x3b0(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq -0x2e8(%rbp), %rsi
callq *%rax
jmp 0x396ec
jmp 0x396ee
jmp 0x396f0
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
movl $0x5d, %esi
movq $-0x1, %rdx
callq 0xabd0
movq -0x3c0(%rbp), %rsi
movq %rax, %rcx
decq %rcx
leaq -0x320(%rbp), %rdi
movl $0x1, %edx
callq 0xa610
jmp 0x3972f
leaq -0x2d0(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0xa760
leaq -0x320(%rbp), %rdi
callq 0xa370
leaq -0x2e8(%rbp), %rdi
callq 0x40070
jmp 0x397af
xorl %eax, %eax
movl %eax, %esi
leaq -0x2b0(%rbp), %rdi
callq 0xac00
movq %rax, -0x3c8(%rbp)
jmp 0x39775
movq -0x3c8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0x397ad
leaq -0x2b0(%rbp), %rdi
callq 0xa3d0
cmpq $0x0, %rax
jbe 0x397ad
leaq -0x2e8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x40090
jmp 0x397ab
jmp 0x397ad
jmp 0x397af
jmp 0x39461
leaq 0x880b1(%rip), %rsi     # 0xc186c
leaq -0x2d0(%rbp), %rdi
callq 0x36110
movb %al, -0x3c9(%rbp)
jmp 0x397cf
movb -0x3c9(%rbp), %al
testb $0x1, %al
jne 0x397db
jmp 0x397f5
movq -0x340(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x39980
jmp 0x397f0
jmp 0x39915
leaq -0x58(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3ff20
movq %rax, -0x3d8(%rbp)
jmp 0x3980e
movq -0x3d8(%rbp), %rax
movq %rax, -0x328(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3ff50
movq %rax, -0x330(%rbp)
leaq -0x328(%rbp), %rdi
leaq -0x330(%rbp), %rsi
callq 0x3fef0
testb $0x1, %al
jne 0x39848
jmp 0x39913
movq -0x340(%rbp), %rax
addq $0xca0, %rax            # imm = 0xCA0
movq %rax, -0x3e8(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x2d0(%rbp), %rsi
callq 0x3ff80
movq %rax, -0x3e0(%rbp)
jmp 0x39875
movq -0x3e8(%rbp), %rdi
movq -0x3e0(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x338(%rbp)
leaq -0x338(%rbp), %rsi
callq 0x3feb0
movq %rax, -0x3f0(%rbp)
jmp 0x398a1
movq -0x340(%rbp), %rdi
movq -0x3f0(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x400(%rbp)
addq $0x320, %rdi            # imm = 0x320
callq 0x40060
movq %rax, -0x3f8(%rbp)
jmp 0x398ce
movq -0x340(%rbp), %rdi
addq $0x350, %rdi            # imm = 0x350
callq 0x40060
movq %rax, -0x408(%rbp)
jmp 0x398ea
movq -0x408(%rbp), %rcx
movq -0x3f8(%rbp), %rdx
movq -0x400(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
leaq -0x2e8(%rbp), %rsi
callq *%rax
jmp 0x39911
jmp 0x39913
jmp 0x39915
leaq -0x2e8(%rbp), %rdi
callq 0x40100
leaq -0x2d0(%rbp), %rdi
callq 0xa370
leaq -0x2b0(%rbp), %rdi
callq 0xa370
leaq -0x290(%rbp), %rdi
callq 0xa1b0
leaq -0x58(%rbp), %rdi
callq 0x40160
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
leaq -0x58(%rbp), %rdi
callq 0x40160
movq -0x340(%rbp), %rdi
callq 0x40d70
movq -0x20(%rbp), %rdi
callq 0xaa60
nopw %cs:(%rax,%rax)