//
// cocos2d::CCProfiler::createAndAddTimerWithName from 0xd8f76c to 0xd8f88c (288 bytes)
//
// 2 xrefs:
// > cocos2d::CCProfilingBeginTimingBlock @ 0xd8f9c4
// > ??> @ 0x60928
//
// 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
//
cocos2d::CCProfilingTimer *__fastcall cocos2d::CCProfiler::createAndAddTimerWithName(
cocos2d::CCProfiler *this,
const char *a2)
{
cocos2d::CCProfilingTimer *v4; // x21
size_t v5; // x0
size_t v6; // x19
__int64 v7; // x25
char *v8; // x3
unsigned __int64 v10; // x0
__int64 v11; // [xsp+50h] [xbp+50h] BYREF
size_t v12; // [xsp+58h] [xbp+58h]
void *v13; // [xsp+60h] [xbp+60h]
v4 = (cocos2d::CCProfilingTimer *)operator new(0x80u);
cocos2d::CCProfilingTimer::CCProfilingTimer(v4);
cocos2d::CCProfilingTimer::initWithName(v4, a2);
v11 = 0;
v12 = 0;
v13 = nullptr;
v5 = strlen(a2);
v6 = v5;
v7 = *((_QWORD *)this + 7);
if ( v5 > 0x16 )
{
v10 = (v5 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v11 = v10 | 1;
v8 = (char *)operator new(v10);
v13 = v8;
v12 = v6;
}
else
{
LOBYTE(v11) = 2 * v5;
v8 = (char *)&v11 + 1;
if ( !v5 )
goto LABEL_3;
}
v8 = (char *)memcpy(v8, a2, v6);
LABEL_3:
v8[v6] = 0;
cocos2d::CCDictionary::setObject(v7, v4, (__int64)&v11);
if ( (v11 & 1) != 0 )
operator delete(v13);
cocos2d::CCObject::release(v4);
return v4;
}