//
// EndPortalObject::init from 0x8b45ac to 0x8b48a8 (764 bytes)
//
// 3 xrefs:
// > EndPortalObject::create @ 0x8b4ea4
// > ??> @ 0xd5910
// > ??> @ 0x1458f20
//
// 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:56:24 +0000
//
__int64 __fastcall EndPortalObject::init(EndPortalObject *this)
{
unsigned __int8 v2; // w0
unsigned int v3; // w26
cocos2d::CCDirector *v5; // x0
cocos2d::CCDirector *v6; // x0
GameManager *v7; // x0
const char *v8; // x1
GameManager **v9; // x19
void (__fastcall *v10)(GameManager **, float *); // x20
unsigned __int8 *v11; // x2
int v12; // w4
int v13; // w3
void (__fastcall *v14)(GameManager **, float *); // x20
unsigned __int8 *v15; // x2
int v16; // w4
int v17; // w3
GameManager *v18; // x0
__int64 v19; // x0
const char *v20; // x1
int v21; // w23
int v22; // w20
__int64 v23; // x19
float v24; // s1
void (__fastcall *v25)(__int64, float *); // x27
__int64 v26; // [xsp+70h] [xbp+70h] BYREF
float v27; // [xsp+78h] [xbp+78h] BYREF
float v28; // [xsp+7Ch] [xbp+7Ch]
float v29; // [xsp+80h] [xbp+80h]
float v30; // [xsp+84h] [xbp+84h]
v2 = GameObject::init(this, "block001_01_001.png");
v3 = v2;
if ( v2 )
{
v5 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(EndPortalObject *, void *))(*(_QWORD *)this + 1136LL))(
this,
&unk_155CA98);
v6 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(&v26, v6);
*((_BYTE *)this + 999) = 0;
*((_BYTE *)this + 1032) = 1;
*((_DWORD *)this + 230) = 7;
v7 = GameObject::createAndAddParticle((__int64)this, 7u, (__int64)"endEffectPortal.plist", 4u, 2u);
v9 = (GameManager **)v7;
if ( v7 )
{
(*(void (__fastcall **)(GameManager *, float))(*(_QWORD *)v7 + 1176LL))(v7, *((float *)&v26 + 1) * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, -15.0, 0.0);
cocos2d::CCPoint::operator=((char *)this + 812, &v27);
v10 = *((void (__fastcall **)(GameManager **, float *))*v9 + 170);
v11 = *(unsigned __int8 **)(*(_QWORD *)(GameManager::sharedState(*v9) + 544) + 3256LL);
v12 = v11[2603];
v13 = v11[2604];
LODWORD(v11) = v11[2602];
v30 = 1.0;
v28 = (float)v12 / 255.0;
v29 = (float)v13 / 255.0;
v27 = (float)(int)v11 / 255.0;
v10(v9, &v27);
v14 = *((void (__fastcall **)(GameManager **, float *))*v9 + 174);
v15 = *(unsigned __int8 **)(*(_QWORD *)(GameManager::sharedState(*v9) + 544) + 3256LL);
v16 = v15[2603];
v17 = v15[2604];
LODWORD(v15) = v15[2602];
v30 = 1.0;
v28 = (float)v16 / 255.0;
v29 = (float)v17 / 255.0;
v27 = (float)(int)v15 / 255.0;
v14(v9, &v27);
}
v18 = (GameManager *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"gradientBar.png", v8);
*((_QWORD *)this + 169) = v18;
v19 = GameManager::sharedState(v18);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(v19 + 544) + 2544LL) + 456LL))(
*(_QWORD *)(*(_QWORD *)(v19 + 544) + 2544LL),
*((_QWORD *)this + 169));
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 169) + 1080LL))(
*((_QWORD *)this + 169),
0x100000302LL);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 169) + 144LL))(
*((_QWORD *)this + 169),
(float)(*((float *)&v26 + 1) * 1.5) / *(float *)(*((_QWORD *)this + 169) + 436LL));
v21 = llroundf((float)(*((float *)&v26 + 1) * 1.5) / 30.0);
if ( v21 > 0 )
{
v22 = 0;
do
{
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"square_02_001.png", v20);
(*(void (__fastcall **)(EndPortalObject *, __int64))(*(_QWORD *)this + 456LL))(this, v23);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v23 + 360LL))(v23, -90.0);
v24 = (float)v22++;
v25 = *(void (__fastcall **)(__int64, float *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v27,
0.0,
-(float)((float)(v24 * 30.0) - (float)((float)(v21 >> 1) * 30.0)));
v25(v23, &v27);
}
while ( v22 != v21 );
}
*((_BYTE *)this + 896) = 1;
}
return v3;
}