//
// LevelEditorLayer::findGameObject from 0x65d550 to 0x65d5c8 (120 bytes)
//
// 2 xrefs:
// > EditorUI::findAndSelectObject @ 0x6be64c
// > ??> @ 0x66648
//
// 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 *LevelEditorLayer::findGameObject(LevelEditorLayer *a1, int a2)
{
cocos2d::CCArray *m_objects; // x0
cocos2d::ccArray *data; // x2
unsigned int num; // w0
GameObject **arr; // x2
__int64 v6; // x4
GameObject *result; // x0
GameObject **v8; // x4
GameObject *v9; // x3
m_objects = a1->m_objects;
if ( !m_objects )
return nullptr;
data = m_objects->data;
num = data->num;
if ( !data->num )
return nullptr;
arr = (GameObject **)data->arr;
v6 = 8LL * num - 8;
result = nullptr;
v8 = (GameObject **)((char *)arr + v6);
if ( arr <= v8 )
{
v9 = *arr;
if ( *arr )
{
if ( v9->m_uniqueID == a2 )
return v9;
while ( v8 >= ++arr )
{
v9 = *arr;
if ( !*arr )
break;
if ( a2 == v9->m_uniqueID )
return v9;
}
return nullptr;
}
}
return result;
}