//
// GJLevelList::parseListLevels from 0x3d6780 to 0x3d685e (222 bytes)
//
// 3 xrefs:
// > GameLevelManager::updateSavedLevelList @ 0x3d68fc
// > GJLevelList::create @ 0x3d6b92
// > GJLevelList::dataLoaded @ 0x3d7c02
//
// 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
//
int __fastcall GJLevelList::parseListLevels(int a1, _DWORD *a2)
{
int result; // r0
void **v5; // r4
int v6; // r0
int v7; // r7
int v8; // r8
int v9; // [sp+4h] [bp-18h]
_BYTE v10[4]; // [sp+8h] [bp-14h] BYREF
char *v11; // [sp+Ch] [bp-10h] BYREF
int v12; // [sp+10h] [bp-Ch] BYREF
result = sub_775D40(a1 + 344, a2);
*(_DWORD *)(a1 + 268) = *(_DWORD *)(a1 + 264);
if ( *(_DWORD *)(*a2 - 12) )
{
v5 = (void **)(a1 + 264);
sub_776584((int)v10, ",");
v6 = sub_774A6C(a2, v10, 0);
v7 = 0;
v9 = *(_DWORD *)(*a2 - 12);
v8 = v6;
while ( 1 )
{
sub_776158(&v11, a2, v7, v8 - v7);
if ( *((_DWORD *)v11 - 3) || v7 != v9 )
{
v12 = atoi(v11);
std::vector::emplace_back(v5, &v12);
}
if ( v8 == -1 )
break;
v7 = v8 + 1;
v8 = sub_774A6C(a2, v10, v8 + 1);
sub_774008(&v11);
}
sub_774008(&v11);
return sub_774008(v10);
}
return result;
}