//
// cocos2d::CCTextureCache::addUIImage from 0x10013d224 to 0x10013d364 (320 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystem::initWithDictionary @ 0x100227628
// > cocos2d::CCSprite::setTexture @ 0x1002d6360
//
// 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:59:30 +0000
//
__int64 __fastcall cocos2d::CCTextureCache::addUIImage(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v6; // x0
__int64 v7; // x22
char *v8; // x1
__int64 v9; // x0
__int64 v10; // x22
__int64 v11; // x19
char *v12; // x1
void *v14[2]; // [xsp+8h] [xbp-58h] BYREF
__int64 v15; // [xsp+18h] [xbp-48h]
void *__p[2]; // [xsp+20h] [xbp-40h] BYREF
__int64 v17; // [xsp+30h] [xbp-30h]
__p[0] = nullptr;
__p[1] = nullptr;
v17 = 0;
if ( a3 )
{
v6 = cocos2d::CCFileUtils::sharedFileUtils(a1);
(*(void (__fastcall **)(void **__return_ptr, __int64, __int64, _QWORD))(*(_QWORD *)v6 + 48LL))(v14, v6, a3, 0);
if ( SHIBYTE(v17) < 0 )
operator delete(__p[0]);
*(_OWORD *)__p = *(_OWORD *)v14;
v17 = v15;
v7 = *(_QWORD *)(a1 + 56);
if ( v15 >= 0 )
v8 = (char *)__p;
else
v8 = (char *)v14[0];
sub_100009900(v14, v8);
v9 = cocos2d::CCDictionary::objectForKey(v7, v14);
v10 = v9;
if ( SHIBYTE(v15) < 0 )
{
operator delete(v14[0]);
if ( v10 )
goto LABEL_18;
}
else if ( v9 )
{
goto LABEL_18;
}
}
v10 = (__int64)operator new(0x68u);
j_cocos2d::CCTexture2D::CCTexture2D();
cocos2d::CCTexture2D::initWithImage(v10, a2);
if ( a3 )
{
v11 = *(_QWORD *)(a1 + 56);
if ( v17 >= 0 )
v12 = (char *)__p;
else
v12 = (char *)__p[0];
sub_100009900(v14, v12);
cocos2d::CCDictionary::setObject(v11, v10, v14);
if ( SHIBYTE(v15) < 0 )
operator delete(v14[0]);
cocos2d::CCObject::autorelease(v10);
}
LABEL_18:
if ( SHIBYTE(v17) < 0 )
operator delete(__p[0]);
return v10;
}