//
// MoreSearchLayer::createToggleButton from 0x1000565e8 to 0x10005684c (612 bytes)
//
// 11 xrefs:
// > MoreSearchLayer::init @ 0x1000557b4
// > MoreSearchLayer::init @ 0x10005582c
// > MoreSearchLayer::init @ 0x10005589c
// > MoreSearchLayer::init @ 0x10005590c
// > MoreSearchLayer::init @ 0x100055978
// > MoreSearchLayer::init @ 0x1000559e4
// > MoreSearchLayer::init @ 0x100055a5c
// > MoreSearchLayer::init @ 0x100055ac8
// > MoreSearchLayer::init @ 0x100055b34
// > MoreSearchLayer::init @ 0x100055bac
// > MoreSearchLayer::init @ 0x100055c18
//
// 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 MoreSearchLayer::createToggleButton(
__int64 a1,
const char *a2,
void (__cdecl *a3)(cocos2d::CCObject *),
size_t a4,
bool a5,
cocos2d::CCNode *a6,
cocos2d::CCPoint *a7)
{
cocos2d::CCSprite *v14; // x22
cocos2d::CCSprite *v15; // x27
CCMenuItemToggler *v16; // x19
cocos2d::CCLabelBMFont *v17; // x21
__n128 v18; // q0
__n128 v19; // q1
__n128 v20; // q0
__n128 v21; // q1
double v22; // d0
__n128 v23; // q0
float *v24; // x0
float32x2_t v26; // [xsp+0h] [xbp-70h] BYREF
float32x2_t v27; // [xsp+8h] [xbp-68h] BYREF
cocos2d::CCPoint v28; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v29; // 0:x3.16
v14 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v14->setScale)(v14, 0.8);
((void (__fastcall *)(cocos2d::CCSprite *, float))v15->setScale)(v15, 0.8);
v29.ptr = a3;
v29.adj = a4;
v16 = CCMenuItemToggler::create(v14, v15, (cocos2d::CCObject *)a1, v29);
CCMenuItemToggler::toggle(v16, a5);
((void (__fastcall *)(cocos2d::CCNode *, CCMenuItemToggler *))a6->addChild)(a6, v16);
v28 = cocos2d::CCNode::convertToNodeSpace(a6, a7);
((void (__fastcall *)(CCMenuItemToggler *, float32x2_t *, float, float))v16->setPosition)(v16, &v27, v28.x, v28.y);
CCMenuItemToggler::setSizeMult(v16, 1.5);
if ( a2[23] < 0 )
a2 = *(const char **)a2;
v17 = cocos2d::CCLabelBMFont::create_1(a2, "bigFont.fnt");
v18 = ((__n128 (__fastcall *)(_QWORD, cocos2d::CCLabelBMFont *))*(_QWORD *)(**(_QWORD **)(a1 + 576) + 440LL))(
*(_QWORD *)(a1 + 576),
v17);
v18.n128_u32[0] = 0;
v19.n128_u32[0] = 0.5;
sub_100022980(v18, v19, &v27);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v17->setAnchorPoint)(v17, &v27);
v20.n128_f32[0] = (float)((float)(*(float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v14->getContentSize)(v14)
* 0.5)
* 0.8)
+ 8.0;
v21.n128_u32[0] = 0;
sub_100022980(v20, v21, &v26);
*(float32x2_t *)&v22 = sub_1000229DC((float32x2_t *)a7, &v26, &v27);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *, double))v17->setPosition)(v17, &v27, v22);
v23.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v17->getContentSize)(v17);
if ( v23.n128_f32[0] > 80.0 )
{
v24 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v17->getContentSize)(v17, v23.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v17->setScale)(v17, 80.0 / *v24);
}
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v17->getScale)(v17, v23) <= 0.35 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v17->getScale)(v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v17->setScale)(v17);
return v16;
}