//
// sub_53B0D8 from 0x53b0d8 to 0x53b200 (296 bytes)
//
// 6 xrefs:
// > SongInfoLayer::create @ 0x53c218
// > SongInfoLayer::create @ 0x53c250
// > SongInfoLayer::create @ 0x53c288
// > SongInfoLayer::create @ 0x53c2c0
// > SongInfoLayer::create @ 0x53c466
// > SongInfoLayer::create @ 0x53c4a4
//
// 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:14 +0000
//
unsigned int *__fastcall sub_53B0D8(unsigned int *result, unsigned __int8 *a2, unsigned __int8 *a3)
{
int v4; // r2
unsigned int *v6; // r5
int v7; // r3
int v8; // r1
int v9; // r8
int v10; // r11
int v11; // r4
int v12; // r10
int v13; // r2
int v14; // lr
size_t v15; // r2
int v16; // r1
unsigned __int8 *v17; // r1
unsigned __int8 *v18; // r2
int v19; // t1
GJLinkObject *v20; // r0
int v21; // [sp+4h] [bp-30h]
_DWORD v22[2]; // [sp+Ch] [bp-28h] BYREF
_DWORD v23[3]; // [sp+14h] [bp-20h] BYREF
_DWORD v24[3]; // [sp+20h] [bp-14h] BYREF
v4 = *a2;
v6 = result;
v7 = v4 & 1;
if ( (v4 & 1) != 0 )
v8 = *((_DWORD *)a2 + 1);
else
v8 = v4 >> 1;
if ( !v8 )
return result;
v9 = v4 >> 1;
v10 = 0;
v11 = *result + 21;
v12 = (int)(result[1] - *result) >> 5;
while ( 1 )
{
if ( v10 == v12 )
{
v22[0] = 0;
memset(v23, 0, sizeof(v23));
memset(v24, 0, sizeof(v24));
std::string::operator=((unsigned __int8 *)v24, a2);
std::string::operator=((unsigned __int8 *)v23, a3);
v22[1] = MusicDownloadManager::linkTypeForURL(a2);
v20 = (GJLinkObject *)v6[1];
if ( v20 == (GJLinkObject *)v6[2] )
{
std::vector::__push_back_slow_path(v6, (GJLinkObject *)v22);
}
else
{
if ( v20 )
GJLinkObject::GJLinkObject(v20, (const GJLinkObject *)v22);
v6[1] += 32;
}
std::string::~string((int)v24);
return (unsigned int *)std::string::~string((int)v23);
}
v13 = *(unsigned __int8 *)(v11 - 1);
result = (unsigned int *)v11;
v14 = v13 & 1;
v15 = (v13 & 1) != 0 ? *(_DWORD *)(v11 + 3) : v13 >> 1;
v16 = v7 ? *((_DWORD *)a2 + 1) : v9;
if ( v15 == v16 )
break;
LABEL_28:
++v10;
v11 += 32;
}
if ( v14 )
result = *(unsigned int **)(v11 + 7);
if ( v7 )
v17 = *((unsigned __int8 **)a2 + 2);
else
v17 = a2 + 1;
if ( v14 )
{
v21 = v7;
if ( !v15 )
return result;
result = (unsigned int *)memcmp(result, v17, v15);
v7 = v21;
if ( !result )
return result;
goto LABEL_28;
}
result = (unsigned int *)((char *)result - 1);
v18 = &v17[v15];
while ( v17 != v18 )
{
v19 = *((unsigned __int8 *)result + 1);
result = (unsigned int *)((char *)result + 1);
if ( v19 != *v17 )
goto LABEL_28;
++v17;
}
return result;
}