//
// CCMenuItemToggler::create from 0x140045250 to 0x140045474 (548 bytes)
//
// 34 xrefs:
// > GameToolbox::createToggleButton @ 0x14006478d
// > CharacterColorPage::init @ 0x140088aba
// > ColorSelectPopup::init @ 0x14008ef5c
// > LevelCell::loadFromLevel @ 0x1400ae13a
// > GJRequestCell::loadFromScore @ 0x1400bc9e3
// > GJMessageCell::loadFromMessage @ 0x1400bdbe9
// > EditorUI::setupCreateMenu @ 0x14010db86
// > FRequestProfilePage::init @ 0x14013e0e8
// > GJGarageLayer::setupIconSelect @ 0x1402753fc
// > GJGarageLayer::setupIconSelect @ 0x14027548e
// > GJGarageLayer::setupIconSelect @ 0x140275523
// > GJGarageLayer::setupIconSelect @ 0x1402755b8
// > GJGarageLayer::setupIconSelect @ 0x14027564d
// > GJGarageLayer::setupIconSelect @ 0x1402756e2
// > GJGarageLayer::setupIconSelect @ 0x140275777
// > GJGarageLayer::setupIconSelect @ 0x14027580c
// > GJGarageLayer::setupIconSelect @ 0x1402758a1
// > GJGarageLayer::setupIconSelect @ 0x140275936
// > GJGarageLayer::setupIconSelect @ 0x1402759cb
// > GJAccountSettingsLayer::createToggleButton @ 0x140293b79
// > LeaderboardsLayer::setupTabs @ 0x1402c273c
// > LeaderboardsLayer::setupTabs @ 0x1402c283d
// > LeaderboardsLayer::setupTabs @ 0x1402c293e
// > LeaderboardsLayer::setupTabs @ 0x1402c2a3f
// > LevelBrowserLayer::init @ 0x1402c9942
// > MoreSearchLayer::createToggleButton @ 0x140317383
// > LevelSettingsLayer::createToggleButton @ 0x140321402
// > MessagesProfilePage::init @ 0x140336ce5
// > VideoOptionsLayer::createToggleButton @ 0x140378a8f
// > ShareCommentLayer::init @ 0x14048d729
// > ShareLevelSettingsLayer::init @ 0x1404915cd
// > ShareLevelSettingsLayer::init @ 0x14049181b
// > SupportLayer::createToggleButton @ 0x1404c91c2
// > ??> @ 0x1406c46f8
//
// 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
//
// Hidden C++ exception states: #wind=1
CCMenuItemToggler *CCMenuItemToggler::create(
cocos2d::CCNode *a1,
cocos2d::CCNode *a2,
cocos2d::CCObject *a3,
cocos2d::SEL_MenuHandler *a4)
{
void *v8; // rsi
__int64 *v9; // rbx
__int64 v10; // rdi
__int64 v11; // rax
__int64 *v12; // rbx
__int64 v13; // rdi
__int64 v14; // rax
__int64 *v15; // rbx
__int64 v16; // rdi
struct cocos2d::CCPoint v17; // rax
__int64 *v18; // rbx
__int64 v19; // rdi
struct cocos2d::CCPoint v20; // rax
cocos2d::CCPoint v22; // [rsp+20h] [rbp-38h] BYREF
cocos2d::CCPoint v23; // [rsp+28h] [rbp-30h] BYREF
struct cocos2d::CCPoint v24; // [rsp+30h] [rbp-28h] BYREF
struct cocos2d::CCPoint v25; // [rsp+38h] [rbp-20h] BYREF
v8 = operator new(0x190u);
v22 = (cocos2d::CCPoint)v8;
cocos2d::CCMenuItem::CCMenuItem((cocos2d::CCMenuItem *)v8);
*(_QWORD *)v8 = &CCMenuItemToggler::`vftable';
*((_QWORD *)v8 + 40) = &CCMenuItemToggler::`vftable';
*((_QWORD *)v8 + 47) = 0;
*((_QWORD *)v8 + 48) = 0;
*((_WORD *)v8 + 196) = 0;
if ( (unsigned __int8)cocos2d::CCMenuItem::initWithTarget(v8, a3, a4) )
{
*((_QWORD *)v8 + 47) = CCMenuItemSpriteExtra::create(
a1,
nullptr,
(cocos2d::CCObject *)v8,
(cocos2d::SEL_MenuHandler *)CCMenuItemToggler::normalTouch);
*((_QWORD *)v8 + 48) = CCMenuItemSpriteExtra::create(
a2,
nullptr,
(cocos2d::CCObject *)v8,
(cocos2d::SEL_MenuHandler *)CCMenuItemToggler::selectedTouch);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v8 + 448LL))(v8, *((_QWORD *)v8 + 47));
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v8 + 448LL))(v8, *((_QWORD *)v8 + 48));
v9 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 936LL))(*((_QWORD *)v8 + 47));
v10 = *v9;
cocos2d::CCPoint::CCPoint(&v22, 0.5, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v10 + 272))(v9, v11);
v12 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 936LL))(*((_QWORD *)v8 + 48));
v13 = *v12;
cocos2d::CCPoint::CCPoint(&v23, 0.5, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v13 + 272))(v12, v14);
v15 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 936LL))(*((_QWORD *)v8 + 47));
v16 = *v15;
v17 = cocos2d::CCNode::convertToNodeSpace(*((cocos2d::CCNode **)v8 + 47), &v24);
(*(void (__fastcall **)(__int64 *, struct cocos2d::CCPoint))(v16 + 184))(v15, v17);
v18 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 936LL))(*((_QWORD *)v8 + 48));
v19 = *v18;
v20 = cocos2d::CCNode::convertToNodeSpace(*((cocos2d::CCNode **)v8 + 48), &v25);
(*(void (__fastcall **)(__int64 *, struct cocos2d::CCPoint))(v19 + 184))(v18, v20);
*((_BYTE *)v8 + 393) = 0;
CCMenuItemToggler::toggle((CCMenuItemToggler *)v8, 0);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v8);
return (CCMenuItemToggler *)v8;
}
else
{
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v8 + 8LL))(v8, 1);
return nullptr;
}
}