//
// cocos2d::CCMenu::initWithArray from 0x18005b470 to 0x18005b5f9 (393 bytes)
//
// 6 xrefs:
// > cocos2d::CCMenu::createWithArray @ 0x18005b2eb
// > cocos2d::CCMenu::init @ 0x18005b462
// > ??> @ 0x180141b94
// > ??> @ 0x180141bec
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bcd9c
//
// 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:21:49 +0000
//
char __fastcall cocos2d::CCMenu::initWithArray(cocos2d::CCMenu *this, struct cocos2d::CCArray *a2)
{
__int64 v4; // rdx
struct cocos2d::CCDirector *v5; // rax
__int64 v6; // rdx
__int64 v7; // rbx
float *v8; // rax
__int64 v9; // rbx
float *v10; // rax
__int64 v11; // rdx
unsigned int *v12; // rbx
unsigned int v13; // esi
__int64 v14; // rax
__int64 *v15; // rbx
__int64 *i; // rbp
__int64 v17; // rax
__int64 v18; // rdx
float v20; // [rsp+60h] [rbp+18h] BYREF
float v21; // [rsp+64h] [rbp+1Ch]
float v22; // [rsp+68h] [rbp+20h] BYREF
if ( !cocos2d::CCLayer::init(this) )
return 0;
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64))(*(_QWORD *)this + 944LL))(this, 4294967168LL);
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64))(*(_QWORD *)this + 928LL))(this, 1);
LOBYTE(v4) = 1;
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64))(*(_QWORD *)this + 920LL))(this, v4);
*((_BYTE *)this + 432) = 1;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5, &v20);
LOBYTE(v6) = 1;
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64))(*(_QWORD *)this + 432LL))(this, v6);
v7 = *(_QWORD *)this;
v8 = kmVec2Fill(&v22, 0.5, 0.5);
(*(void (__fastcall **)(cocos2d::CCMenu *, float *))(v7 + 288))(this, v8);
(*(void (__fastcall **)(cocos2d::CCMenu *, float *))(*(_QWORD *)this + 312LL))(this, &v20);
v9 = *(_QWORD *)this;
v10 = kmVec2Fill(&v22, v20 * 0.5, v21 * 0.5);
(*(void (__fastcall **)(cocos2d::CCMenu *, float *))(v9 + 184))(this, v10);
if ( a2 )
{
v12 = *((unsigned int **)a2 + 7);
v13 = 0;
v14 = *v12;
if ( (_DWORD)v14 )
{
v15 = *((__int64 **)v12 + 2);
for ( i = &v15[v14 - 1]; v15 <= i; ++v15 )
{
v11 = *v15;
if ( !*v15 )
break;
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64, _QWORD))(*(_QWORD *)this + 456LL))(this, v11, v13++);
}
}
}
v17 = *((_QWORD *)this + 51);
LOBYTE(v11) = 1;
*((_QWORD *)this + 55) = 0;
*((_DWORD *)this + 109) = 0;
(*(void (__fastcall **)(char *, __int64))(v17 + 72))((char *)this + 408, v11);
LOBYTE(v18) = 1;
(*(void (__fastcall **)(char *, __int64))(*((_QWORD *)this + 51) + 96LL))((char *)this + 408, v18);
return 1;
}