//
// sub_14033C320 from 0x14033c320 to 0x14033c3eb (203 bytes)
//
// 4 xrefs:
// > MusicDownloadManager::generateCustomContentURL @ 0x140343c91
// > MusicDownloadManager::generateCustomContentURL @ 0x140343d12
// > MusicDownloadManager::generateCustomContentURL @ 0x140343d28
// > ??> @ 0x1406d551c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void *__fastcall sub_14033C320(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_14033BA50(a1, (__int64)(a1 + 6));
for ( ; v8 + 63 < a3; v8 += 64 )
sub_14033BA50(a1, (__int64)&a2[v8]);
v5 = 0;
}
return memcpy((char *)a1 + v5 + 24, &a2[v8], a3 - v8);
}