//
// cocos2d::CCProfilingEndTimingBlock from 0x180097c30 to 0x180097d64 (308 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c099c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:22:10 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCProfilingEndTimingBlock(cocos2d *this, const char *a2, struct cocos2d::timezone *a3)
{
struct cocos2d::CCProfiler *v4; // rbx
__int64 v5; // rbx
void *v6; // r8
int v7; // r8d
int v8; // eax
int v9; // eax
_DWORD v10[2]; // [rsp+30h] [rbp-38h] BYREF
void *Block[2]; // [rsp+38h] [rbp-30h] BYREF
__m128i si128; // [rsp+48h] [rbp-20h]
cocos2d::gettimeofday((cocos2d *)v10, nullptr, a3);
v4 = cocos2d::CCProfiler::sharedProfiler();
sub_180005A10(Block, (char *)this);
v5 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)v4 + 7), (__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v6);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(Block[0]) = 0;
v7 = v10[1] + 1000000 * (v10[0] - *(_DWORD *)(v5 + 120)) - *(_DWORD *)(v5 + 124);
*(_QWORD *)(v5 + 104) += v7;
*(_DWORD *)(v5 + 92) = (int)(float)((float)(v7 + *(_DWORD *)(v5 + 92)) * 0.5);
*(_DWORD *)(v5 + 96) = *(_QWORD *)(v5 + 104) / *(int *)(v5 + 88);
v8 = *(_DWORD *)(v5 + 116);
if ( v8 <= v7 )
v8 = v7;
*(_DWORD *)(v5 + 116) = v8;
v9 = *(_DWORD *)(v5 + 112);
if ( v9 >= v7 )
v9 = v7;
*(_DWORD *)(v5 + 112) = v9;
}