//
// ButtonPage::init from 0x100421550 to 0x1004216b8 (360 bytes)
//
// 1 xrefs:
// > ButtonPage::create @ 0x100421490
//
// 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!
bool __fastcall ButtonPage::init(ButtonPage *a1, cocos2d::CCArray *a2, cocos2d::CCPoint a3, int a4, float a5)
{
int v5; // w3
float x; // s8
int v7; // w19
float *v8; // x23
_BOOL4 v11; // w21
cocos2d::CCMenu *v12; // x22
float v13; // s9
float v14; // s11
unsigned int v15; // w23
float v16; // s9
float v17; // s11
float v18; // s8
__int64 v19; // x24
__n128 v20; // q0
__n128 v21; // q1
__int64 v23; // [xsp+0h] [xbp-80h] BYREF
cocos2d::CCPoint v24; // [xsp+8h] [xbp-78h] BYREF
cocos2d::CCPoint v25; // 0:kr00_8.8
x = a3.x;
v7 = v5;
v8 = *(float **)&a4;
v11 = cocos2d::CCLayer::init(a1);
if ( v11 )
{
v12 = cocos2d::CCMenu::create();
((void (__fastcall *)(ButtonPage *, cocos2d::CCMenu *))a1->addChild)(a1, v12);
v14 = *v8;
v13 = v8[1];
if ( (unsigned int)sub_10024A36C((__int64)a2) )
{
v15 = 0;
v16 = v13 - (float)(x * 0.5);
v17 = (float)(x * 0.5)
+ (float)((float)(v14 + (float)((float)((float)v7 * -0.5) * x))
+ (float)((float)((float)(v7 - 1) * -0.5) * 4.0));
v18 = x + 4.0;
do
{
v19 = sub_10024A388((__int64)a2, v15);
v20 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, __int64))v12->addChild)(v12, v19);
v20.n128_f32[0] = v17 + (float)((float)(unsigned int)((int)v15 % v7) * v18);
v21.n128_f32[0] = v16 - (float)((float)(int)floorf((float)v15 / (float)v7) * v18);
sub_100022980(v20, v21, &v24);
v25 = cocos2d::CCNode::convertToNodeSpace(v12, &v24);
(*(void (__fastcall **)(__int64, __int64 *, float, float))(*(_QWORD *)v19 + 184LL))(v19, &v23, v25.x, v25.y);
++v15;
}
while ( v15 < (unsigned int)sub_10024A36C((__int64)a2) );
}
}
return v11;
}