//
// sub_1001D6214 from 0x1001d6214 to 0x1001d6300 (236 bytes)
//
// 4 xrefs:
// > MusicDownloadManager::encodeDataTo @ 0x1001d9cd0
// > MusicDownloadManager::encodeDataTo @ 0x1001d9d40
// > MusicDownloadManager::encodeDataTo @ 0x1001d9db0
// > MusicDownloadManager::encodeDataTo @ 0x1001d9ec4
//
// 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:00:25 +0000
//
std::string *__usercall sub_1001D6214@(std::string *result@, __int64 a2@)
{
__int64 v3; // x8
std::string::__raw *v4; // x20
__int64 v5; // x23
unsigned __int64 v6; // x8
__int64 v7; // x24
__int64 v8; // x8
std::string::value_type __s[16]; // [xsp+8h] [xbp-48h] BYREF
*(_QWORD *)a2 = 0;
*(_QWORD *)(a2 + 8) = 0;
*(_QWORD *)(a2 + 16) = 0;
v3 = result->__r_.__value_.__l.__size_ - result->__r_.__value_.__r.__words[0];
if ( v3 )
{
v4 = (std::string::__raw *)result;
v5 = 0;
v6 = v3 >> 2;
if ( v6 <= 1 )
v7 = 1;
else
v7 = v6;
do
{
sprintf(__s, "%i", *(_DWORD *)(v4->__words[0] + 4 * v5));
v8 = *(unsigned __int8 *)(a2 + 23);
if ( (v8 & 0x80u) != 0LL )
v8 = *(_QWORD *)(a2 + 8);
if ( v8 )
std::string::append((std::string *)a2, ",");
result = std::string::append((std::string *)a2, __s);
++v5;
}
while ( v7 != v5 );
}
return result;
}