// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/TimeTest.cpp
// Function: TimeTest::End(int)
void TimeTest::End(int event_id) {
  if (PlayerParam::instance().TimeTest()) {
    RealTime end_time = GetRealTime();
    long cost_time = end_time.Sub(mRecordQueue[event_id].mBeginTime);
    long last_num = mRecordQueue[event_id].mEachTime.mNum;
    double last_ave_cost = mRecordQueue[event_id].mEachTime.mAveCost;
    if (cost_time > mRecordQueue[event_id].mEachTime.mMaxCost) {
      mRecordQueue[event_id].mEachTime.mMaxCost = cost_time;
      mRecordQueue[event_id].mEachTime.mMaxTime = mUpdateTime;
    }
    if (cost_time < mRecordQueue[event_id].mEachTime.mMinCost) {
      mRecordQueue[event_id].mEachTime.mMinCost = cost_time;
      mRecordQueue[event_id].mEachTime.mMinTime = mUpdateTime;
    }

    mRecordQueue[event_id].mEachTime.mAveCost =
        (last_ave_cost * last_num + cost_time) / (last_num + 1);
    ++mRecordQueue[event_id].mEachTime.mNum;
    mRecordQueue[event_id].mCycleTimeCost += cost_time;
    mIsExecute[event_id] = true;
    mIsBegin[event_id] = false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x798a0
movq %rax, %rdi
callq 0x90040
testb $0x1, (%rax)
je 0x8fd80
callq 0x9e560
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x781c0
movq -0x70(%rbp), %rdi
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq %rax, %rsi
addq $0x60, %rsi
leaq -0x20(%rbp), %rdi
callq 0x9e9c0
movq -0x70(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x70(%rbp), %rdi
movq 0x30(%rax), %rax
movq %rax, -0x40(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x70(%rbp), %rdi
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq 0x48(%rcx), %rax
jle 0x8fc2a
movq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x80(%rbp), %rcx
movq -0x70(%rbp), %rdi
movq %rcx, 0x48(%rax)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x70(%rbp), %rcx
movq 0x80(%rcx), %rcx
movq %rcx, 0x40(%rax)
movq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq 0x58(%rcx), %rax
jge 0x8fc9d
movq -0x70(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, -0x90(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x90(%rbp), %rcx
movq -0x70(%rbp), %rdi
movq %rcx, 0x58(%rax)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x70(%rbp), %rcx
movq 0x80(%rcx), %rcx
movq %rcx, 0x50(%rax)
movq -0x70(%rbp), %rdi
movsd -0x48(%rbp), %xmm0
cvtsi2sdq -0x40(%rbp), %xmm2
cvtsi2sdq -0x38(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
addq $0x1, %rax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movsd -0xa0(%rbp), %xmm0
movq -0x70(%rbp), %rdi
movsd %xmm0, 0x38(%rax)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x70(%rbp), %rdi
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x98(%rbp)
addq $0x18, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90020
movq -0x98(%rbp), %rcx
movq -0x70(%rbp), %rdi
addq 0x70(%rax), %rcx
movq %rcx, 0x70(%rax)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90060
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x900f0
movq -0x70(%rbp), %rdi
addq $0x58, %rdi
movslq -0xc(%rbp), %rsi
callq 0x90060
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
callq 0x900f0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)