//
// EditGameObjectPopup::init from 0x8d12a0 to 0x8d1610 (880 bytes)
//
// 2 xrefs:
// > EditGameObjectPopup::create @ 0x8d17b4
// > ??> @ 0x60678
//
// 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
//
bool EditGameObjectPopup::init(EditGameObjectPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3, bool a4)
{
_BOOL4 v4; // w25
bool v6; // w20
void *v8; // x0
void *v9; // x0
cocos2d::CCDirector *v10; // x0
float v11; // s2
__int64 v12; // x1
void *v13; // x0
float v14; // s2
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
_QWORD v22[2]; // [xsp+0h] [xbp+0h] BYREF
float v23; // [xsp+58h] [xbp+58h]
float v24; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v25; // [xsp+60h] [xbp+60h] BYREF
__int64 v26; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v27; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v28; // 0:s0.4,4:s1.4
cocos2d::CCPoint v29; // 0:s0.4,4:s1.4
v4 = a4;
v6 = SetupTriggerPopup::init(a1, a2, a3, 200.0, 140.0, 1);
if ( v6 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v22 + 112, "Setup Object");
SetupTriggerPopup::addTitle(a1, (std::string)&v27);
v8 = (void *)(*(_QWORD *)&v27 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v27 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(*(_QWORD *)&v27 - 8LL);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(*(_QWORD *)&v27 - 8LL);
*(_DWORD *)(*(_QWORD *)&v27 - 8LL) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v8);
}
sub_D153B8((unsigned int)v22 + 112, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)&v27);
v9 = (void *)(*(_QWORD *)&v27 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v27 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(*(_QWORD *)&v27 - 8LL);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(*(_QWORD *)&v27 - 8LL);
*(_DWORD *)(*(_QWORD *)&v27 - 8LL) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v9);
}
v10 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v10);
cocos2d::CCPoint::CCPoint(&v25, (float)(v23 * 0.5) + -50.0, v24 * 0.5);
if ( v4 )
{
sub_D153B8((int)&v26, "NO Multi\nActivate");
cocos2d::CCPoint::CCPoint(&v27, &v25);
v29.x = 1.0;
SetupTriggerPopup::createToggleValueControl(
a1,
444,
(std::string)&v26,
v29,
(unsigned __int8)v22 + 112,
0,
0,
v14);
v12 = v26;
v13 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) == &qword_124B6B0 )
goto LABEL_7;
if ( &pthread_create )
{
v15 = (unsigned int *)(v26 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
LABEL_12:
if ( v16 <= 0 )
operator delete(v13);
goto LABEL_7;
}
}
else
{
sub_D153B8((int)&v26, "Multi\nActivate");
cocos2d::CCPoint::CCPoint(&v27, &v25);
v28.x = 1.0;
SetupTriggerPopup::createToggleValueControl(a1, 99, (std::string)&v26, v28, (unsigned __int8)v22 + 112, 0, 0, v11);
v12 = v26;
v13 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) == &qword_124B6B0 )
{
LABEL_7:
SetupTriggerPopup::postSetup(a1);
return v6;
}
if ( &pthread_create )
{
v21 = (unsigned int *)(v26 - 8);
do
v16 = __ldaxr(v21);
while ( __stlxr(v16 - 1, v21) );
goto LABEL_12;
}
}
v16 = *(_DWORD *)(v12 - 8);
*(_DWORD *)(v12 - 8) = v16 - 1;
goto LABEL_12;
}
return v6;
}