//
// GJBaseGameLayer::tryGetGroupParent from 0x10013d5c0 to 0x10013d687 (199 bytes)
//
// 0 xrefs:
//
// 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::tryGetGroupParent(GJBaseGameLayer *a1, int a2)
{
cocos2d::CCDictionary *m_parentGroupsDict; // rdi
GameObject *result; // rax
int v5; // eax
intptr_t v6; // r14
cocos2d::CCArray *v7; // r15
cocos2d::ccArray *data; // rax
GameObject **arr; // rcx
unsigned __int64 v10; // rdx
m_parentGroupsDict = a1->m_parentGroupsDict;
result = (GameObject *)cocos2d::CCDictionary::objectForKey(m_parentGroupsDict, a2);
if ( !result )
{
v5 = 9999;
if ( a2 < 9999 )
v5 = a2;
v6 = 0;
if ( v5 > 0 )
v6 = (unsigned int)v5;
v7 = a1->m_groups.__begin_[v6];
if ( v7
|| (v7 = (cocos2d::CCArray *)sub_10071F9E0(m_parentGroupsDict, a2),
cocos2d::CCDictionary::setObject(a1->m_groupDict, v7, v6),
(a1->m_groups.__begin_[v6] = v7) != nullptr) )
{
data = v7->data;
if ( data->num )
{
arr = (GameObject **)data->arr;
v10 = (unsigned __int64)&arr[data->num - 1];
do
{
result = *arr;
if ( !*arr )
break;
if ( result->m_hasGroupParent )
return result;
++arr;
}
while ( (unsigned __int64)arr <= v10 );
}
}
return nullptr;
}
return result;
}