//
// PlayLayer::createObjectsFromSetupFinished from 0x6fdc18 to 0x6fdf1c (772 bytes)
//
// 2 xrefs:
// > PlayLayer::processCreateObjectsFromSetup @ 0x708d38
// > ??> @ 0x7bc10
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:52:00 +0000
//
__int64 __fastcall PlayLayer::createObjectsFromSetupFinished(PlayLayer *this, __int64 a2, GJBaseGameLayer *a3)
{
cocos2d::CCArray *v4; // x0
int v5; // w20
unsigned int v6; // w1
EnhancedGameObject *v7; // x0
char *v8; // x22
__int64 v9; // x20
__int64 i; // x0
__int64 v11; // x0
__int64 v12; // x3
__int64 v13; // x2
unsigned __int64 v14; // x1
unsigned __int64 v15; // x0
__int64 v16; // x3
__int64 v17; // x2
__int64 v18; // x3
unsigned __int64 v19; // x4
bool v20; // cc
__int64 v21; // x2
cocos2d::CCDirector *v23; // x0
cocos2d::CCDirector *ScreenRight; // x0
float v25; // s0
float v26; // s1
__int64 v27; // x23
void (__fastcall *v28)(__int64, __int64 *); // x20
_BYTE *v29; // x1
__int64 v30; // x0
char v31; // w3
char v32; // w2
__int64 v33; // x0
cocos2d::CCDirector *v34; // x0
float v35; // s0
__int64 v36; // [xsp+50h] [xbp+50h] BYREF
v4 = *((cocos2d::CCArray **)this + 1757);
if ( v4 && (unsigned int)cocos2d::CCArray::count(v4) )
{
v5 = 0;
qsort(
*(void **)(*(_QWORD *)(*((_QWORD *)this + 1757) + 56LL) + 16LL),
**(unsigned int **)(*((_QWORD *)this + 1757) + 56LL),
8u,
(int (*)(const void *, const void *))xCompRealPos);
while ( v5 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1757)) && v5 <= 2 )
{
v6 = v5++;
v7 = (EnhancedGameObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 1757), v6);
*((_DWORD *)v7 + 448) = v5;
EnhancedGameObject::updateUserCoin(v7);
}
}
if ( *((_BYTE *)this + 12238) )
{
v8 = (char *)this + 12288;
}
else
{
v23 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)*((unsigned __int8 *)this
+ 12238));
ScreenRight = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v23);
v26 = *((float *)this + 3580) + 340.0;
if ( (float)(v25 + 300.0) >= v26 )
{
v34 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenRight);
ScreenRight = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v34);
v26 = v35 + 300.0;
}
*((float *)this + 3150) = v26;
*((float *)this + 3559) = v26;
v27 = EndPortalObject::create(ScreenRight);
*((_QWORD *)this + 1576) = v27;
v8 = (char *)this + 12288;
v28 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v27 + 1368LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, *((float *)this + 3150), 225.0);
v28(v27, &v36);
*(_DWORD *)(*((_QWORD *)this + 1576) + 1048LL) = 11;
(*(void (__fastcall **)(PlayLayer *, _QWORD))(*(_QWORD *)this + 1344LL))(this, *((_QWORD *)this + 1576));
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 410), *((cocos2d::CCObject **)this + 1576));
v29 = *((_BYTE **)this + 407);
v30 = *((_QWORD *)this + 1576);
v31 = v29[2603];
v32 = v29[2604];
LOBYTE(v36) = v29[2602];
BYTE1(v36) = v31;
BYTE2(v36) = v32;
EndPortalObject::updateColors(v30, v36);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 1576) + 344LL))(*((_QWORD *)this + 1576), 0);
v33 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 1576) + 192LL))(*((_QWORD *)this + 1576));
cocos2d::CCPoint::operator=((char *)this + 14884, v33);
}
LevelTools::sortSpeedObjects(*((LevelTools **)this + 1782), this, a3);
GJBaseGameLayer::orderSpawnObjects(this);
GJBaseGameLayer::updateMaxGameplayY(this);
v9 = *((_QWORD *)this + 1754);
for ( i = *((_QWORD *)this + 1755); i != v9; i = *((_QWORD *)this + 1755) )
{
v11 = i - 24;
*((_QWORD *)this + 1755) = v11;
std::string::~string(v11);
}
cocos2d::CCArray::removeAllObjects(*((cocos2d::CCArray **)this + 1757));
cocos2d::CCObject::release(*((cocos2d::CCObject **)this + 1757));
*((_QWORD *)this + 1757) = 0;
v12 = *((_QWORD *)this + 1849);
v13 = *((_QWORD *)this + 1850);
LODWORD(v15) = *((_DWORD *)this + 3716) + 1;
*((_DWORD *)this + 3716) = v15;
v14 = 0xAAAAAAAAAAAAAAABLL * (v13 - v12);
v15 = (int)v15;
if ( (int)v15 <= v14 )
{
if ( (int)v15 < v14 )
{
v16 = v12 + 3LL * (int)v15;
if ( v13 != v16 )
*((_QWORD *)this + 1850) = v16;
}
v17 = *((_QWORD *)this + 1852);
v18 = *((_QWORD *)this + 1853);
v19 = (v18 - v17) >> 2;
v20 = v19 > (int)v15;
if ( v19 >= (int)v15 )
goto LABEL_16;
LABEL_25:
std::vector::__append((__int64)(v8 + 2528), v15 - v19);
v15 = *((int *)this + 3716);
goto LABEL_20;
}
std::vector::__append((_QWORD *)v8 + 313, (int)v15 - v14);
v17 = *((_QWORD *)this + 1852);
v18 = *((_QWORD *)this + 1853);
v15 = *((int *)this + 3716);
v19 = (v18 - v17) >> 2;
v20 = v19 > v15;
if ( v19 < v15 )
goto LABEL_25;
LABEL_16:
if ( v20 )
{
v21 = v17 + 4 * v15;
if ( v18 != v21 )
*((_QWORD *)this + 1853) = v18 + 4 * ~((unsigned __int64)(v18 - 4 - v21) >> 2);
}
LABEL_20:
std::vector>::resize((_QWORD *)v8 + 319, (v15 >> 5) + 1);
return _stack_chk_guard;
}