//
// PlayLayer::processCreateObjectsFromSetup from 0x7085c8 to 0x708e0c (2116 bytes)
//
// 3 xrefs:
// > PlayLayer::init @ 0x7125c8
// > LevelInfoLayer::loadLevelStep @ 0x7e50dc
// > ??> @ 0xbd268
//
// 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:07 +0000
//
__int64 __fastcall PlayLayer::processCreateObjectsFromSetup(PlayLayer *this)
{
GJBaseGameLayer *v2; // x2
__int64 v3; // x24
unsigned __int64 v4; // x22
float v5; // s0
float v6; // s1
unsigned int v7; // w0
signed int v8; // w21
__int64 v9; // x20
int v10; // w25
unsigned __int8 *v11; // x20
__int64 i; // x0
int v13; // w0
size_t v14; // x23
unsigned __int8 *v15; // x21
__int64 v16; // x21
int v17; // w24
int v18; // w22
unsigned __int64 v19; // x26
unsigned __int64 v20; // x2
unsigned __int8 *v21; // x21
unsigned __int64 v22; // x2
size_t v23; // x3
char *v24; // x26
__int64 v25; // x1
size_t v26; // x2
_BYTE *v27; // x0
char *v28; // x26
int v29; // w0
GameObject *v30; // x0
GameObject *v31; // x22
int v32; // w1
int v33; // w0
int v34; // w1
int v35; // w0
float v36; // s0
char *v37; // x19
char *v38; // x0
const void *v40; // x0
_BYTE *v41; // x0
__int64 v42; // x1
int v43; // w23
int v44; // w27
int v45; // w24
cocos2d::CCObject *v46; // x26
unsigned __int64 v47; // [xsp+78h] [xbp+78h]
int v48; // [xsp+80h] [xbp+80h]
unsigned __int8 v49; // [xsp+84h] [xbp+84h]
__int64 v50; // [xsp+88h] [xbp+88h]
__int64 v51; // [xsp+90h] [xbp+90h]
unsigned int v52; // [xsp+A0h] [xbp+A0h]
signed int v53; // [xsp+A4h] [xbp+A4h]
_BYTE *v55; // [xsp+C8h] [xbp+C8h]
int v56[2]; // [xsp+C8h] [xbp+C8h]
void *v57; // [xsp+D0h] [xbp+D0h] BYREF
char *v58; // [xsp+D8h] [xbp+D8h]
__int64 v59; // [xsp+E0h] [xbp+E0h]
void *v60; // [xsp+E8h] [xbp+E8h] BYREF
char *v61; // [xsp+F0h] [xbp+F0h]
__int64 v62; // [xsp+F8h] [xbp+F8h]
__int64 v63[2]; // [xsp+100h] [xbp+100h] BYREF
char *v64; // [xsp+110h] [xbp+110h]
__int64 v65[3]; // [xsp+118h] [xbp+118h] BYREF
__int64 v66; // [xsp+130h] [xbp+130h] BYREF
__int64 v67; // [xsp+138h] [xbp+138h]
void *v68; // [xsp+140h] [xbp+140h]
v57 = nullptr;
v58 = nullptr;
v59 = 0;
std::vector::__append((__int64 *)&v57, 0x25Eu);
v60 = nullptr;
v61 = nullptr;
v62 = 0;
std::vector::__append((__int64)&v60, 0x25Eu);
v3 = *((_QWORD *)this + 242);
v48 = *(_DWORD *)(v3 + 1140);
v4 = 0xAAAAAAAAAAAAAAABLL * ((__int64)(*((_QWORD *)this + 1755) - *((_QWORD *)this + 1754)) >> 3);
v49 = *(_BYTE *)(v3 + 769);
v5 = roundf((float)(v4 / 0x3E8)) + 10.0;
if ( v5 > 100.0 )
v5 = 100.0;
v6 = (float)v4;
v53 = *((_DWORD *)this + 3517);
v51 = v53;
v7 = vcvtps_s32_f32((float)v4 / v5);
v52 = v7;
if ( v53 < v4 )
{
v8 = v7 + v53;
if ( v53 >= (int)(v7 + v53) )
goto LABEL_53;
v9 = *((_QWORD *)this + 1754);
v10 = 0;
v50 = 24LL * v53;
v47 = v4 - 1;
while ( 1 )
{
v11 = (unsigned __int8 *)(v9 + v50);
for ( i = 0; i != 4848; i += 8 )
*(_QWORD *)((char *)v60 + i) = 0;
v13 = *v11;
if ( (v13 & 1) != 0 )
{
v14 = *((_QWORD *)v11 + 1);
v15 = *((unsigned __int8 **)v11 + 2);
if ( !v14 )
{
LODWORD(v14) = 0;
v16 = -1;
goto LABEL_11;
}
v40 = *((const void **)v11 + 2);
}
else
{
v29 = v13 >> 1;
v14 = v29;
if ( !v29 )
goto LABEL_34;
v15 = v11 + 1;
v40 = v11 + 1;
}
v41 = memchr(v40, 44, v14);
v16 = v41 - v15;
if ( !v41 )
v16 = -1;
LABEL_11:
if ( v16 != -1 )
{
v17 = 0;
v18 = 1;
v19 = 0;
while ( 1 )
{
if ( v19 != (int)v14 )
{
if ( v18 )
{
std::string::basic_string(v63, (__int64)v11, v19, v16 - v19);
v18 ^= 1u;
if ( (v63[0] & 1) != 0 )
{
v28 = v64;
v10 = atoi(v64);
operator delete(v28);
}
else
{
v10 = atoi((const char *)v63 + 1);
}
}
else if ( (unsigned int)(v10 - 1) <= 0x25C )
{
v55 = v57;
v22 = v19;
v23 = v16 - v19;
v24 = (char *)v57 + 24 * v10;
std::string::basic_string(v65, (__int64)v11, v22, v23);
if ( (v55[24 * v10] & 1) != 0 )
{
**((_BYTE **)v24 + 2) = 0;
*((_QWORD *)v24 + 1) = 0;
}
else
{
v24[1] = 0;
v55[24 * v10] = 0;
}
v18 = 1;
std::string::reserve((__int64 *)v24, 0);
v25 = v65[1];
*(_QWORD *)v24 = v65[0];
*((_QWORD *)v24 + 1) = v25;
*((_QWORD *)v24 + 2) = v65[2];
*((_QWORD *)v60 + v10) = this;
}
else
{
v18 = 1;
}
}
if ( v17 )
break;
v19 = v16 + 1;
if ( (*v11 & 1) != 0 )
{
v20 = *((_QWORD *)v11 + 1);
v21 = *((unsigned __int8 **)v11 + 2);
if ( v19 >= v20 )
goto LABEL_20;
}
else
{
v20 = *v11 >> 1;
v21 = v11 + 1;
if ( v19 >= v20 )
goto LABEL_20;
}
v26 = v20 - v19;
if ( v26 )
{
v27 = memchr(&v21[v19], 44, v26);
if ( v27 )
{
v16 = v27 - v21;
if ( v16 != -1 )
continue;
}
}
LABEL_20:
v16 = (int)v14;
v17 = 1;
}
}
LABEL_34:
v30 = (GameObject *)GameObject::objectFromVector(&v57, &v60, this, v49);
v31 = v30;
if ( !v30 )
goto LABEL_40;
v32 = *((_DWORD *)v30 + 257);
if ( v32 == 31 )
{
v66 = 0;
v67 = 0;
v68 = nullptr;
if ( (*v11 & 1) != 0 )
{
std::string::__init(&v66, *((void **)v11 + 2), *((_QWORD *)v11 + 1));
}
else
{
v42 = *((_QWORD *)v11 + 1);
v66 = *(_QWORD *)v11;
v67 = v42;
v68 = *((void **)v11 + 2);
}
StartPosObject::loadSettingsFromString(v31, &v66);
if ( (v66 & 1) != 0 )
operator delete(v68);
}
else if ( v32 == 2065 )
{
ParticleGameObject::updateParticleStruct(v30);
}
if ( (*(unsigned int (__fastcall **)(GameObject *))(*(_QWORD *)v31 + 1800LL))(v31) == 22 && v48 != 1 )
goto LABEL_40;
v33 = *((_DWORD *)v31 + 330);
if ( v33 <= 0 )
{
v43 = 0;
if ( (unsigned __int8)GameObject::hasSecondaryColor(v31) )
v44 = 2;
else
v44 = 1;
while ( 1 )
{
GameObject::getColorKey(v31, (v43 ^ 1) & 1, 0);
if ( cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 1848), &v66) )
{
v45 = *(_DWORD *)(cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 1848), &v66) + 56);
}
else
{
v45 = *((_DWORD *)this + 3716);
*(_QWORD *)v56 = *((_QWORD *)this + 1848);
v46 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCObject::CCObject(v46);
*((_DWORD *)v46 + 14) = v45;
*(_QWORD *)v46 = &off_1428350;
cocos2d::CCObject::autorelease(v46);
cocos2d::CCDictionary::setObject(v56[0], v46);
++*((_DWORD *)this + 3716);
}
if ( (((unsigned __int8)v43 ^ 1) & 1) != 0 )
{
*((_DWORD *)v31 + 330) = v45;
if ( (v66 & 1) != 0 )
goto LABEL_89;
}
else
{
*((_DWORD *)v31 + 331) = v45;
if ( (v66 & 1) != 0 )
LABEL_89:
operator delete(v68);
}
if ( ++v43 == v44 )
goto LABEL_49;
}
}
v34 = *((_DWORD *)this + 3716);
if ( v33 > v34 )
{
*((_DWORD *)this + 3716) = v33;
v34 = v33;
}
v35 = *((_DWORD *)v31 + 331);
if ( v35 > v34 )
*((_DWORD *)this + 3716) = v35;
LABEL_49:
if ( (*(unsigned int (__fastcall **)(GameObject *))(*(_QWORD *)v31 + 1800LL))(v31) == 31 )
{
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 1757)) <= 2 )
{
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 1757), v31);
PlayLayer::addObject(this, v31);
}
LABEL_40:
if ( (*v11 & 1) != 0 )
goto LABEL_41;
goto LABEL_51;
}
PlayLayer::addObject(this, v31);
if ( (*v11 & 1) != 0 )
{
LABEL_41:
**((_BYTE **)v11 + 2) = 0;
*((_QWORD *)v11 + 1) = 0;
++v53;
if ( v51 == v47 )
goto LABEL_52;
goto LABEL_42;
}
LABEL_51:
v11[1] = 0;
*v11 = 0;
++v53;
if ( v51 == v47 )
{
LABEL_52:
v8 = v52 + *((_DWORD *)this + 3517);
v4 = 0xAAAAAAAAAAAAAAABLL * ((__int64)(*((_QWORD *)this + 1755) - *((_QWORD *)this + 1754)) >> 3);
v6 = (float)v4;
goto LABEL_53;
}
LABEL_42:
++v51;
v50 += 24;
v8 = v52 + *((_DWORD *)this + 3517);
if ( v8 <= v53 )
{
v4 = 0xAAAAAAAAAAAAAAABLL * ((__int64)(*((_QWORD *)this + 1755) - *((_QWORD *)this + 1754)) >> 3);
v6 = (float)v4;
goto LABEL_53;
}
v9 = *((_QWORD *)this + 1754);
}
}
v8 = v7 + v53;
LABEL_53:
*((_DWORD *)this + 3517) = v8;
v36 = (float)(v8 - 1) / v6;
if ( v36 > 1.0 )
v36 = 1.0;
*((float *)this + 3137) = v36;
if ( v4 <= v8 )
{
PlayLayer::createObjectsFromSetupFinished(this, (__int64)this, v2);
*((float *)this + 3137) = 1.0;
PlayLayer::setupHasCompleted(this);
}
if ( v60 )
{
if ( v60 != v61 )
v61 += 8 * ~((unsigned __int64)(v61 - 8 - (_BYTE *)v60) >> 3);
operator delete(v60);
}
v37 = (char *)v57;
if ( v57 )
{
v38 = v58;
if ( v57 != v58 )
{
do
{
v58 = v38 - 24;
std::string::~string((__int64)(v38 - 24));
v38 = v58;
}
while ( v37 != v58 );
v38 = (char *)v57;
}
operator delete(v38);
}
return _stack_chk_guard;
}