//
// SetupTriggerPopup::createToggleButton from 0x9e51ec to 0x9e5384 (408 bytes)
//
// 28 xrefs:
// > ColorSelectPopup::init @ 0x73ebf8
// > ColorSelectPopup::init @ 0x73ec78
// > ColorSelectPopup::init @ 0x73ecf8
// > ColorSelectPopup::init @ 0x73ed8c
// > ColorSelectPopup::init @ 0x73ee20
// > ColorSelectPopup::init @ 0x73eeb0
// > ColorSelectPopup::init @ 0x73ef28
// > SetupCollisionTriggerPopup::init @ 0x9506f4
// > SetupCollisionTriggerPopup::init @ 0x950760
// > SetupCollisionTriggerPopup::init @ 0x9507d4
// > SetupCollisionTriggerPopup::init @ 0x950844
// > SetupCollisionTriggerPopup::init @ 0x9508b8
// > SetupCountTriggerPopup::init @ 0x953c6c
// > SetupCountTriggerPopup::init @ 0x953ce0
// > SetupInstantCountPopup::init @ 0x9567f4
// > SetupInstantCountPopup::init @ 0x956894
// > SetupInstantCountPopup::init @ 0x95692c
// > SetupInstantCountPopup::init @ 0x9569c4
// > SetupTouchTogglePopup::init @ 0x95b4ac
// > SetupTouchTogglePopup::init @ 0x95b554
// > SetupTouchTogglePopup::init @ 0x95b5ec
// > SetupTouchTogglePopup::init @ 0x95b698
// > SetupTouchTogglePopup::init @ 0x95b720
// > SetupTouchTogglePopup::init @ 0x95b7b8
// > SetupEndPopup::init @ 0x96eb4c
// > SetupEndPopup::init @ 0x96ebbc
// > SetupEndPopup::init @ 0x96ec4c
// > ??> @ 0x48978
//
// 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
//
CCMenuItemToggler *__fastcall SetupTriggerPopup::createToggleButton(
__int64 a1,
__int64 a2,
void (__cdecl *a3)(cocos2d::CCObject *),
size_t a4,
bool a5,
const cocos2d::CCPoint *a6)
{
cocos2d::CCNode *v10; // x26
cocos2d::CCObject *v11; // x25
CCMenuItemToggler *v12; // x20
void *v13; // x0
unsigned int *v15; // x2
int v16; // w1
cocos2d::CCPoint v18; // [xsp+A0h] [xbp+70h] BYREF
__int64 v19; // [xsp+A8h] [xbp+78h] BYREF
cocos2d::CCPoint v20; // [xsp+B0h] [xbp+80h] BYREF
sub_D18D28(&v19);
v10 = *(cocos2d::CCNode **)(a1 + 544);
cocos2d::CCPoint::CCPoint(&v20, a6);
v11 = *(cocos2d::CCObject **)(a1 + 576);
cocos2d::CCPoint::CCPoint(&v18, 8.0, 0.0);
v12 = GameToolbox::createToggleButton(
0.7,
0.35,
110.0,
(__int64)&v19,
a3,
a4,
a5,
v10,
&v20,
(cocos2d::CCObject *)a1,
v11,
(float *)&v18,
(__int64)"bigFont.fnt",
0,
0,
nullptr);
v13 = (void *)(v19 - 24);
if ( (__int64 *)(v19 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v19 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v19 - 8);
*(_DWORD *)(v19 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v13);
}
return v12;
}