//
// cocos2d::CCProfilingBeginTimingBlock from 0xd8f88c to 0xd8f9d4 (328 bytes)
//
// 1 xrefs:
// > ??> @ 0xfe500
//
// This function is hookable on this platform (idp: arm, 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 13:08:18 +0000
//
__int64 __fastcall cocos2d::CCProfilingBeginTimingBlock(cocos2d *this, const char *a2)
{
cocos2d::CCProfiler *v3; // x24
size_t v4; // x0
size_t v5; // x19
__int64 v6; // x25
char *v7; // x3
__int64 v8; // x19
unsigned __int64 v10; // x0
__int64 v11; // [xsp+50h] [xbp+50h] BYREF
size_t v12; // [xsp+58h] [xbp+58h]
void *v13; // [xsp+60h] [xbp+60h]
v3 = (cocos2d::CCProfiler *)cocos2d::CCProfiler::sharedProfiler(_stack_chk_guard);
v11 = 0;
v12 = 0;
v13 = nullptr;
v4 = strlen((const char *)this);
v5 = v4;
v6 = *((_QWORD *)v3 + 7);
if ( v4 > 0x16 )
{
v10 = (v4 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = v10 | 1;
v7 = (char *)operator new(v10);
v13 = v7;
v12 = v5;
}
else
{
LOBYTE(v11) = 2 * v4;
v7 = (char *)&v11 + 1;
if ( !v4 )
{
BYTE1(v11) = 0;
v8 = cocos2d::CCDictionary::objectForKey(v6, (__int64)&v11);
if ( (v11 & 1) == 0 )
goto LABEL_4;
LABEL_8:
operator delete(v13);
if ( v8 )
goto LABEL_5;
LABEL_9:
v8 = (__int64)cocos2d::CCProfiler::createAndAddTimerWithName(v3, (const char *)this);
goto LABEL_5;
}
}
*((_BYTE *)memcpy(v7, this, v5) + v5) = 0;
v8 = cocos2d::CCDictionary::objectForKey(v6, (__int64)&v11);
if ( (v11 & 1) != 0 )
goto LABEL_8;
LABEL_4:
if ( !v8 )
goto LABEL_9;
LABEL_5:
++*(_DWORD *)(v8 + 80);
gettimeofday((struct timeval *)(v8 + 112), nullptr);
return _stack_chk_guard;
}