//
// SetupPlayerControlPopup::init from 0xa44bb4 to 0xa453c8 (2068 bytes)
//
// 2 xrefs:
// > SetupPlayerControlPopup::create @ 0xa45574
// > ??> @ 0x838c8
//
// 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 SetupPlayerControlPopup::init(SetupPlayerControlPopup *a1, PlayerControlGameObject *a2, cocos2d::CCArray *a3)
{
bool v4; // w26
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
void *v16; // x0
void *v17; // x0
void *v18; // x0
void *v19; // x0
void *v20; // x0
void *v21; // x19
unsigned int *v22; // x1
int v23; // w2
unsigned int *v24; // x1
int v25; // w2
unsigned int *v26; // x1
int v27; // w2
unsigned int *v28; // x1
int v29; // w2
unsigned int *v30; // x1
int v31; // w2
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x1
int v37; // w2
unsigned int *v38; // x1
int v39; // w2
unsigned int *v40; // x21
int v41; // w0
_QWORD v42[2]; // [xsp+0h] [xbp+0h] BYREF
float v43; // [xsp+78h] [xbp+78h]
float v44; // [xsp+7Ch] [xbp+7Ch]
cocos2d::CCPoint v45; // [xsp+80h] [xbp+80h] BYREF
__int64 v46; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v47; // [xsp+90h] [xbp+90h] BYREF
cocos2d::CCPoint v48; // [xsp+98h] [xbp+98h] BYREF
cocos2d::CCPoint v49; // [xsp+A0h] [xbp+A0h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 320.0, 220.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v42 + 160, "Player Control");
SetupTriggerPopup::addTitle((__int64)a1);
v6 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v6);
}
sub_D153B8((unsigned int)v42 + 160, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (ButtonSprite **)&v49, v7, v8, v9, v10, v11);
v12 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v12);
}
sub_D153B8((int)&v48, "Help");
sub_D153B8(
(unsigned int)v42 + 160,
"Controls player P1 or P2 behavior with a specified setting.\n"
"Stop Slide can be used to stop the player from sliding after a force has been applied.");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v13 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v13);
}
v14 = (void *)(*(_QWORD *)&v48 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v48 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(*(_QWORD *)&v48 - 8LL);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(_DWORD *)(*(_QWORD *)&v48 - 8LL);
*(_DWORD *)(*(_QWORD *)&v48 - 8LL) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v14);
}
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v15 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v15);
cocos2d::CCPoint::CCPoint(&v45, v43 * 0.5, v44 * 0.5);
cocos2d::CCPoint::CCPoint(&v49, -20.0, 40.0);
cocos2d::CCPoint::operator+(&v46, &v45, &v49);
sub_D153B8((unsigned int)v42 + 160, "P1");
cocos2d::CCPoint::CCPoint(&v47, -40.0, 20.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 138, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v16 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v16);
}
sub_D153B8((unsigned int)v42 + 160, "P2");
cocos2d::CCPoint::CCPoint(&v47, 40.0, 20.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 200, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v17 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v38 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v39 = __ldaxr(v38);
while ( __stlxr(v39 - 1, v38) );
}
else
{
v39 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v39 - 1;
}
if ( v39 <= 0 )
operator delete(v17);
}
sub_D153B8((unsigned int)v42 + 160, "Stop\nJump");
cocos2d::CCPoint::CCPoint(&v47, -80.0, -20.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 540, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v18 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v18);
}
sub_D153B8((unsigned int)v42 + 160, "Stop\nMove");
cocos2d::CCPoint::CCPoint(&v47, 0.0, -20.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 541, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v19 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v19);
}
sub_D153B8((unsigned int)v42 + 160, "Stop\nRot");
cocos2d::CCPoint::CCPoint(&v47, 80.0, -20.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 542, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v20 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v20);
}
sub_D153B8((unsigned int)v42 + 160, "Stop\nSlide");
cocos2d::CCPoint::CCPoint(&v47, -80.0, -60.0);
cocos2d::CCPoint::operator+(&v48, &v46, &v47);
SetupTriggerPopup::createToggleValueControl(a1, 543, 1.0, (__int64)&v49, &v48, 0, 0, 0);
v21 = (void *)(*(_QWORD *)&v49 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v49 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v40 = (unsigned int *)(*(_QWORD *)&v49 - 8LL);
do
v41 = __ldaxr(v40);
while ( __stlxr(v41 - 1, v40) );
}
else
{
v41 = *(_DWORD *)(*(_QWORD *)&v49 - 8LL);
*(_DWORD *)(*(_QWORD *)&v49 - 8LL) = v41 - 1;
}
if ( v41 <= 0 )
operator delete(v21);
}
SetupTriggerPopup::postSetup(a1);
}
return v4;
}