// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/TimeTest.cpp
// Function: TimeTest::Update(Time)
void TimeTest::Update(Time current_time) {
  if (PlayerParam::instance().TimeTest()) {
    if (mUpdateTime == current_time) {
      return;
    }

    long last_num = 0;
    double last_ave_cost = 0;
    long cycle_time_cost = 0;
    for (unsigned i = 0; i < mEventQueue.size(); ++i) {
      if (mIsExecute[i] == false) {
        continue;
      }

      last_num = mRecordQueue[i].mEachCycle.mNum;
      last_ave_cost = mRecordQueue[i].mEachCycle.mAveCost;
      cycle_time_cost = mRecordQueue[i].mCycleTimeCost;

      if (cycle_time_cost > mRecordQueue[i].mEachCycle.mMaxCost) {
        mRecordQueue[i].mEachCycle.mMaxCost = cycle_time_cost;
        mRecordQueue[i].mEachCycle.mMaxTime = mUpdateTime;
      }
      if (cycle_time_cost < mRecordQueue[i].mEachCycle.mMinCost) {
        mRecordQueue[i].mEachCycle.mMinCost = cycle_time_cost;
        mRecordQueue[i].mEachCycle.mMinTime = mUpdateTime;
      }

      mRecordQueue[i].mEachCycle.mAveCost =
          (last_ave_cost * last_num + cycle_time_cost) / (last_num + 1);
      ++mRecordQueue[i].mEachCycle.mNum;
      mRecordQueue[i].mCycleTimeCost = 0;
      mIsExecute[i] = false;
    }

    mUpdateTime = current_time;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x90040
testb $0x1, (%rax)
je 0x8f8ed
movq -0x58(%rbp), %rdi
addq $0x80, %rdi
leaq -0x8(%rbp), %rsi
callq 0x120a0
testb $0x1, %al
jne 0x8f68b
jmp 0x8f690
jmp 0x8f8ed
movq $0x0, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %eax
movq %rax, -0x60(%rbp)
callq 0x420b0
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x8f8de
movq -0x58(%rbp), %rdi
addq $0x30, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90060
movq %rax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x900c0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x8f701
jmp 0x8f8d0
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x18(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rdi
movsd 0x8(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rdi
movq 0x70(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq 0x18(%rcx), %rax
jle 0x8f7ba
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x70(%rbp), %rcx
movq -0x58(%rbp), %rdi
movq %rcx, 0x18(%rax)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rcx
movq 0x80(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq 0x28(%rcx), %rax
jge 0x8f824
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x80(%rbp), %rcx
movq -0x58(%rbp), %rdi
movq %rcx, 0x28(%rax)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rcx
movq 0x80(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq -0x58(%rbp), %rdi
movsd -0x20(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm2
cvtsi2sdq -0x28(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
addq $0x1, %rax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movsd -0x88(%rbp), %xmm0
movq -0x58(%rbp), %rdi
movsd %xmm0, 0x8(%rax)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rdi
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x18, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90020
movq -0x58(%rbp), %rdi
movq $0x0, 0x70(%rax)
addq $0x30, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x90060
movq %rax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x900f0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8f6af
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rcx
movq %rcx, 0x80(%rax)
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)