//
// LevelEditorLayer::findStartPosObject from 0x36889c to 0x36893c (160 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::onPlaytest @ 0x36eb18
//
// 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
//
StartPosObject *LevelEditorLayer::findStartPosObject(LevelEditorLayer *a1)
{
cocos2d::CCArray *m_objects; // r4
cocos2d::ccArray *data; // r3
cocos2d::CCObject **arr; // r7
char *v4; // r3
float v5; // s16
int v6; // r6
cocos2d::CCObject **v7; // r8
cocos2d::CCArray *v8; // r5
cocos2d::CCArray *v9; // t1
float *v10; // r0
int m_nTag; // r2
int v12; // r3
int v13; // r2
float v14; // s15
m_objects = a1->m_objects;
if ( m_objects )
{
data = m_objects->data;
m_objects = (cocos2d::CCArray *)data->num;
if ( data->num )
{
arr = data->arr;
v4 = (char *)&m_objects[19173961].m_uID + 3;
v5 = 0.0;
v6 = -1;
m_objects = nullptr;
v7 = &arr[(_DWORD)v4];
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
do
{
if ( arr <= v7 )
{
v9 = (cocos2d::CCArray *)*arr++;
v8 = v9;
if ( v9 )
continue;
}
return (StartPosObject *)m_objects;
}
while ( v8[15].m_uOrderOfArrival != 31 || *(_BYTE *)(v8[29].m_nTag + 311) );
v10 = (float *)((int (__fastcall *)(cocos2d::CCArray *))v8->__vftable[2].acceptVisitor)(v8);
m_nTag = v8[29].m_nTag;
v12 = *(_DWORD *)(m_nTag + 312);
v13 = *(unsigned __int8 *)(m_nTag + 310);
v14 = *v10;
if ( v12 <= v6 )
break;
LABEL_15:
v6 = v12;
v5 = *v10;
m_objects = v8;
}
if ( v14 > v5 )
break;
if ( v14 < v5 && v13 )
goto LABEL_14;
}
if ( !v13 || v14 < v5 )
{
LABEL_14:
if ( v12 >= v6 )
goto LABEL_15;
}
}
}
}
return (StartPosObject *)m_objects;
}