// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/TimeTest.cpp
// Function: TimeTest::~TimeTest()
TimeTest::~TimeTest() {
  if (mEventQueue.size() == 0 || mEventQueue.size() != mRecordQueue.size()) {
    return;
  }

  char *file_name = new char[256];
  std::ofstream out_file;
  TimeCost *pTimeCost;

  for (unsigned i = 0; i < mEventQueue.size(); ++i) {
    sprintf(file_name, "Test/TimeTest-%s-%d.txt", mEventQueue[i].data(), mUnum);
    out_file.open(file_name);
    if (out_file.good() == false) {
      PRINT_ERROR("open file error  " << file_name);
      continue;
    }

    out_file << mEventQueue[i].data() << std::endl;

    pTimeCost = &(mRecordQueue[i].mEachTime);
    out_file << std::endl << std::endl;
    out_file << "Time cost for each time: " << std::endl;
    out_file << "Num: " << pTimeCost->mNum << std::endl;
    out_file << "Ave: " << pTimeCost->mAveCost / 1000.0 << " ms" << std::endl;
    out_file << "Max: " << pTimeCost->mMaxCost / 1000.0 << " ms  "
             << pTimeCost->mMaxTime << std::endl;
    out_file << "Min: " << pTimeCost->mMinCost / 1000.0 << " ms  "
             << pTimeCost->mMinTime << std::endl;

    pTimeCost = &(mRecordQueue[i].mEachCycle);
    out_file << std::endl << std::endl;
    out_file << "Time cost for each cycle: " << std::endl;
    out_file << "Num: " << pTimeCost->mNum << std::endl;
    out_file << "Ave: " << pTimeCost->mAveCost / 1000.0 << " ms" << std::endl;
    out_file << "Max: " << pTimeCost->mMaxCost / 1000.0 << " ms  "
             << pTimeCost->mMaxTime << std::endl;
    out_file << "Min: " << pTimeCost->mMinCost / 1000.0 << " ms  "
             << pTimeCost->mMinTime << std::endl;

    out_file.close();
  }

  delete[] file_name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x420b0
cmpq $0x0, %rax
je 0x8edf7
movq -0x230(%rbp), %rdi
callq 0x420b0
movq -0x230(%rbp), %rdi
movq %rax, -0x238(%rbp)
addq $0x18, %rdi
callq 0x8ffd0
movq %rax, %rcx
movq -0x238(%rbp), %rax
cmpq %rcx, %rax
je 0x8ee03
movl $0x1, -0xc(%rbp)
jmp 0x8f562
movl $0x100, %edi            # imm = 0x100
callq 0xa050
movq %rax, -0x240(%rbp)
jmp 0x8ee16
movq -0x240(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq -0x218(%rbp), %rdi
callq 0xaa30
jmp 0x8ee2f
movl $0x0, -0x224(%rbp)
movq -0x230(%rbp), %rdi
movl -0x224(%rbp), %eax
movq %rax, -0x248(%rbp)
callq 0x420b0
movq %rax, %rcx
movq -0x248(%rbp), %rax
cmpq %rcx, %rax
jae 0x8f532
movq -0x230(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x250(%rbp)
movl -0x224(%rbp), %eax
movl %eax, %esi
callq 0x90000
movq %rax, %rdi
callq 0xa330
movq -0x250(%rbp), %rdi
movq %rax, %rdx
movq -0x230(%rbp), %rax
movl 0x88(%rax), %ecx
leaq 0x35df6(%rip), %rsi     # 0xc4ca0
xorl %eax, %eax
callq 0xa130
movq -0x18(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movl $0x10, %edx
callq 0xa090
jmp 0x8eec8
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0xaa20
movb %al, -0x251(%rbp)
jmp 0x8eee8
movb -0x251(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x8efbf
jmp 0x8eefe
movq 0x6f0eb(%rip), %rdi     # 0xfdff0
leaq 0x35dac(%rip), %rsi     # 0xc4cb8
callq 0xa5a0
movq %rax, -0x260(%rbp)
jmp 0x8ef1a
movq -0x260(%rbp), %rdi
leaq 0x36329(%rip), %rsi     # 0xc5251
callq 0xa5a0
movq %rax, -0x268(%rbp)
jmp 0x8ef36
movq -0x268(%rbp), %rdi
movl $0x41, %esi
callq 0xaa40
movq %rax, -0x270(%rbp)
jmp 0x8ef50
movq -0x270(%rbp), %rdi
leaq 0x34601(%rip), %rsi     # 0xc355f
callq 0xa5a0
movq %rax, -0x278(%rbp)
jmp 0x8ef6c
movq -0x278(%rbp), %rdi
leaq 0x35d52(%rip), %rsi     # 0xc4ccc
callq 0xa5a0
movq %rax, -0x280(%rbp)
jmp 0x8ef88
movq -0x280(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa5a0
movq %rax, -0x288(%rbp)
jmp 0x8efa1
movq -0x288(%rbp), %rdi
movq 0x6f001(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8efb6
jmp 0x8efb8
jmp 0x8efba
jmp 0x8f51e
movq -0x230(%rbp), %rdi
movl -0x224(%rbp), %eax
movl %eax, %esi
callq 0x90000
movq %rax, %rdi
callq 0xa330
movq %rax, %rsi
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x290(%rbp)
jmp 0x8eff3
movq -0x290(%rbp), %rdi
movq 0x6efaf(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f008
movq -0x230(%rbp), %rdi
addq $0x18, %rdi
movl -0x224(%rbp), %eax
movl %eax, %esi
callq 0x90020
addq $0x30, %rax
movq %rax, -0x220(%rbp)
movq 0x6ef7e(%rip), %rsi     # 0xfdfb0
leaq -0x218(%rbp), %rdi
callq 0xa630
movq %rax, -0x298(%rbp)
jmp 0x8f047
movq -0x298(%rbp), %rdi
movq 0x6ef5b(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f05c
leaq 0x35c7b(%rip), %rsi     # 0xc4cde
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x2a0(%rbp)
jmp 0x8f078
movq -0x2a0(%rbp), %rdi
movq 0x6ef2a(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f08d
leaq 0x35c64(%rip), %rsi     # 0xc4cf8
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x2a8(%rbp)
jmp 0x8f0a9
movq -0x2a8(%rbp), %rdi
movq -0x220(%rbp), %rax
movq (%rax), %rsi
callq 0xaaf0
movq %rax, -0x2b0(%rbp)
jmp 0x8f0c8
movq -0x2b0(%rbp), %rdi
movq 0x6eeda(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f0dd
leaq 0x35c1a(%rip), %rsi     # 0xc4cfe
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x2b8(%rbp)
jmp 0x8f0f9
movq -0x2b8(%rbp), %rdi
movq -0x220(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x335a4(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x2c0(%rbp)
jmp 0x8f126
movq -0x2c0(%rbp), %rdi
leaq 0x33d3e(%rip), %rsi     # 0xc2e72
callq 0xa5a0
movq %rax, -0x2c8(%rbp)
jmp 0x8f142
movq -0x2c8(%rbp), %rdi
movq 0x6ee60(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f157
leaq 0x35ba6(%rip), %rsi     # 0xc4d04
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x2d0(%rbp)
jmp 0x8f173
movq -0x2d0(%rbp), %rdi
movq -0x220(%rbp), %rax
cvtsi2sdq 0x18(%rax), %xmm0
movsd 0x33529(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x2d8(%rbp)
jmp 0x8f1a1
movq -0x2d8(%rbp), %rdi
leaq 0x35b5b(%rip), %rsi     # 0xc4d0a
callq 0xa5a0
movq %rax, -0x2e0(%rbp)
jmp 0x8f1bd
movq -0x2e0(%rbp), %rdi
movq -0x220(%rbp), %rsi
addq $0x10, %rsi
callq 0x11d40
movq %rax, -0x2e8(%rbp)
jmp 0x8f1dd
movq -0x2e8(%rbp), %rdi
movq 0x6edc5(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f1f2
leaq 0x35b17(%rip), %rsi     # 0xc4d10
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x2f0(%rbp)
jmp 0x8f20e
movq -0x2f0(%rbp), %rdi
movq -0x220(%rbp), %rax
cvtsi2sdq 0x28(%rax), %xmm0
movsd 0x3348e(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x2f8(%rbp)
jmp 0x8f23c
movq -0x2f8(%rbp), %rdi
leaq 0x35ac0(%rip), %rsi     # 0xc4d0a
callq 0xa5a0
movq %rax, -0x300(%rbp)
jmp 0x8f258
movq -0x300(%rbp), %rdi
movq -0x220(%rbp), %rsi
addq $0x20, %rsi
callq 0x11d40
movq %rax, -0x308(%rbp)
jmp 0x8f278
movq -0x308(%rbp), %rdi
movq 0x6ed2a(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f28d
movq -0x230(%rbp), %rdi
addq $0x18, %rdi
movl -0x224(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq %rax, -0x220(%rbp)
movq 0x6ecfd(%rip), %rsi     # 0xfdfb0
leaq -0x218(%rbp), %rdi
callq 0xa630
movq %rax, -0x310(%rbp)
jmp 0x8f2c8
movq -0x310(%rbp), %rdi
movq 0x6ecda(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f2dd
leaq 0x35a32(%rip), %rsi     # 0xc4d16
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x318(%rbp)
jmp 0x8f2f9
movq -0x318(%rbp), %rdi
movq 0x6eca9(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f30e
leaq 0x359e3(%rip), %rsi     # 0xc4cf8
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x320(%rbp)
jmp 0x8f32a
movq -0x320(%rbp), %rdi
movq -0x220(%rbp), %rax
movq (%rax), %rsi
callq 0xaaf0
movq %rax, -0x328(%rbp)
jmp 0x8f349
movq -0x328(%rbp), %rdi
movq 0x6ec59(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f35e
leaq 0x35999(%rip), %rsi     # 0xc4cfe
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x330(%rbp)
jmp 0x8f37a
movq -0x330(%rbp), %rdi
movq -0x220(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x33323(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x338(%rbp)
jmp 0x8f3a7
movq -0x338(%rbp), %rdi
leaq 0x33abd(%rip), %rsi     # 0xc2e72
callq 0xa5a0
movq %rax, -0x340(%rbp)
jmp 0x8f3c3
movq -0x340(%rbp), %rdi
movq 0x6ebdf(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f3d8
leaq 0x35925(%rip), %rsi     # 0xc4d04
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x348(%rbp)
jmp 0x8f3f4
movq -0x348(%rbp), %rdi
movq -0x220(%rbp), %rax
cvtsi2sdq 0x18(%rax), %xmm0
movsd 0x332a8(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x350(%rbp)
jmp 0x8f422
movq -0x350(%rbp), %rdi
leaq 0x358da(%rip), %rsi     # 0xc4d0a
callq 0xa5a0
movq %rax, -0x358(%rbp)
jmp 0x8f43e
movq -0x358(%rbp), %rdi
movq -0x220(%rbp), %rsi
addq $0x10, %rsi
callq 0x11d40
movq %rax, -0x360(%rbp)
jmp 0x8f45e
movq -0x360(%rbp), %rdi
movq 0x6eb44(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f473
leaq 0x35896(%rip), %rsi     # 0xc4d10
leaq -0x218(%rbp), %rdi
callq 0xa5a0
movq %rax, -0x368(%rbp)
jmp 0x8f48f
movq -0x368(%rbp), %rdi
movq -0x220(%rbp), %rax
cvtsi2sdq 0x28(%rax), %xmm0
movsd 0x3320d(%rip), %xmm1    # 0xc26b8
divsd %xmm1, %xmm0
callq 0xab60
movq %rax, -0x370(%rbp)
jmp 0x8f4bd
movq -0x370(%rbp), %rdi
leaq 0x3583f(%rip), %rsi     # 0xc4d0a
callq 0xa5a0
movq %rax, -0x378(%rbp)
jmp 0x8f4d9
movq -0x378(%rbp), %rdi
movq -0x220(%rbp), %rsi
addq $0x20, %rsi
callq 0x11d40
movq %rax, -0x380(%rbp)
jmp 0x8f4f9
movq -0x380(%rbp), %rdi
movq 0x6eaa9(%rip), %rsi     # 0xfdfb0
callq 0xa630
jmp 0x8f50e
leaq -0x218(%rbp), %rdi
callq 0xa880
jmp 0x8f51c
jmp 0x8f51e
movl -0x224(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x224(%rbp)
jmp 0x8ee39
movq -0x18(%rbp), %rax
movq %rax, -0x388(%rbp)
cmpq $0x0, %rax
je 0x8f54f
movq -0x388(%rbp), %rdi
callq 0xa7b0
leaq -0x218(%rbp), %rdi
callq 0xa8c0
movl $0x0, -0xc(%rbp)
movq -0x230(%rbp), %rdi
addq $0x58, %rdi
callq 0x8ff50
movq -0x230(%rbp), %rdi
addq $0x30, %rdi
callq 0x8ff50
movq -0x230(%rbp), %rdi
addq $0x18, %rdi
callq 0x8ff70
movq -0x230(%rbp), %rdi
callq 0x40100
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
movq %rax, %rdi
callq 0x12860
nop