//
// cocos2d::CCMenuItemImage::create from 0x18005a870 to 0x18005a91a (170 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2cdc
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCMenuItemImage *__fastcall cocos2d::CCMenuItemImage::create()
{
cocos2d::CCMenuItemSprite *v0; // rax
cocos2d::CCMenuItemImage *v1; // rbx
bool (__stdcall *init)(cocos2d::CCMenuItemImage *__hidden); // rdx
char v3; // al
cocos2d::CCNodeRGBA *(__fastcall *v5)(cocos2d::CCNodeRGBA *, char); // r8
v0 = (cocos2d::CCMenuItemSprite *)operator new(0x190u);
v1 = (cocos2d::CCMenuItemImage *)v0;
if ( v0 )
{
cocos2d::CCMenuItemSprite::CCMenuItemSprite(v0);
v1->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (cocos2d::CCMenuItemImage_vtbl *)&cocos2d::CCMenuItemImage::`vftable'{for `cocos2d::CCNode'};
v1->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&cocos2d::CCMenuItemImage::`vftable'{for `cocos2d::CCRGBAProtocol'};
}
else
{
v1 = nullptr;
}
if ( v1 )
{
init = v1->init;
if ( (char *)init == (char *)cocos2d::CCMenuItemImage::init )
v3 = cocos2d::CCMenuItemImage::init(v1);
else
v3 = ((__int64 (__fastcall *)(cocos2d::CCMenuItemImage *))init)(v1);
if ( v3 )
{
cocos2d::CCObject::autorelease(v1);
return v1;
}
v5 = (cocos2d::CCNodeRGBA *(__fastcall *)(cocos2d::CCNodeRGBA *, char))v1->~CCMenuItemImage;
if ( v5 == sub_180059F50 )
{
sub_180059F50(v1, 1);
return nullptr;
}
v5(v1, 1);
}
return nullptr;
}