//
// CCMenuItemToggler::create from 0x1000597a0 to 0x100059858 (184 bytes)
//
// 39 xrefs:
// > EditorUI::setupCreateMenu @ 0x10002a149
// > AccountLayer::createToggleButton @ 0x1000ccfc2
// > CustomizeObjectLayer::createToggleButton @ 0x1001f8ee2
// > MessagesProfilePage::init @ 0x10022dfba
// > LevelCell::loadFromLevel @ 0x100244875
// > GJRequestCell::loadFromScore @ 0x10024c82f
// > GJMessageCell::loadFromMessage @ 0x10024d14e
// > LevelSettingsLayer::createToggleButton @ 0x10026e451
// > ShareLevelSettingsLayer::init @ 0x100282a23
// > ShareLevelSettingsLayer::init @ 0x100282c9f
// > CollisionBlockPopup::createToggleButton @ 0x100286e51
// > GJAccountSettingsLayer::createToggleButton @ 0x1002a12ab
// > GJGarageLayer::setupIconSelect @ 0x10036b61e
// > GJGarageLayer::setupIconSelect @ 0x10036b689
// > GJGarageLayer::setupIconSelect @ 0x10036b6f7
// > GJGarageLayer::setupIconSelect @ 0x10036b765
// > GJGarageLayer::setupIconSelect @ 0x10036b7d3
// > GJGarageLayer::setupIconSelect @ 0x10036b841
// > GJGarageLayer::setupIconSelect @ 0x10036b8af
// > GJGarageLayer::setupIconSelect @ 0x10036b91d
// > GJGarageLayer::setupIconSelect @ 0x10036b98b
// > GJGarageLayer::setupIconSelect @ 0x10036b9f9
// > GJGarageLayer::setupIconSelect @ 0x10036ba67
// > SupportLayer::createToggleButton @ 0x10039a352
// > PauseLayer::createToggleButton @ 0x1003d7681
// > LevelBrowserLayer::init @ 0x10048bd4f
// > GameToolbox::createToggleButton @ 0x1004eee73
// > LeaderboardsLayer::setupTabs @ 0x100512f45
// > LeaderboardsLayer::setupTabs @ 0x100513001
// > LeaderboardsLayer::setupTabs @ 0x1005130bd
// > LeaderboardsLayer::setupTabs @ 0x100513174
// > ColorSelectLiveOverlay::createToggleButton @ 0x10056a221
// > ShareCommentLayer::init @ 0x1005e0036
// > MoreSearchLayer::createToggleButton @ 0x10062e532
// > CharacterColorPage::init @ 0x10065d5cf
// > ColorSelectPopup::init @ 0x100725fb0
// > FRequestProfilePage::init @ 0x1007903f7
// > OptionsLayer::createToggleButton @ 0x10079ad32
// > VideoOptionsLayer::createToggleButton @ 0x10079ffd5
//
// 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 CCMenuItemToggler::create(
cocos2d::CCNode *a1,
cocos2d::CCNode *a2,
cocos2d::CCObject *a3,
cocos2d::SEL_MenuHandler a4)
{
void (__cdecl *ptr)(cocos2d::CCObject *); // r15
char *v6; // rbx
cocos2d::SEL_MenuHandler v7; // r8
size_t adj; // [rsp+0h] [rbp-30h]
adj = a4.adj;
ptr = a4.ptr;
v6 = (char *)operator new(0x190u);
cocos2d::CCNodeRGBA::CCNodeRGBA(v6);
*((_WORD *)v6 + 169) = 0;
*(_OWORD *)(v6 + 344) = 0;
*(_OWORD *)(v6 + 360) = 0;
*(_QWORD *)v6 = off_1008B2FE8;
*((_QWORD *)v6 + 40) = off_1008B3418;
*(_OWORD *)(v6 + 376) = 0;
*((_WORD *)v6 + 196) = 0;
v7.ptr = ptr;
v7.adj = adj;
if ( CCMenuItemToggler::init((CCMenuItemToggler *)v6, a1, a2, a3, v7) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v6);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v6 + 16LL))(v6);
return nullptr;
}
return (CCMenuItemToggler *)v6;
}