//
// sub_140481860 from 0x140481860 to 0x14048192b (203 bytes)
//
// 4 xrefs:
// > MusicDownloadManager::generateCustomContentURL @ 0x140490e31
// > MusicDownloadManager::generateCustomContentURL @ 0x140490eb2
// > MusicDownloadManager::generateCustomContentURL @ 0x140490ec8
// > ??> @ 0x140928928
//
// 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 11:32:45 +0000
//
void *__fastcall sub_140481860(int *a1, char *a2, unsigned int a3)
{
unsigned int v4; // eax
unsigned int v5; // r10d
unsigned int v8; // ebx
v4 = 8 * a3 + a1[4];
v5 = ((unsigned int)a1[4] >> 3) & 0x3F;
a1[4] = v4;
if ( v4 < 8 * a3 )
++a1[5];
v8 = 64 - v5;
a1[5] += a3 >> 29;
if ( a3 < 64 - v5 )
{
v8 = 0;
}
else
{
memcpy((char *)a1 + v5 + 24, a2, v8);
sub_140480F50(a1, (__int64)(a1 + 6));
for ( ; v8 + 63 < a3; v8 += 64 )
sub_140480F50(a1, (__int64)&a2[v8]);
v5 = 0;
}
return memcpy((char *)a1 + v5 + 24, &a2[v8], a3 - v8);
}