//
// cocos2d::CCProfiler::createAndAddTimerWithName from 0x180097e50 to 0x180097f7a (298 bytes)
//
// 3 xrefs:
// > cocos2d::CCProfilingBeginTimingBlock @ 0x180097bf9
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c09b4
//
// 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=2
struct cocos2d::CCProfilingTimer *__fastcall cocos2d::CCProfiler::createAndAddTimerWithName(
cocos2d::CCProfiler *this,
char *a2)
{
cocos2d::CCObject *v4; // rax
cocos2d::CCObject *v5; // rbx
size_t v6; // rax
void *v7; // rcx
void *Block[3]; // [rsp+38h] [rbp-40h] BYREF
unsigned __int64 v10; // [rsp+50h] [rbp-28h]
v4 = (cocos2d::CCObject *)sub_1800E4AC0(0x80u);
v5 = v4;
if ( v4 )
{
cocos2d::CCObject::CCObject(v4);
*(_QWORD *)v5 = &cocos2d::CCProfilingTimer::`vftable';
*(_OWORD *)((char *)v5 + 56) = 0;
*((_QWORD *)v5 + 9) = 0;
*((_QWORD *)v5 + 10) = 15;
*((_BYTE *)v5 + 56) = 0;
*((_QWORD *)v5 + 11) = 0;
*((_DWORD *)v5 + 24) = 0;
*((_QWORD *)v5 + 13) = 0;
*((_QWORD *)v5 + 14) = 100000000;
}
else
{
v5 = nullptr;
}
v6 = strlen(a2);
sub_1800101E0((void **)v5 + 7, a2, v6);
sub_180005A10(Block, a2);
cocos2d::CCDictionary::setObject(*((_QWORD *)this + 7), v5, (__int64)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 )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v7);
}
cocos2d::CCObject::release(v5);
return v5;
}