//
// sub_1000BEFC8 from 0x1000befc8 to 0x1000bf3f4 (1068 bytes)
//
// 2 xrefs:
// > sub_10009B1F0 @ 0x10009b470
// > sub_10009B79C @ 0x10009b844
//
// 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:58:46 +0000
//
__int64 __fastcall sub_1000BEFC8(__int64 a1)
{
__int64 v2; // x0
int v3; // w19
__int64 v4; // x0
int v5; // w21
__int64 v6; // x0
int v7; // w22
__int64 v8; // x0
char *CString; // x0
_QWORD *v10; // x0
__int64 v11; // x0
char *v12; // x0
std::string::size_type size; // x8
__int64 v14; // x0
char v15; // w24
__int64 v16; // x0
char v17; // w23
__int64 v18; // x0
char *v19; // x0
__int64 v20; // x0
char *v21; // x0
_QWORD *v22; // x0
__int64 v23; // x20
std::string v25; // [xsp+0h] [xbp-170h] BYREF
std::string v26; // [xsp+20h] [xbp-150h] BYREF
std::string __dst; // [xsp+40h] [xbp-130h] BYREF
std::string __str; // [xsp+60h] [xbp-110h] BYREF
void *v29[2]; // [xsp+80h] [xbp-F0h] BYREF
char v30; // [xsp+97h] [xbp-D9h]
std::string v31; // [xsp+98h] [xbp-D8h] BYREF
void *__p[2]; // [xsp+B0h] [xbp-C0h] BYREF
char v33; // [xsp+C7h] [xbp-A9h]
std::string v34; // [xsp+C8h] [xbp-A8h] BYREF
std::string v35; // [xsp+E0h] [xbp-90h] BYREF
void *v36; // [xsp+100h] [xbp-70h] BYREF
char v37; // [xsp+117h] [xbp-59h]
std::string v38; // [xsp+118h] [xbp-58h] BYREF
sub_100009900(&v38, "1");
v2 = cocos2d::CCDictionary::valueForKey(a1, &v38);
v3 = cocos2d::CCString::intValue(v2);
if ( SHIBYTE(v38.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v38.__r_.__value_.__l.__data_);
sub_100009900(&v38, "2");
v4 = cocos2d::CCDictionary::valueForKey(a1, &v38);
v5 = cocos2d::CCString::intValue(v4);
if ( SHIBYTE(v38.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v38.__r_.__value_.__l.__data_);
sub_100009900(&v38, "3");
v6 = cocos2d::CCDictionary::valueForKey(a1, &v38);
v7 = cocos2d::CCString::intValue(v6);
if ( SHIBYTE(v38.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v38.__r_.__value_.__l.__data_);
sub_100009900(&v35, "4");
v8 = cocos2d::CCDictionary::valueForKey(a1, &v35);
CString = (char *)cocos2d::CCString::getCString(v8);
v10 = sub_100009900(&v36, CString);
LevelTools::base64DecodeString(&v38, v10);
if ( v37 < 0 )
operator delete(v36);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v35.__r_.__value_.__l.__data_);
sub_100009900(&v34, "5");
v11 = cocos2d::CCDictionary::valueForKey(a1, &v34);
v12 = (char *)cocos2d::CCString::getCString(v11);
sub_100009900(&v35, v12);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
size = HIBYTE(v35.__r_.__value_.__r.__words[2]);
if ( (v35.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = v35.__r_.__value_.__l.__size_;
if ( size )
{
sub_100009900(__p, "14251");
cocos2d::ZipUtils::base64DecodeEnc(&v34, &v35, __p);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v35.__r_.__value_.__l.__data_);
v35 = v34;
*((_BYTE *)&v34.__r_.__value_.__s + 23) = 0;
v34.__r_.__value_.__s.__data_[0] = 0;
if ( v33 < 0 )
operator delete(__p[0]);
}
sub_100009900(&v34, "8");
v14 = cocos2d::CCDictionary::valueForKey(a1, &v34);
v15 = cocos2d::CCString::boolValue(v14);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
sub_100009900(&v34, "9");
v16 = cocos2d::CCDictionary::valueForKey(a1, &v34);
v17 = cocos2d::CCString::boolValue(v16);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
sub_100009900(&v31, "7");
v18 = cocos2d::CCDictionary::valueForKey(a1, &v31);
v19 = (char *)cocos2d::CCString::getCString(v18);
sub_100009900(&v34, v19);
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
sub_100009900(v29, "6");
v20 = cocos2d::CCDictionary::valueForKey(a1, v29);
v21 = (char *)cocos2d::CCString::getCString(v20);
v22 = sub_100009900(&v31, v21);
if ( v30 < 0 )
operator delete(v29[0]);
v23 = sub_1000D5220(v22);
*(_DWORD *)(v23 + 316) = v3;
*(_DWORD *)(v23 + 320) = v5;
*(_DWORD *)(v23 + 324) = v7;
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__str, v31.__r_.__value_.__l.__data_, v31.__r_.__value_.__l.__size_);
else
__str = v31;
std::string::operator=((std::string *)(v23 + 376), &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( SHIBYTE(v38.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__dst, v38.__r_.__value_.__l.__data_, v38.__r_.__value_.__l.__size_);
else
__dst = v38;
std::string::operator=((std::string *)(v23 + 328), &__dst);
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v26, v35.__r_.__value_.__l.__data_, v35.__r_.__value_.__l.__size_);
else
v26 = v35;
std::string::operator=((std::string *)(v23 + 352), &v26);
if ( SHIBYTE(v26.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v26.__r_.__value_.__l.__data_);
*(_BYTE *)(v23 + 424) = v15;
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v25, v34.__r_.__value_.__l.__data_, v34.__r_.__value_.__l.__size_);
else
v25 = v34;
std::string::operator=((std::string *)(v23 + 400), &v25);
if ( SHIBYTE(v25.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v25.__r_.__value_.__l.__data_);
*(_BYTE *)(v23 + 425) = v17;
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v35.__r_.__value_.__l.__data_);
if ( SHIBYTE(v38.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v38.__r_.__value_.__l.__data_);
return v23;
}