//
// CCMenuItemToggler::create from 0x140048f70 to 0x140049197 (551 bytes)
//
// 48 xrefs:
// > GameToolbox::createNotifyToggles @ 0x14006df5e
// > GameToolbox::createToggleButton @ 0x14006e69a
// > CharacterColorPage::init @ 0x1400a134a
// > AccountReviewPopup::buildReportedRows @ 0x1400b43ab
// > AccountReviewPopup::buildFilterRows @ 0x1400b5be7
// > ReportPopup::buildReasonRows @ 0x1400bed5d
// > AutoBackupPopup::buildRows @ 0x1400cb0d8
// > LevelPickerPopup::init @ 0x1400e96e4
// > DeathMarkerSettingsPopup::init @ 0x14011d06a
// > DeathTrackerOptionsPopup::init @ 0x14011fdd0
// > ColorSelectPopup::init @ 0x140127e58
// > LevelCell::loadFromLevel @ 0x140148b7e
// > CommentCell::loadFromComment @ 0x14015447c
// > GJRequestCell::loadFromScore @ 0x140159002
// > GJThreadCell::loadFromThread @ 0x14015a718
// > GJMessageCell::loadFromMessage @ 0x14015d1ae
// > EditorUI::setupCreateMenu @ 0x1401f0534
// > GJGarageLayer::setupIconSelect @ 0x14037dc7b
// > GJGarageLayer::setupIconSelect @ 0x14037dd12
// > GJGarageLayer::setupIconSelect @ 0x14037ddad
// > GJGarageLayer::setupIconSelect @ 0x14037de48
// > GJGarageLayer::setupIconSelect @ 0x14037dee3
// > GJGarageLayer::setupIconSelect @ 0x14037df7e
// > GJGarageLayer::setupIconSelect @ 0x14037e019
// > GJGarageLayer::setupIconSelect @ 0x14037e0b4
// > GJGarageLayer::setupIconSelect @ 0x14037e14f
// > GJGarageLayer::setupIconSelect @ 0x14037e1ea
// > GJGarageLayer::setupIconSelect @ 0x14037e285
// > GJAccountSettingsLayer::createToggleButton @ 0x14039e82f
// > LeaderboardsLayer::setupTabs @ 0x1403db8e7
// > LeaderboardsLayer::setupTabs @ 0x1403db9eb
// > LeaderboardsLayer::setupTabs @ 0x1403dbaef
// > LeaderboardsLayer::setupTabs @ 0x1403dbbf3
// > MoreSearchLayer::createToggleButton @ 0x140440589
// > KeybindCapturePopup::init @ 0x14044da88
// > PlatformerControlsPopup::init @ 0x14044f358
// > PlatformerControlsPopup::init @ 0x14044f8cb
// > PlatformerControlsPopup::init @ 0x14044f9b3
// > PlatformerControlsPopup::init @ 0x14044fa9b
// > LevelSettingsLayer::createToggleButton @ 0x14045a608
// > VideoOptionsLayer::createToggleButton @ 0x1404ce805
// > ParentalOptionsLayer::init @ 0x1404d18e0
// > ShareCommentLayer::init @ 0x14062e843
// > ShareLevelSettingsLayer::init @ 0x140633058
// > ShareLevelSettingsLayer::init @ 0x1406332b1
// > SupportLayer::createToggleButton @ 0x14066a948
// > TimeSpeedControl::init @ 0x14066dbaa
// > ??> @ 0x14090fbf0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:25:32 +0000
//
// Hidden C++ exception states: #wind=1
cocos2d::CCMenuItem *__fastcall CCMenuItemToggler::create(int a1, int a2, __int64 a3, __int64 a4)
{
cocos2d::CCMenuItem *v8; // rsi
__int64 *v9; // rdi
__int64 v10; // rbx
__int64 v11; // rax
__int64 *v12; // rdi
__int64 v13; // rbx
__int64 v14; // rax
__int64 *v15; // rdi
__int64 v16; // rbx
__int64 v17; // rax
__int64 *v18; // rdi
__int64 v19; // rbx
__int64 v20; // rax
_QWORD v22[2]; // [rsp+20h] [rbp-28h] BYREF
v8 = (cocos2d::CCMenuItem *)operator new(0x190u);
v22[0] = v8;
cocos2d::CCMenuItem::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, 0, (int)v8, (__int64)CCMenuItemToggler::normalTouch);
*((_QWORD *)v8 + 48) = CCMenuItemSpriteExtra::create(a2, 0, (int)v8, (__int64)CCMenuItemToggler::selectedTouch);
(*(void (__fastcall **)(cocos2d::CCMenuItem *, _QWORD))(*(_QWORD *)v8 + 464LL))(v8, *((_QWORD *)v8 + 47));
(*(void (__fastcall **)(cocos2d::CCMenuItem *, _QWORD))(*(_QWORD *)v8 + 464LL))(v8, *((_QWORD *)v8 + 48));
v9 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 952LL))(*((_QWORD *)v8 + 47));
v10 = *v9;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, 0.5, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v10 + 288))(v9, v11);
v12 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 952LL))(*((_QWORD *)v8 + 48));
v13 = *v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v22, 0.5, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v13 + 288))(v12, v14);
v15 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 47) + 952LL))(*((_QWORD *)v8 + 47));
v16 = *v15;
v17 = cocos2d::CCNode::convertToNodeSpace(*((_QWORD *)v8 + 47), v22, &unk_140909A80);
(*(void (__fastcall **)(__int64 *, __int64))(v16 + 184))(v15, v17);
v18 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 48) + 952LL))(*((_QWORD *)v8 + 48));
v19 = *v18;
v20 = cocos2d::CCNode::convertToNodeSpace(*((_QWORD *)v8 + 48), v22, &unk_140909A80);
(*(void (__fastcall **)(__int64 *, __int64))(v19 + 184))(v18, v20);
*((_BYTE *)v8 + 393) = 0;
CCMenuItemToggler::toggle(v8, 0);
cocos2d::CCObject::autorelease(v8);
return v8;
}
else
{
(*(void (__fastcall **)(cocos2d::CCMenuItem *, __int64))(*(_QWORD *)v8 + 8LL))(v8, 1);
return nullptr;
}
}