//
// sub_56D02C from 0x56d02c to 0x56d0a8 (124 bytes)
//
// 3 xrefs:
// > MusicDownloadManager::createCustomSFXPlacement @ 0x56e354
// > MusicDownloadManager::createCustomSFXFolder @ 0x56e4b8
// > MusicDownloadManager::renameCustomSFXObject @ 0x56e804
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:34 +0000
//
int *__fastcall sub_56D02C(int *a1, unsigned __int8 *a2)
{
int v3; // r3
int v4; // r0
unsigned __int8 *v5; // r6
unsigned __int8 *v6; // r0
unsigned __int8 *v7; // r5
unsigned __int8 *v8; // r2
int v9; // lr
unsigned int v10; // r2
unsigned __int8 *v11; // r0
int v12; // r3
unsigned __int8 *v13; // r3
int v14; // t1
int v15; // r3
v3 = *a2;
if ( (v3 & 1) != 0 )
{
v4 = *((_DWORD *)a2 + 1);
v5 = *((unsigned __int8 **)a2 + 2);
}
else
{
v4 = v3 >> 1;
v5 = a2 + 1;
}
if ( v4 )
{
v6 = &v5[v4];
v7 = v5;
while ( 1 )
{
v8 = v7;
if ( v7 == v6 )
break;
v9 = *v7++;
if ( v9 != 32 )
{
v10 = v8 - v5;
if ( v10 == -1 )
break;
if ( (v3 & 1) != 0 )
{
v11 = *((unsigned __int8 **)a2 + 2);
v12 = *((_DWORD *)a2 + 1);
}
else
{
v11 = a2 + 1;
v12 = v3 >> 1;
}
v13 = &v11[v12];
while ( v13 != v11 )
{
v14 = *--v13;
if ( v14 != 32 )
{
v15 = v13 - v11;
goto LABEL_18;
}
}
v15 = -1;
LABEL_18:
std::string::basic_string(a1, a2, v10, v15 + 1 - v10);
return a1;
}
}
}
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
std::string::__init(a1, &unk_B6B226, 0);
return a1;
}