// File: /workspace/github_cpp_makefile_star2_O2/wrighteagle2d[P]wrighteaglebase/Debug/../src/DynamicDebug.cpp
// Function: DynamicDebug::Initial(Observer*)
void DynamicDebug::Initial(Observer *pObserver) {
  if (mInitialOK == true) {
    return;
  }

  if (pObserver == 0) {
    PRINT_ERROR("Observer Null Pointer");
    return;
  }

  mpObserver = pObserver;

  if (PlayerParam::instance().DynamicDebugMode() == true) // 动态调试
  {
    mpFileStream = new std::ifstream("dynamicdebug.txt");
    if (mpFileStream) {
      std::cin.rdbuf(mpFileStream->rdbuf());
    }
  } else // 正常比赛时
  {
    if (PlayerParam::instance().SaveServerMessage() ==
        true) // 需要保存server信息
    {
      char file_name[64];
      sprintf(file_name, "%s/%s-%d-msg.log",
              PlayerParam::instance().logDir().c_str(),
              PlayerParam::instance().teamName().c_str(),
              mpObserver->SelfUnum());
      mpFile = fopen(file_name, "wb");
      if (mpFile) {
        if (setvbuf(mpFile, 0, _IOFBF, 1024 * 8192) != 0) {
          PRINT_ERROR("set buffer for file \"" << file_name << "\" error");
        }
      } else {
        PRINT_ERROR("open file \"" << file_name << "\" error");
      }
    }

    if (mpFile != 0) {
      fseek(mpFile, sizeof(mFileHead) + 2 * sizeof(char),
            SEEK_SET); // 留出mFileHead的地方，最后再填
      mFileHead.mIndexTableSize = 0;
      mIndexTable.reserve(8192);
      mMessageTable.reserve(8192);
    }
  }
  mInitialOK = true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
cmpb $0x0, 0x8(%rdi)
jne 0x1da4f
testq %rsi, %rsi
je 0x1d8b7
movq %rdi, %rbx
movq %rsi, (%rdi)
callq 0x38d94
cmpb $0x1, 0x5c40(%rax)
jne 0x1d914
movl $0x208, %edi            # imm = 0x208
callq 0x94d0
movq %rax, %r14
leaq 0x3aaaa(%rip), %rsi     # 0x58330
pushq $0x8
popq %rdx
movq %rax, %rdi
callq 0x9920
movq %r14, 0x128(%rbx)
movq 0x59739(%rip), %rdi     # 0x76fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
addq $0x10, %r14
movq %r14, %rsi
callq 0x9950
jmp 0x1da4b
movq 0x59732(%rip), %rdi     # 0x76ff0
leaq 0x3aa3d(%rip), %rsi     # 0x58302
callq 0x94b0
leaq 0x3d8a1(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
pushq $0x59
popq %rsi
movq %rax, %rdi
callq 0x9890
leaq 0x3bb34(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
leaq 0x3aa20(%rip), %rsi     # 0x5831a
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x99e8
callq 0x38d94
cmpb $0x1, 0x5c42(%rax)
jne 0x1da11
callq 0x38d94
movq 0x30f8(%rax), %r14
callq 0x38d94
movq 0x3138(%rax), %rcx
movq (%rbx), %rax
movl 0x2c(%rax), %r8d
leaq 0x3a9f5(%rip), %rsi     # 0x58341
leaq -0x60(%rbp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x9100
leaq 0x3a9ee(%rip), %rsi     # 0x58352
movq %r15, %rdi
callq 0x95a0
movq %rax, 0x120(%rbx)
testq %rax, %rax
je 0x1d99c
movl $0x800000, %ecx         # imm = 0x800000
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9060
testl %eax, %eax
je 0x1da11
leaq 0x3a9bd(%rip), %r14     # 0x58355
pushq $0x72
jmp 0x1d9a5
leaq 0x3a9d0(%rip), %r14     # 0x58373
pushq $0x75
popq %r15
movq 0x59642(%rip), %rdi     # 0x76ff0
leaq 0x3a94d(%rip), %rsi     # 0x58302
callq 0x94b0
leaq 0x3d7b1(%rip), %rsi     # 0x5b172
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movl %r15d, %esi
callq 0x9890
leaq 0x3ba44(%rip), %rsi     # 0x5941f
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x94b0
leaq -0x60(%rbp), %rsi
movq %rax, %rdi
callq 0x94b0
leaq 0x3a96a(%rip), %rsi     # 0x5836b
movq %rax, %rdi
callq 0x94b0
movq %rax, %rdi
callq 0x99e8
movq 0x120(%rbx), %rdi
testq %rdi, %rdi
je 0x1da4b
pushq $0x4a
popq %rsi
xorl %edx, %edx
callq 0x9530
andq $0x0, 0x18(%rbx)
leaq 0x58(%rbx), %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x1e72a
leaq 0xb8(%rbx), %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x1e7e4
movb $0x1, 0x8(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x94f0
movq %rbx, %rdi
callq 0x98b0