//
// sub_10004F820 from 0x10004f820 to 0x10004f924 (260 bytes)
//
// 2 xrefs:
// > GJKeybindManager::parseImportFile @ 0x10018df2c
// > MusicDownloadManager::importCustomSFXFromFile @ 0x1001d94c0
//
// 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:42 +0000
//
__int64 __fastcall sub_10004F820(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v6; // x0
int v7; // w9
const std::string::value_type *v8; // x1
std::string::size_type v9; // x2
std::string *v10; // x0
std::string::size_type v11; // x20
char v12; // w21
__int64 v13; // x8
std::string __p; // [xsp+0h] [xbp-50h] BYREF
_QWORD v16[2]; // [xsp+18h] [xbp-38h]
if ( *(char *)(a4 + 23) < 0 )
{
**(_BYTE **)a4 = 0;
*(_QWORD *)(a4 + 8) = 0;
}
else
{
*(_BYTE *)a4 = 0;
*(_BYTE *)(a4 + 23) = 0;
}
v6 = cocos2d::CCFileUtils::sharedFileUtils(a1);
(*(void (__fastcall **)(std::string *__return_ptr))(*(_QWORD *)v6 + 144LL))(&__p);
v7 = *(char *)(a3 + 23);
if ( v7 >= 0 )
v8 = (const std::string::value_type *)a3;
else
v8 = *(const std::string::value_type **)a3;
if ( v7 >= 0 )
v9 = *(unsigned __int8 *)(a3 + 23);
else
v9 = *(_QWORD *)(a3 + 8);
v10 = std::string::append(&__p, v8, v9);
v11 = v10->__r_.__value_.__r.__words[0];
v16[0] = v10->__r_.__value_.__l.__size_;
*(_QWORD *)((char *)v16 + 7) = *(std::string::size_type *)((char *)&v10->__r_.__value_.__r.__words[1] + 7);
v12 = HIBYTE(v10->__r_.__value_.__r.__words[2]);
v10->__r_.__value_.__l.__size_ = 0;
v10->__r_.__value_.__r.__words[2] = 0;
v10->__r_.__value_.__r.__words[0] = 0;
if ( *(char *)(a4 + 23) < 0 )
operator delete(*(void **)a4);
v13 = v16[0];
*(_QWORD *)a4 = v11;
*(_QWORD *)(a4 + 8) = v13;
*(_QWORD *)(a4 + 15) = *(_QWORD *)((char *)v16 + 7);
*(_BYTE *)(a4 + 23) = v12;
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
return 1;
}