//
// GJBaseGameLayer::tryGetMainObject from 0x10012a6c0 to 0x10012a764 (164 bytes)
//
// 2 xrefs:
// > PlayLayer::activatePlatformerEndTrigger @ 0x1000b64c8
// > PlayLayer::processCheckpoints @ 0x1000bacac
//
// 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
//
GameObject *__fastcall GJBaseGameLayer::tryGetMainObject(GJBaseGameLayer *a1, int a2)
{
cocos2d::CCDictionary *m_parentGroupsDict; // rdi
GameObject *result; // rax
intptr_t v5; // r15
cocos2d::CCArray *v6; // r14
if ( a2 <= 0 )
return nullptr;
m_parentGroupsDict = a1->m_parentGroupsDict;
result = (GameObject *)cocos2d::CCDictionary::objectForKey(m_parentGroupsDict, (unsigned int)a2);
if ( result )
return result;
v5 = 9999;
if ( (unsigned int)a2 < 0x270F )
v5 = (unsigned int)a2;
if ( ((v6 = a1->m_groups.__begin_[v5]) != nullptr
|| (v6 = (cocos2d::CCArray *)sub_10071F9E0(m_parentGroupsDict, (unsigned int)a2),
cocos2d::CCDictionary::setObject(a1->m_groupDict, v6, v5),
(a1->m_groups.__begin_[v5] = v6) != nullptr))
&& (unsigned int)sub_100720070(v6) == 1 )
{
return (GameObject *)sub_1007200C0(v6, 0);
}
else
{
return nullptr;
}
}