//
// ButtonPage::init from 0x1005e25a0 to 0x1005e2740 (416 bytes)
//
// 1 xrefs:
// > ButtonPage::create @ 0x1005e2457
//
// 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)
{
__int64 v5; // rcx
__int64 v6; // rbx
cocos2d::CCMenu *v7; // r12
int v8; // r13d
__m128 v9; // xmm0
int v10; // ebx
__int64 v11; // r15
char v13; // [rsp+0h] [rbp-70h] BYREF
float v14; // [rsp+8h] [rbp-68h] BYREF
__m128 v15; // [rsp+10h] [rbp-60h]
__int64 v16; // [rsp+28h] [rbp-48h]
float v17; // [rsp+34h] [rbp-3Ch]
float v18; // [rsp+38h] [rbp-38h]
float x; // [rsp+3Ch] [rbp-34h]
float v20; // [rsp+40h] [rbp-30h]
bool v21; // [rsp+47h] [rbp-29h]
x = a3.x;
v16 = v5;
v6 = *(_QWORD *)&a4;
v21 = cocos2d::CCLayer::init(a1);
if ( v21 )
{
v7 = cocos2d::CCMenu::create();
((void (__fastcall *)(ButtonPage *, cocos2d::CCMenu *, double, float))a1->addChild)(a1, v7, *(double *)&a3, a5);
v15.i32[0] = *(_DWORD *)v6;
v20 = *(float *)(v6 + 4);
if ( (unsigned int)sub_100720070(a2) )
{
v20 = v20 - (float)(0.5 * x);
v17 = (float)(int)v16;
v18 = (float)((float)((float)((float)(v16 - 1) * -0.5) * 4.0)
+ (float)((float)((float)(-0.5 * (float)(int)v16) * x) + v15.f32[0]))
+ (float)(0.5 * x);
x = x + 4.0;
v8 = 0;
do
{
v9 = 0;
v10 = v8 % (int)v16;
v9.f32[0] = (float)v8 / v17;
v15 = _mm_round_ss(v9, v9, 9);
v11 = sub_1007200C0(a2, (unsigned int)v8);
((void (__fastcall *)(cocos2d::CCMenu *, __int64))v7->addChild)(v7, v11);
sub_10028CBE0(
&v14,
(float)((float)v10 * x) + v18,
v20 - (float)(_mm_cvtepi32_ps(_mm_cvttps_epi32(v15)).f32[0] * x));
*(cocos2d::CCPoint *)v9.f32 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v13,
(const cocos2d::CCPoint *)v7);
(*(void (__fastcall **)(__int64, char *, double))(*(_QWORD *)v11 + 184LL))(v11, &v13, *(double *)v9.i64);
++v8;
}
while ( v8 < (unsigned int)sub_100720070(a2) );
}
}
return v21;
}