//
// SetupTriggerPopup::addCustomButton from 0x9e6e0c to 0x9e6f2c (288 bytes)
//
// 3 xrefs:
// > GJRateLevelLayer::init @ 0x823178
// > GJRateLevelLayer::init @ 0x8231dc
// > ??> @ 0x40410
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void SetupTriggerPopup::addCustomButton(
SetupTriggerPopup *a1,
int a2,
ButtonSprite *a3,
cocos2d::CCPoint a4,
int a5,
int a6)
{
int v6; // w5
const cocos2d::CCPoint *v7; // x26
int v9; // w23
cocos2d::CCArray *PageContainer; // x24
cocos2d::CCArray *GroupContainer; // x25
CCMenuItemSpriteExtra *v13; // x19
cocos2d::CCMenu *m_buttonMenu; // x0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
_BYTE v17[8]; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v18; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v19; // 0:x2.16
v7 = *(const cocos2d::CCPoint **)&a5;
v9 = v6;
PageContainer = SetupTriggerPopup::getPageContainer(a1, a6);
GroupContainer = SetupTriggerPopup::getGroupContainer(a1, v9);
v19.adj = 1392;
v19.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v13 = CCMenuItemSpriteExtra::create(a3, nullptr, v19);
v13->setTag(v13, a2);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v13);
m_buttonMenu = a1->m_buttonMenu;
setPosition = v13->setPosition;
v18 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, v7);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _BYTE *, float, float))setPosition)(v13, v17, v18.x, v18.y);
cocos2d::CCArray::addObject(PageContainer, v13);
if ( v9 > 0 )
cocos2d::CCArray::addObject(GroupContainer, v13);
}