//
// cocos2d::CCMenu::createWithItems from 0x100873690 to 0x1008737b4 (292 bytes)
//
// 1 xrefs:
// > sub_1008735E0 @ 0x10087366b
//
// 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:51 +0000
//
_QWORD *__fastcall cocos2d::CCMenu::createWithItems(__int64 a1, unsigned int *a2)
{
unsigned int **v3; // rbx
unsigned __int64 v4; // rcx
__int64 *v5; // rax
__int64 v6; // rsi
__int64 *v7; // rax
_QWORD *v8; // r14
if ( a1 )
{
v3 = sub_1007FEAB0(a1, 0);
v4 = *a2;
if ( v4 > 0x28 )
goto LABEL_5;
while ( 1 )
{
v5 = (__int64 *)(*((_QWORD *)a2 + 2) + v4);
*a2 = v4 + 8;
v6 = *v5;
if ( !*v5 )
break;
while ( 1 )
{
sub_1007FEBF0((__int64)v3, v6);
v4 = *a2;
if ( v4 <= 0x28 )
break;
LABEL_5:
v7 = *((__int64 **)a2 + 1);
*((_QWORD *)a2 + 1) = v7 + 1;
v6 = *v7;
if ( !*v7 )
goto LABEL_9;
}
}
}
else
{
v3 = nullptr;
}
LABEL_9:
v8 = operator new(0x1B8u);
cocos2d::CCLayerRGBA::CCLayerRGBA((__int64)v8);
*v8 = off_100BA0578;
v8[40] = off_100BA0A88;
v8[41] = &off_100BA0AF8;
v8[42] = off_100BA0B10;
v8[43] = off_100BA0B30;
v8[44] = off_100BA0B58;
v8[51] = off_100BA0B88;
v8[54] = 0;
if ( (unsigned __int8)cocos2d::CCMenu::initWithArray(v8, v3) )
{
cocos2d::CCObject::autorelease((__int64)v8);
}
else
{
(*(void (__fastcall **)(_QWORD *))(*v8 + 16LL))(v8);
return nullptr;
}
return v8;
}