//
// SupportLayer::createToggleButton from 0x1404c9120 to 0x1404c9378 (600 bytes)
//
// 2 xrefs:
// > SupportLayer::customSetup @ 0x1404c8a65
// > ??> @ 0x1406dd2e0
//
// 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 *__fastcall SupportLayer::createToggleButton(
__int64 a1,
const char *a2,
__int64 a3,
bool a4,
cocos2d::CCNode *a5,
__int64 a6)
{
struct cocos2d::CCSprite *v9; // rbp
struct cocos2d::CCSprite *v10; // rbx
CCMenuItemToggler *v11; // r15
CCMenuItemToggler_vtbl *v12; // rbx
struct cocos2d::CCPoint v13; // rax
const char *v14; // rcx
struct cocos2d::CCLabelBMFont *v15; // rdi
float v16; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v17; // rbx
double v18; // xmm0_8
const cocos2d::CCPoint *v19; // rax
float *v20; // rax
cocos2d::CCLabelBMFont_vtbl *v21; // rbx
struct cocos2d::CCPoint v23[3]; // [rsp+20h] [rbp-68h] BYREF
v23[2] = (struct cocos2d::CCPoint)a2;
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setScale_0)(v9);
((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScale_0)(v10);
v11 = CCMenuItemToggler::create(
v9,
v10,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)SupportLayer::onLowDetail);
CCMenuItemToggler::toggle(v11, a4);
a5->addChild_1(a5, v11);
v12 = v11->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v13 = cocos2d::CCNode::convertToNodeSpace(a5, v23);
((void (__fastcall *)(CCMenuItemToggler *, struct cocos2d::CCPoint))v12->setPosition_0)(v11, v13);
*(_DWORD *)(*(_QWORD *)&v11->m_nScriptTapHandler + 372LL) = 1069547520;
HIDWORD(v11->m_offButton->m_pfnSelector.adj) = 1069547520;
CCMenuItemToggler::toggle(v11, (bool)v11->m_onButton);
v14 = a2;
if ( *((_QWORD *)a2 + 3) > 0xFu )
v14 = *(const char **)a2;
v15 = cocos2d::CCLabelBMFont::create(v14, &qword_14052A4D8);
v16 = (*(float (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 576) + 448LL))(
*(_QWORD *)(a1 + 576),
v15);
v17 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v18 = cocos2d::CCPoint::CCPoint(v16, 0.0);
v17->setAnchorPoint(v15, v19);
v20 = (float *)v9->getContentSize(v9);
cocos2d::CCPoint::CCPoint(*(float *)&v18, (float)((float)(*v20 * 0.5) * 0.80000001) + 8.0);
cocos2d::CCPoint::operator+(a6, v23);
v15->setPosition_0(v15, v23);
if ( v15->getContentSize(v15)->width > 120.0 )
{
v21 = v15->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v15->getContentSize(v15);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v21->setScale_0)(v15);
}
v15->getScale(v15);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v15->setScale_0)(v15);
sub_14003A830((__int64)a2);
return v11;
}