//
// SetupObjectControlPopup::init from 0xa52b24 to 0xa52f98 (1140 bytes)
//
// 2 xrefs:
// > SetupObjectControlPopup::create @ 0xa5313c
// > ??> @ 0x9a800
//
// 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 SetupObjectControlPopup::init(SetupObjectControlPopup *a1, ObjectControlGameObject *a2, cocos2d::CCArray *a3)
{
bool v4; // w23
void *v6; // x0
__int64 v7; // x2
__int64 v8; // x3
__int64 v9; // x4
__int64 v10; // x5
const char *v11; // x6
void *v12; // x0
void *v13; // x0
void *v14; // x0
cocos2d::CCDirector *v15; // x0
float v16; // s3
float v17; // s4
void *v18; // x0
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
unsigned int *v25; // x1
int v26; // w2
unsigned int *v27; // x20
int v28; // w1
_QWORD v29[2]; // [xsp+30h] [xbp+0h] BYREF
float v30; // [xsp+98h] [xbp+68h]
float v31; // [xsp+9Ch] [xbp+6Ch]
cocos2d::CCPoint v32; // [xsp+A0h] [xbp+70h] BYREF
__int64 v33; // [xsp+A8h] [xbp+78h] BYREF
cocos2d::CCPoint v34; // [xsp+B0h] [xbp+80h] BYREF
cocos2d::CCPoint v35; // [xsp+B8h] [xbp+88h] BYREF
cocos2d::CCPoint v36; // [xsp+C0h] [xbp+90h] BYREF
cocos2d::CCPoint v37; // 0:s0.4,4:s1.4
v4 = SetupTriggerPopup::init(a1, a2, a3, 320.0, 220.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v29 + 144, "Object Control");
SetupTriggerPopup::addTitle((__int64)a1);
v6 = (void *)(*(_QWORD *)&v36 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v36 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(*(_QWORD *)&v36 - 8LL);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(*(_QWORD *)&v36 - 8LL);
*(_DWORD *)(*(_QWORD *)&v36 - 8LL) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v6);
}
sub_D153B8((unsigned int)v29 + 144, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (ButtonSprite **)&v36, v7, v8, v9, v10, v11);
v12 = (void *)(*(_QWORD *)&v36 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v36 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(*(_QWORD *)&v36 - 8LL);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(*(_QWORD *)&v36 - 8LL);
*(_DWORD *)(*(_QWORD *)&v36 - 8LL) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v12);
}
sub_D153B8((int)&v35, "Help");
sub_D153B8((unsigned int)v29 + 144, "Control help");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v13 = (void *)(*(_QWORD *)&v36 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v36 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(*(_QWORD *)&v36 - 8LL);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(*(_QWORD *)&v36 - 8LL);
*(_DWORD *)(*(_QWORD *)&v36 - 8LL) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v13);
}
v14 = (void *)(*(_QWORD *)&v35 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v35 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(*(_QWORD *)&v35 - 8LL);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(*(_QWORD *)&v35 - 8LL);
*(_DWORD *)(*(_QWORD *)&v35 - 8LL) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v14);
}
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v15);
cocos2d::CCPoint::CCPoint(&v32, v30 * 0.5, v31 * 0.5);
cocos2d::CCPoint::CCPoint(&v36, -20.0, 40.0);
cocos2d::CCPoint::operator+(&v33, &v32, &v36);
sub_D153B8((int)&v36, "Target ID");
cocos2d::CCPoint::CCPoint(&v34, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v35, &v32, &v34);
v37.y = 0.0;
v37.x = 0.8;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x33u,
v37,
100.0,
v16,
v17,
(std::string)&v36,
&v35,
Float,
Uint,
6,
1u,
1,
0,
0,
2,
0);
v18 = (void *)(*(_QWORD *)&v36 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v36 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(*(_QWORD *)&v36 - 8LL);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(*(_QWORD *)&v36 - 8LL);
*(_DWORD *)(*(_QWORD *)&v36 - 8LL) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v18);
}
SetupTriggerPopup::postSetup(a1);
}
return v4;
}