//
// GJBaseGameLayer::tryGetObject from 0x1001235f0 to 0x10012372d (317 bytes)
//
// 28 xrefs:
// > EditorUI::findAndSelectObject @ 0x10003340d
// > GJBaseGameLayer::resetPlayer @ 0x100123595
// > GJBaseGameLayer::getMoveTargetDelta @ 0x10012b9af
// > GJBaseGameLayer::getMoveTargetDelta @ 0x10012bb12
// > GJBaseGameLayer::triggerMoveCommand @ 0x1001379b6
// > GJBaseGameLayer::triggerMoveCommand @ 0x100137ab9
// > GJBaseGameLayer::triggerDynamicMoveCommand @ 0x100137bf9
// > GJBaseGameLayer::triggerDynamicMoveCommand @ 0x100137c3e
// > GJBaseGameLayer::getRotateCommandTargets @ 0x100138001
// > GJBaseGameLayer::getRotateCommandTargets @ 0x100138014
// > GJBaseGameLayer::getRotateCommandTargets @ 0x100138057
// > GJBaseGameLayer::triggerRotateCommand @ 0x1001384f3
// > GJBaseGameLayer::triggerRotateCommand @ 0x100138504
// > GJBaseGameLayer::triggerRotateCommand @ 0x100138548
// > GJBaseGameLayer::triggerRotateCommand @ 0x100138578
// > GJBaseGameLayer::triggerRotateCommand @ 0x10013858a
// > GJBaseGameLayer::triggerRotateCommand @ 0x10013859c
// > GJBaseGameLayer::triggerRotateCommand @ 0x1001385ae
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x10013866b
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x10013867d
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x1001386be
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x1001386f0
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x100138703
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x100138716
// > GJBaseGameLayer::triggerDynamicRotateCommand @ 0x100138729
// > GJBaseGameLayer::getFollowSpeedVal @ 0x100147c61
// > GJBaseGameLayer::getFollowSpeedVal @ 0x100147cb2
// > GJBaseGameLayer::spawnParticleTrigger_1 @ 0x10015ca9f
//
// 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
//
// local variable allocation has failed, the output may be wrong!
GameObject *__fastcall GJBaseGameLayer::tryGetObject(GJBaseGameLayer *a1, int a2)
{
__m128 v2; // xmm0
cocos2d::CCDictionary *m_parentGroupsDict; // rdi
GameObject *result; // rax
intptr_t v6; // r14
cocos2d::CCArray *v7; // r15
cocos2d::CCDictionary *m_groupDict; // rdi
std::__vector_base::pointer begin; // rax
cocos2d::CCArray *v10; // r15
int v11; // eax
if ( a2 <= 0 )
return nullptr;
m_parentGroupsDict = a1->m_parentGroupsDict;
*(_QWORD *)&a2 = (unsigned int)a2;
result = (GameObject *)cocos2d::CCDictionary::objectForKey(m_parentGroupsDict, (unsigned int)a2);
if ( !result )
{
v6 = 9999;
if ( (unsigned int)a2 < 0x270F )
v6 = (unsigned int)a2;
v7 = a1->m_groups.__begin_[v6];
if ( !v7 )
{
v7 = (cocos2d::CCArray *)sub_10071F9E0(m_parentGroupsDict, (unsigned int)a2);
m_groupDict = a1->m_groupDict;
*(_QWORD *)&a2 = v7;
cocos2d::CCDictionary::setObject(m_groupDict, v7, v6);
a1->m_groups.__begin_[v6] = v7;
if ( !v7 )
goto LABEL_9;
}
m_groupDict = (cocos2d::CCDictionary *)v7;
if ( (unsigned int)sub_100720070(v7) != 1
|| (m_groupDict = (cocos2d::CCDictionary *)v7,
*(_QWORD *)&a2 = 0,
(result = (GameObject *)sub_1007200C0(v7, 0)) == nullptr) )
{
LABEL_9:
begin = a1->m_groups.__begin_;
v10 = begin[v6];
if ( v10 )
{
if ( (unsigned int)sub_100720070(begin[v6]) )
{
LABEL_11:
v2.f32[0] = GameToolbox::fast_rand_0_1();
v11 = sub_100720070(v10);
return (GameObject *)sub_1007200C0(
v10,
(unsigned int)(int)(float)((float)v11
* _mm_andnot_ps(_mm_cmpeq_ss((__m128)0x3F800000u, v2), v2).f32[0]));
}
}
else
{
v10 = (cocos2d::CCArray *)sub_10071F9E0(m_groupDict, *(_QWORD *)&a2);
cocos2d::CCDictionary::setObject(a1->m_groupDict, v10, v6);
a1->m_groups.__begin_[v6] = v10;
if ( (unsigned int)sub_100720070(v10) )
goto LABEL_11;
}
return nullptr;
}
}
return result;
}