//
// cocos2d::CCMenu::initWithArray from 0x1008738a0 to 0x100873a1c (380 bytes)
//
// 3 xrefs:
// > cocos2d::CCMenu::createWithItems @ 0x10087378d
// > cocos2d::CCMenu::createWithArray @ 0x10087385e
// > cocos2d::CCMenu::init @ 0x100873a37
//
// 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 12:36:52 +0000
//
bool __fastcall cocos2d::CCMenu::initWithArray(__int64 a1, __int64 a2)
{
bool result; // al
bool v3; // r13
__int64 v4; // rax
unsigned int *v5; // rax
_QWORD *v6; // r15
unsigned __int64 v7; // r12
unsigned int v8; // r14d
float v9; // [rsp+8h] [rbp-38h] BYREF
_QWORD v10[6]; // [rsp+10h] [rbp-30h] BYREF
result = cocos2d::CCLayer::init((_WORD *)a1);
if ( result )
{
v3 = result;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1024LL))(a1, 4294967168LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1008LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
*(_BYTE *)(a1 + 426) = 1;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v10, v4);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 440LL))(a1, 1);
sub_100278250(&v9, 0.5, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)a1 + 296LL))(a1, &v9);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)a1 + 320LL))(a1, v10);
sub_100278250(&v9, *(float *)v10 * 0.5, 0.5 * *((float *)v10 + 1));
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)a1 + 184LL))(a1, &v9);
if ( a2 )
{
v5 = *(unsigned int **)(a2 + 56);
if ( *v5 )
{
v6 = *((_QWORD **)v5 + 2);
v7 = (unsigned __int64)&v6[*v5 - 1];
v8 = 0;
do
{
if ( !*v6 )
break;
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)a1 + 464LL))(a1, *v6++, v8++);
}
while ( (unsigned __int64)v6 <= v7 );
}
}
*(_QWORD *)(a1 + 432) = 0;
*(_DWORD *)(a1 + 428) = 0;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1240LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1192LL))(a1, 1);
return v3;
}
return result;
}