//
// cocos2d::CCProfiler::createAndAddTimerWithName from 0x180094700 to 0x180094822 (290 bytes)
//
// 3 xrefs:
// > cocos2d::CCProfilingBeginTimingBlock @ 0x1800944d6
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6714
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=2
struct cocos2d::CCProfilingTimer *__fastcall cocos2d::CCProfiler::createAndAddTimerWithName(
cocos2d::CCProfiler *this,
char *a2)
{
cocos2d::CCObject *v4; // rax
cocos2d::CCObject *v5; // rbx
size_t v6; // r8
void *v7; // rcx
void *Block[3]; // [rsp+28h] [rbp-30h] BYREF
unsigned __int64 v10; // [rsp+40h] [rbp-18h]
v4 = (cocos2d::CCObject *)operator new(0x80u);
v5 = v4;
if ( v4 )
{
cocos2d::CCObject::CCObject(v4);
v5->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCProfilingTimer::`vftable';
*(_OWORD *)&v5[1].__vftable = 0;
*(_QWORD *)&v5[1].m_nTag = 0;
*(_QWORD *)&v5[1].m_uAutoReleaseCount = 15;
LOBYTE(v5[1].__vftable) = 0;
*(_QWORD *)&v5[1].m_uIndexInArray = 0;
v5[1].m_unknown2 = 0;
*(_QWORD *)&v5[1].m_uOrderOfArrival = 0;
v5[2].__vftable = (cocos2d::CCObject_vtbl *)100000000;
}
else
{
v5 = nullptr;
}
v6 = -1;
do
++v6;
while ( a2[v6] );
sub_180010050((void **)&v5[1].__vftable, a2, v6);
sub_180005910(Block, a2);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 7), v5, (unsigned __int8 *)Block);
if ( v10 > 0xF )
{
v7 = Block[0];
if ( v10 + 1 >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v7);
}
cocos2d::CCObject::release(v5);
return (struct cocos2d::CCProfilingTimer *)v5;
}