//
// sub_100058C00 from 0x100058c00 to 0x100058ca0 (160 bytes)
//
// 1 xrefs:
// > CustomizeObjectSettingsPopup::onClose @ 0x1000598e8
//
// This function is hookable on this platform (idp: arm, 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 10:57:46 +0000
//
__int64 __fastcall sub_100058C00(__int64 a1)
{
__int64 v2; // x20
__int64 v3; // x19
__int64 v4; // x0
__int64 v5; // x0
void *v6; // x0
__int64 result; // x0
v2 = *(_QWORD *)(a1 + 688);
v3 = *(_QWORD *)(a1 + 696);
if ( v2 )
cocos2d::CCObject::retain(*(_QWORD *)(a1 + 688));
if ( v3 )
cocos2d::CCObject::retain(v3);
v4 = cocos2d::CCDirector::sharedDirector(a1);
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 160LL))(v4);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v5, a1);
CustomizeObjectLayer::onClose(a1);
v6 = CustomizeObjectLayer::create(v2, v3);
result = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v6 + 1312LL))(v6);
if ( v2 )
result = cocos2d::CCObject::release(v2);
if ( v3 )
return cocos2d::CCObject::release(v3);
return result;
}