//
// sub_10065DF30 from 0x10065df30 to 0x10065e249 (793 bytes)
//
// 10 xrefs:
// > SongInfoObject::create_2 @ 0x10064cebd
// > SongInfoObject::create_2 @ 0x10064cffd
// > SongInfoObject::copyValues @ 0x10064d39d
// > SongInfoObject::copyValues @ 0x10064d43d
// > MusicDownloadManager::parseMusicLibrary @ 0x10065c2cd
// > MusicDownloadManager::parseMusicLibrary @ 0x10065c365
// > sub_1006644F0 @ 0x100664576
// > sub_100664580 @ 0x100664606
// > SongInfoObject::createWithCoder @ 0x100664d79
// > SongInfoObject::createWithCoder @ 0x100664e1c
//
// 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:34:55 +0000
//
void __fastcall sub_10065DF30(unsigned __int8 *a1, __int64 a2)
{
unsigned int v2; // eax
unsigned __int8 *v3; // r13
unsigned __int64 v4; // r14
void **v5; // r12
void **v6; // rbx
const std::string *v7; // r13
const char *data; // rdi
char v9; // al
void **v10; // rbx
void **v11; // r14
void *v12; // rdi
void **v13; // rbx
unsigned __int8 *v14; // rdi
__int128 v15; // [rsp+0h] [rbp-C0h] BYREF
void *v16; // [rsp+10h] [rbp-B0h]
__int64 v17; // [rsp+18h] [rbp-A8h]
_OWORD v18[2]; // [rsp+20h] [rbp-A0h] BYREF
__int128 v19; // [rsp+40h] [rbp-80h]
void *v20; // [rsp+50h] [rbp-70h]
void *v21[2]; // [rsp+60h] [rbp-60h] BYREF
__int64 v22; // [rsp+70h] [rbp-50h]
void *v23[2]; // [rsp+80h] [rbp-40h] BYREF
__int64 v24; // [rsp+90h] [rbp-30h]
v17 = a2;
v2 = *a1;
if ( (v2 & 1) != 0 )
{
if ( !*((_QWORD *)a1 + 1) )
return;
}
else if ( !(v2 >> 1) )
{
return;
}
*(_OWORD *)v21 = 0;
v22 = 0;
sub_10064E0E0(a1, ";", (__int64)v21);
*(_OWORD *)v23 = 0;
v24 = 0;
v3 = (unsigned __int8 *)v21[0];
if ( v21[1] == v21[0] )
goto LABEL_41;
v4 = 0;
do
{
v5 = (void **)v23[0];
v6 = (void **)v23[1];
if ( v23[1] != v23[0] )
{
do
{
if ( (*(_BYTE *)(v6 - 3) & 1) != 0 )
operator delete(*(v6 - 1));
v6 -= 3;
}
while ( v6 != v5 );
v3 = (unsigned __int8 *)v21[0];
}
v23[1] = v5;
sub_10064E0E0(&v3[24 * v4], ",", (__int64)v23);
v7 = (const std::string *)v23[0];
if ( 0xAAAAAAAAAAAAAAABLL * (((char *)v23[1] - (char *)v23[0]) >> 3) >= 4 )
{
v19 = 0;
memset(v18, 0, sizeof(v18));
v20 = nullptr;
if ( (*(_BYTE *)v23[0] & 1) != 0 )
{
LODWORD(v18[0]) = atoi(*((const char **)v23[0] + 2));
if ( (*(_BYTE *)&v7[1].__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_17;
}
else
{
LODWORD(v18[0]) = atoi((const char *)v23[0] + 1);
if ( (*(_BYTE *)&v7[1].__r_.__value_.__s.0 & 1) != 0 )
{
LABEL_17:
data = v7[1].__r_.__value_.__l.__data_;
goto LABEL_20;
}
}
data = v7[1].__r_.__value_.__s.__data_;
LABEL_20:
DWORD1(v18[0]) = atoi(data);
cocos2d::ZipUtils::urlDecode(&v15, v7 + 2);
if ( (BYTE8(v18[0]) & 1) != 0 )
operator delete(*((void **)&v18[1] + 1));
*((_QWORD *)&v18[1] + 1) = v16;
*(_OWORD *)((char *)v18 + 8) = v15;
cocos2d::ZipUtils::urlDecode(&v15, (const std::string *)v23[0] + 3);
if ( (v19 & 1) != 0 )
operator delete(v20);
v20 = v16;
v19 = v15;
v9 = v15 & 1;
if ( (v15 & 1) != 0 )
{
if ( !*((_QWORD *)&v19 + 1) )
goto LABEL_29;
}
else if ( !((unsigned __int8)v15 >> 1) )
{
LABEL_29:
if ( v9 )
operator delete(v20);
if ( (BYTE8(v18[0]) & 1) != 0 )
operator delete(*((void **)&v18[1] + 1));
goto LABEL_7;
}
sub_10065D550(v17, (__int64)v18);
v9 = v19 & 1;
goto LABEL_29;
}
LABEL_7:
++v4;
v3 = (unsigned __int8 *)v21[0];
}
while ( v4 < 0xAAAAAAAAAAAAAAABLL * (((char *)v21[1] - (char *)v21[0]) >> 3) );
v10 = (void **)v23[0];
if ( v23[0] )
{
v11 = (void **)v23[1];
v12 = v23[0];
if ( v23[1] != v23[0] )
{
do
{
if ( (*(_BYTE *)(v11 - 3) & 1) != 0 )
operator delete(*(v11 - 1));
v11 -= 3;
}
while ( v11 != v10 );
v12 = v23[0];
}
v23[1] = v10;
operator delete(v12);
v3 = (unsigned __int8 *)v21[0];
}
LABEL_41:
if ( v3 )
{
v13 = (void **)v21[1];
v14 = v3;
if ( v21[1] != v3 )
{
do
{
if ( (*(_BYTE *)(v13 - 3) & 1) != 0 )
operator delete(*(v13 - 1));
v13 -= 3;
}
while ( v13 != (void **)v3 );
v14 = (unsigned __int8 *)v21[0];
}
v21[1] = v3;
operator delete(v14);
}
}