//
// sub_100399C98 from 0x100399c98 to 0x100399dcc (308 bytes)
//
// 3 xrefs:
// > sub_1001CCF08 @ 0x1001ccf4c
// > GJRobotSprite::init @ 0x1002dc4b8
// > sub_100399BD4 @ 0x100399c48
//
// 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 11:03:42 +0000
//
__int64 __fastcall sub_100399C98(std::string *a1, char *a2, _DWORD *a3, __int64 a4)
{
_DWORD *v5; // x22
__int64 v8; // x0
__int64 v9; // x22
__int64 v10; // x0
char *CString; // x0
void *v12; // x0
std::string *v13; // x1
__int64 v14; // x23
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
char v17; // [xsp+17h] [xbp-49h]
std::string v18; // [xsp+18h] [xbp-48h] BYREF
v5 = a3;
if ( !a3 )
{
v8 = ObjectManager::instance();
v9 = sub_1002EAFA8(v8, a2);
sub_100009900(__p, "spriteSheet");
v10 = cocos2d::CCDictionary::valueForKey(v9, __p);
CString = (char *)cocos2d::CCString::getCString(v10);
sub_100009900(&v18, CString);
if ( v17 < 0 )
operator delete(__p[0]);
std::string::append(&v18, ".png");
v12 = cocos2d::CCTextureCache::sharedTextureCache();
if ( (v18.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &v18;
else
v13 = (std::string *)v18.__r_.__value_.__r.__words[0];
v5 = cocos2d::CCTextureCache::addImage((__int64)v12, (char *)v13);
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}
sub_1000262CC((float *)&v18, 0.0, 0.0, 0.0, 0.0);
v14 = cocos2d::CCSprite::initWithTexture_1((__int64)a1, (__int64)v5, (__int64)&v18);
if ( (_DWORD)v14 )
{
a1[23].__r_.__value_.__s.__data_[7] = 1;
std::string::assign(a1 + 25, "");
sub_100399DFC(a1, a2, v5, a4);
}
return v14;
}