//
// GJEditorSoundConfig::create from 0x100906a30 to 0x100907233 (2051 bytes)
//
// 2 xrefs:
// > sub_100530410 @ 0x10053073e
// > sub_10055C1A0 @ 0x10055c39b
//
// This function is hookable on this platform (idp: pc, 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 12:38:05 +0000
//
char *__fastcall GJEditorSoundConfig::create(__int64 a1)
{
char *v1; // rbx
void *v2; // rax
void *v3; // rax
const char *CString; // r15
size_t v5; // rax
std::string::size_type v6; // r12
char *data; // r13
size_t v8; // r14
__int64 v9; // r14
void *v10; // rax
const char *v11; // r15
size_t v12; // rax
std::string::size_type v13; // r12
char *v14; // r13
size_t v15; // r14
__int64 v16; // r14
void *v17; // rax
void *v18; // rax
void *v19; // rax
const char *v20; // r15
size_t v21; // rax
std::string::size_type v22; // r12
char *v23; // r13
size_t v24; // r14
__int64 v25; // r14
void *v26; // rax
void *v27; // rax
void *v28; // rax
void *v29; // rax
void *v30; // rax
void *v31; // rax
void *v32; // rax
void *v33; // rax
void *v34; // rax
const char *v35; // r15
size_t v36; // rax
std::string::size_type v37; // r12
char *v38; // r13
size_t v39; // r14
__int64 v40; // r14
void *v41; // rax
const char *v42; // r14
size_t v43; // rax
size_t v44; // r15
char *v45; // r12
char v46; // r15
size_t v47; // r13
char v49; // [rsp+8h] [rbp-D8h] BYREF
char v50[15]; // [rsp+9h] [rbp-D7h] BYREF
void *v51; // [rsp+18h] [rbp-C8h]
std::string v52; // [rsp+20h] [rbp-C0h] BYREF
std::string __dst; // [rsp+38h] [rbp-A8h] BYREF
std::string __str; // [rsp+50h] [rbp-90h] BYREF
std::string v55; // [rsp+68h] [rbp-78h] BYREF
std::string v56; // [rsp+80h] [rbp-60h] BYREF
__int64 v57; // [rsp+98h] [rbp-48h]
__int128 v58; // [rsp+A0h] [rbp-40h] BYREF
void *__p; // [rsp+B0h] [rbp-30h]
v1 = (char *)operator new(0x1F8u);
cocos2d::CCNode::CCNode((__int64)v1);
*(_QWORD *)v1 = off_100BBE9B8;
*(_QWORD *)(v1 + 316) = 0;
v1[324] = 0;
*(_OWORD *)(v1 + 328) = 0;
*(_OWORD *)(v1 + 344) = 0;
*(_OWORD *)(v1 + 357) = 0;
*(_OWORD *)(v1 + 376) = 0;
*(_OWORD *)(v1 + 392) = 0;
*(_OWORD *)(v1 + 408) = 0;
*(_OWORD *)(v1 + 424) = 0;
*(_OWORD *)(v1 + 440) = 0;
*(_OWORD *)(v1 + 456) = 0;
*(_OWORD *)(v1 + 472) = 0;
*(_OWORD *)(v1 + 482) = 0;
if ( !cocos2d::CCNode::init() )
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v1 + 16LL))(v1);
return nullptr;
}
cocos2d::CCObject::autorelease((__int64)v1);
if ( a1 )
{
LOWORD(v58) = 12546;
BYTE2(v58) = 0;
v2 = cocos2d::CCDictionary::valueForKey(a1, (__int64)&v58);
*((_DWORD *)v1 + 79) = cocos2d::CCString::intValue((__int64)v2);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOWORD(v58) = 12802;
BYTE2(v58) = 0;
v57 = a1;
v3 = cocos2d::CCDictionary::valueForKey(a1, (__int64)&v58);
CString = (const char *)cocos2d::CCString::getCString((__int64)v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
data = (char *)operator new(v8);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v8 | 1;
__dst.__r_.__value_.__l.__size_ = v6;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v5);
data = __dst.__r_.__value_.__s.__data_;
if ( !v5 )
{
LABEL_14:
data[v6] = 0;
std::string::operator=((std::string *)(v1 + 376), &__dst);
v9 = v57;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOWORD(v58) = 13058;
BYTE2(v58) = 0;
v10 = cocos2d::CCDictionary::valueForKey(v9, (__int64)&v58);
v11 = (const char *)cocos2d::CCString::getCString((__int64)v10);
v12 = strlen(v11);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v13 = v12;
if ( v12 >= 0x17 )
{
v15 = 26;
if ( (v12 | 7) != 0x17 )
v15 = (v12 | 7) + 1;
v14 = (char *)operator new(v15);
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)v14;
__str.__r_.__value_.__r.__words[0] = v15 | 1;
__str.__r_.__value_.__l.__size_ = v13;
}
else
{
__str.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v12);
v14 = __str.__r_.__value_.__s.__data_;
if ( !v12 )
{
LABEL_26:
v14[v13] = 0;
std::string::operator=((std::string *)(v1 + 400), &__str);
v16 = v57;
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOWORD(v58) = 13570;
BYTE2(v58) = 0;
v17 = cocos2d::CCDictionary::valueForKey(v16, (__int64)&v58);
*((_DWORD *)v1 + 82) = cocos2d::CCString::intValue((__int64)v17);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 14644;
BYTE3(v58) = 0;
v18 = cocos2d::CCDictionary::valueForKey(v16, (__int64)&v58);
*((_DWORD *)v1 + 85) = cocos2d::CCString::intValue((__int64)v18);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 12341;
BYTE3(v58) = 0;
v19 = cocos2d::CCDictionary::valueForKey(v16, (__int64)&v58);
v20 = (const char *)cocos2d::CCString::getCString((__int64)v19);
v21 = strlen(v20);
if ( v21 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v22 = v21;
if ( v21 >= 0x17 )
{
v24 = 26;
if ( (v21 | 7) != 0x17 )
v24 = (v21 | 7) + 1;
v23 = (char *)operator new(v24);
v55.__r_.__value_.__r.__words[2] = (std::string::size_type)v23;
v55.__r_.__value_.__r.__words[0] = v24 | 1;
v55.__r_.__value_.__l.__size_ = v22;
}
else
{
v55.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v21);
v23 = v55.__r_.__value_.__s.__data_;
if ( !v21 )
{
LABEL_42:
v23[v22] = 0;
std::string::operator=((std::string *)(v1 + 448), &v55);
v25 = v57;
if ( (*(_BYTE *)&v55.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v55.__r_.__value_.__l.__data_);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 12337;
BYTE3(v58) = 0;
v26 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 86) = cocos2d::CCString::intValue((__int64)v26);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 13361;
BYTE3(v58) = 0;
v27 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 87) = cocos2d::CCString::intValue((__int64)v27);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 14641;
BYTE3(v58) = 0;
v28 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
v1[372] = cocos2d::CCString::boolValue((__int64)v28);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 14386;
BYTE3(v58) = 0;
v29 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 91) = cocos2d::CCString::intValue((__int64)v29);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 14642;
BYTE3(v58) = 0;
v30 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 92) = cocos2d::CCString::intValue((__int64)v30);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 14645;
BYTE3(v58) = 0;
v31 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 88) = cocos2d::CCString::intValue((__int64)v31);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 12342;
BYTE3(v58) = 0;
v32 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 89) = cocos2d::CCString::intValue((__int64)v32);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 12598;
BYTE3(v58) = 0;
v33 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
*((_DWORD *)v1 + 90) = cocos2d::CCString::intValue((__int64)v33);
if ( (v58 & 1) != 0 )
operator delete(__p);
LOBYTE(v58) = 4;
*(_WORD *)((char *)&v58 + 1) = 13366;
BYTE3(v58) = 0;
v34 = cocos2d::CCDictionary::valueForKey(v25, (__int64)&v58);
v35 = (const char *)cocos2d::CCString::getCString((__int64)v34);
v36 = strlen(v35);
if ( v36 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v37 = v36;
if ( v36 >= 0x17 )
{
v39 = 26;
if ( (v36 | 7) != 0x17 )
v39 = (v36 | 7) + 1;
v38 = (char *)operator new(v39);
v56.__r_.__value_.__r.__words[2] = (std::string::size_type)v38;
v56.__r_.__value_.__r.__words[0] = v39 | 1;
v56.__r_.__value_.__l.__size_ = v37;
}
else
{
v56.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v36);
v38 = v56.__r_.__value_.__s.__data_;
if ( !v36 )
{
LABEL_70:
v38[v37] = 0;
std::string::operator=((std::string *)(v1 + 424), &v56);
v40 = v57;
if ( (*(_BYTE *)&v56.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v56.__r_.__value_.__l.__data_);
if ( (v58 & 1) != 0 )
operator delete(__p);
v49 = 4;
strcpy(v50, "51");
v41 = cocos2d::CCDictionary::valueForKey(v40, (__int64)&v49);
v42 = (const char *)cocos2d::CCString::getCString((__int64)v41);
v43 = strlen(v42);
if ( v43 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v44 = v43;
if ( v43 >= 0x17 )
{
v47 = 26;
if ( (v43 | 7) != 0x17 )
v47 = (v43 | 7) + 1;
v45 = (char *)operator new(v47);
__p = v45;
*(_QWORD *)&v58 = v47 | 1;
*((_QWORD *)&v58 + 1) = v44;
}
else
{
LOBYTE(v58) = 2 * v43;
v45 = (char *)&v58 + 1;
if ( !v43 )
{
BYTE1(v58) = 0;
if ( (v49 & 1) == 0 )
{
LABEL_79:
v46 = v58;
if ( (v58 & 1) != 0 )
{
sub_10001AD30(&v52, __p, *((unsigned __int64 *)&v58 + 1));
}
else
{
v52.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&v52.__r_.__value_.__l.0 = v58;
}
std::string::operator=((std::string *)(v1 + 472), &v52);
if ( (*(_BYTE *)&v52.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v52.__r_.__value_.__l.__data_);
if ( (v46 & 1) != 0 )
{
v1[496] = *((_QWORD *)&v58 + 1) != 0;
operator delete(__p);
}
else
{
v1[496] = v46 != 0;
}
return v1;
}
LABEL_78:
operator delete(v51);
goto LABEL_79;
}
}
memmove(v45, v42, v44);
v45[v44] = 0;
if ( (v49 & 1) == 0 )
goto LABEL_79;
goto LABEL_78;
}
}
memmove(v38, v35, v37);
goto LABEL_70;
}
}
memmove(v23, v20, v22);
goto LABEL_42;
}
}
memmove(v14, v11, v13);
goto LABEL_26;
}
}
memmove(data, CString, v6);
goto LABEL_14;
}
return v1;
}