//
// sub_100565890 from 0x100565890 to 0x1005659c7 (311 bytes)
//
// 1 xrefs:
// > GameLevelManager::onGetLevelLeaderboardCompleted @ 0x10052e4ff
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:32:11 +0000
//
void __fastcall sub_100565890(unsigned __int8 *a1, int *a2, int *a3, int *a4)
{
unsigned int v6; // eax
void **v7; // r12
void **v8; // r13
const char *v9; // rdi
void **v10; // rdi
void *__p[2]; // [rsp+0h] [rbp-40h] BYREF
__int64 v12; // [rsp+10h] [rbp-30h]
v6 = *a1;
if ( (v6 & 1) != 0 )
{
if ( !*((_QWORD *)a1 + 1) )
return;
LABEL_5:
*(_OWORD *)__p = 0;
v12 = 0;
sub_100552EF0(a1, "_", (__int64)__p);
v7 = (void **)__p[0];
v8 = (void **)__p[1];
if ( (void *)((char *)__p[1] - (char *)__p[0]) != (void *)96 )
{
if ( !__p[0] )
return;
v10 = (void **)__p[0];
if ( __p[1] == __p[0] )
goto LABEL_22;
goto LABEL_19;
}
if ( (*((_BYTE *)__p[0] + 24) & 1) != 0 )
{
*a2 = atoi(*((const char **)__p[0] + 5));
if ( ((_BYTE)v7[6] & 1) != 0 )
{
LABEL_8:
*a3 = atoi((const char *)v7[8]);
if ( ((_BYTE)v7[9] & 1) != 0 )
{
LABEL_9:
v9 = (const char *)v7[11];
goto LABEL_16;
}
LABEL_15:
v9 = (char *)v7 + 73;
LABEL_16:
*a4 = atoi(v9);
v10 = v7;
if ( v8 == v7 )
{
LABEL_22:
__p[1] = v7;
operator delete(v10);
return;
}
do
{
LABEL_19:
if ( (*(_BYTE *)(v8 - 3) & 1) != 0 )
operator delete(*(v8 - 1));
v8 -= 3;
}
while ( v8 != v7 );
v10 = (void **)__p[0];
goto LABEL_22;
}
}
else
{
*a2 = atoi((const char *)__p[0] + 25);
if ( ((_BYTE)v7[6] & 1) != 0 )
goto LABEL_8;
}
*a3 = atoi((const char *)v7 + 49);
if ( ((_BYTE)v7[9] & 1) != 0 )
goto LABEL_9;
goto LABEL_15;
}
if ( v6 >> 1 )
goto LABEL_5;
}