//
// sub_1006513F0 from 0x1006513f0 to 0x1006514c0 (208 bytes)
//
// 4 xrefs:
// > MusicDownloadManager::encodeDataTo @ 0x1006573b3
// > MusicDownloadManager::encodeDataTo @ 0x100657473
// > MusicDownloadManager::encodeDataTo @ 0x100657533
// > MusicDownloadManager::encodeDataTo @ 0x100657660
//
// 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:49 +0000
//
std::string *__fastcall sub_1006513F0(std::string *this, _QWORD *a2)
{
__int64 v2; // r13
__int64 v3; // r13
__int64 v4; // r15
unsigned int v5; // eax
std::string::value_type __s[16]; // [rsp+0h] [rbp-40h] BYREF
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
v2 = a2[1] - *a2;
if ( v2 )
{
v3 = (v2 >> 2 == 0) + (v2 >> 2);
v4 = 0;
while ( 1 )
{
sprintf(__s, "%i", *(_DWORD *)(*a2 + 4 * v4));
v5 = (unsigned int)this->__r_.__value_.__l.0;
if ( (v5 & 1) != 0 )
break;
if ( v5 >> 1 )
goto LABEL_7;
LABEL_8:
std::string::append(this, __s);
if ( v3 == ++v4 )
return this;
}
if ( !this->__r_.__value_.__l.__size_ )
goto LABEL_8;
LABEL_7:
std::string::append(this, ",");
goto LABEL_8;
}
return this;
}