//
// ButtonPage::create from 0x140177dc0 to 0x140178015 (597 bytes)
//
// 2 xrefs:
// > EditButtonBar::loadFromItems @ 0x14017740a
// > ??> @ 0x140918668
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:27:33 +0000
//
// Hidden C++ exception states: #wind=1
cocos2d::CCLayer *__fastcall ButtonPage::create(
cocos2d::CCArray *a1,
const struct cocos2d::CCPoint *a2,
int a3,
float a4)
{
cocos2d::CCLayer *v7; // rsi
float *v8; // rax
float *v9; // rbx
__int64 v10; // rcx
__int64 v11; // r14
float v12; // xmm10_4
float v13; // xmm8_4
signed int i; // ebp
struct cocos2d::CCObject *v15; // rdi
float v16; // xmm0_4
__int64 v17; // rbx
__int64 v18; // rax
cocos2d::CCLayer *v20; // [rsp+20h] [rbp-88h] BYREF
_BYTE v21[8]; // [rsp+28h] [rbp-80h] BYREF
_BYTE v22[64]; // [rsp+30h] [rbp-78h] BYREF
v7 = (cocos2d::CCLayer *)operator new(0x198u);
v20 = v7;
cocos2d::CCLayer::CCLayer(v7);
*(_QWORD *)v7 = &ButtonPage::`vftable';
*((_QWORD *)v7 + 40) = &ButtonPage::`vftable';
*((_QWORD *)v7 + 41) = &ButtonPage::`vftable';
*((_QWORD *)v7 + 42) = &ButtonPage::`vftable';
*((_QWORD *)v7 + 43) = &ButtonPage::`vftable';
*((_QWORD *)v7 + 44) = &ButtonPage::`vftable';
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, a2);
v9 = v8;
if ( cocos2d::CCLayer::init(v7) )
{
v11 = cocos2d::CCMenu::create(v10);
(*(void (__fastcall **)(cocos2d::CCLayer *, __int64))(*(_QWORD *)v7 + 464LL))(v7, v11);
v12 = v9[1] - (float)(a4 * 0.5);
v13 = (float)(*v9 - (float)((float)((float)a3 * 0.5) * a4)) - (float)((float)((float)(a3 - 1) * 0.5) * 4.0);
for ( i = 0; i < cocos2d::CCArray::count(a1); ++i )
{
v15 = cocos2d::CCArray::objectAtIndex(a1, i);
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *))(*(_QWORD *)v11 + 464LL))(v11, v15);
v16 = floorf((float)i / (float)a3);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v20,
(float)((float)(i % a3) * (float)(a4 + 4.0)) + (float)((float)(a4 * 0.5) + v13),
v12 - (float)((float)(int)v16 * (float)(a4 + 4.0)));
v17 = *(_QWORD *)v15;
cocos2d::CCNode::convertToNodeSpace(v11, v22, &v20);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v17 + 184))(v15, v18);
}
cocos2d::CCObject::autorelease(v7);
return v7;
}
else
{
(*(void (__fastcall **)(cocos2d::CCLayer *, __int64))(*(_QWORD *)v7 + 8LL))(v7, 1);
return nullptr;
}
}