//
// sub_56F64C from 0x56f64c to 0x56f7fa (430 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::responseToDict @ 0x56f864
// > MusicDownloadManager::createSongsInfo @ 0x57821a
//
// 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:36 +0000
//
cocos2d::CCArray *__fastcall sub_56F64C(_DWORD *a1, unsigned __int8 *a2)
{
int v2; // r11
unsigned __int8 *v5; // r7
cocos2d::CCArray *v6; // r0
unsigned int v7; // r2
int v8; // r4
bool v9; // zf
int v10; // r4
unsigned int v11; // r4
unsigned __int8 *v12; // r3
unsigned __int8 *v13; // r9
int v14; // r3
bool v15; // nf
int v16; // r3
unsigned int v17; // r7
int v18; // r3
const char *v19; // r7
size_t v20; // r0
cocos2d::CCObject *v21; // r0
int v22; // r4
int v23; // r2
unsigned int v24; // r4
char *v25; // r12
unsigned __int8 *v26; // r3
unsigned int v27; // r2
unsigned __int8 *v28; // r4
cocos2d::CCArray *v30; // [sp+10h] [bp-3Ch]
int v31; // [sp+14h] [bp-38h]
unsigned __int8 *v32; // [sp+1Ch] [bp-30h]
unsigned __int8 *v33[2]; // [sp+24h] [bp-28h] BYREF
int v34[3]; // [sp+2Ch] [bp-20h] BYREF
int v35[3]; // [sp+38h] [bp-14h] BYREF
v5 = (unsigned __int8 *)&_stack_chk_guard;
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
v8 = *(unsigned __int8 *)a1;
v9 = (v8 & 1) == 0;
if ( (v8 & 1) == 0 )
v7 = v8 >> 1;
v10 = *a2;
if ( v9 )
v5 = (unsigned __int8 *)a1 + 1;
else
v7 = a1[1];
if ( !v9 )
v5 = (unsigned __int8 *)a1[2];
if ( (v10 & 1) != 0 )
{
v11 = *((_DWORD *)a2 + 1);
v12 = *((unsigned __int8 **)a2 + 2);
}
else
{
v11 = v10 >> 1;
v12 = a2 + 1;
}
v30 = v6;
if ( v7 >= v11 )
{
if ( !v11 )
goto LABEL_16;
v13 = &v5[v7];
std::__search(
v33,
v5,
&v5[v7],
v12,
&v12[v11],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v33[0] != v13 )
{
v11 = v33[0] - v5;
goto LABEL_16;
}
}
v11 = -1;
LABEL_16:
v14 = *(unsigned __int8 *)a1;
v15 = (v14 & 1) != 0;
if ( (v14 & 1) == 0 )
v2 = v14 >> 1;
v16 = *a2;
if ( v15 )
v2 = a1[1];
v17 = 0;
if ( (v16 & 1) != 0 )
v18 = *((_DWORD *)a2 + 1);
else
v18 = v16 >> 1;
v31 = v18;
while ( 1 )
{
std::string::basic_string(v34, (unsigned __int8 *)a1, v17, v11 - v17);
if ( (v34[0] & 1) != 0 )
{
if ( v34[1] || v17 != v2 )
{
v19 = (const char *)v34[2];
LABEL_33:
memset(v35, 0, sizeof(v35));
v20 = strlen(v19);
std::string::__init(v35, v19, v20);
v21 = (cocos2d::CCObject *)cocos2d::CCString::create(v35);
cocos2d::CCArray::addObject(v30, v21);
std::string::~string((int)v35);
}
}
else if ( LOBYTE(v34[0]) >> 1 || v17 != v2 )
{
v19 = (char *)v34 + 1;
goto LABEL_33;
}
if ( v11 == -1 )
break;
v17 = v11 + v31;
v22 = *(unsigned __int8 *)a1;
v23 = *a2;
if ( (v22 & 1) != 0 )
{
v24 = a1[1];
v25 = (char *)a1[2];
}
else
{
v24 = v22 >> 1;
v25 = (char *)a1 + 1;
}
if ( (v23 & 1) != 0 )
{
v26 = *((unsigned __int8 **)a2 + 2);
v27 = *((_DWORD *)a2 + 1);
}
else
{
v26 = a2 + 1;
v27 = v23 >> 1;
}
if ( v17 > v24 || v24 - v17 < v27 )
{
LABEL_42:
v11 = -1;
goto LABEL_48;
}
if ( v27 )
{
v28 = (unsigned __int8 *)&v25[v24];
v32 = (unsigned __int8 *)v25;
std::__search(
v33,
(unsigned __int8 *)&v25[v17],
v28,
v26,
&v26[v27],
(int (__fastcall *)(int, _DWORD))std::char_traits::eq);
if ( v33[0] == v28 )
goto LABEL_42;
v11 = v33[0] - v32;
}
else
{
v11 = v17;
}
LABEL_48:
std::string::~string((int)v34);
}
std::string::~string((int)v34);
return v30;
}