//
// sub_10056EC08 from 0x10056ec08 to 0x10056ecec (228 bytes)
//
// 1 xrefs:
// > sub_10056D8A0 @ 0x10056da10
//
// 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
//
__int64 __fastcall sub_10056EC08(__int64 result, int a2, __int64 a3, _QWORD *a4)
{
__int64 v7; // x23
_OWORD *v8; // x25
__int64 ***v9; // x21
__int64 **v10; // x24
__int64 **v11; // x26
__int64 **v12; // x1
v7 = result;
v8 = a4 + 4434;
v9 = (__int64 ***)a4[4442];
v10 = *v9;
if ( !*v9 )
goto LABEL_6;
do
{
v11 = (__int64 **)v10[2];
result = sub_100548F34(**v10, (*v10)[1], v7, a2);
if ( result > 0 )
break;
result = sub_10056BBA0((__int64)v9, v10, 0);
v10 = v11;
}
while ( v11 );
v12 = *v9;
if ( *v9 )
{
*v8 = *(_OWORD *)*v12;
sub_10056BBA0((__int64)v9, v12, 0);
result = sub_100572E0C(a4[4434], a4[4435], *(_QWORD *)(a3 + 128), a4 + 4436);
*(_QWORD *)(a3 + 128) = result;
}
else
{
LABEL_6:
*(_QWORD *)v8 = 0;
*((_DWORD *)a4 + 8870) = 0;
}
return result;
}