//
// sub_1005B775C from 0x1005b775c to 0x1005b7838 (220 bytes)
//
// 3 xrefs:
// > sub_1005BC950 @ 0x1005bcdc0
// > sub_1005BF710 @ 0x1005bf800
// > sub_1005BFC10 @ 0x1005bfc80
//
// 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_1005B775C(_QWORD *a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
_QWORD *v10; // x8
_QWORD *v11; // x0
if ( !a1 )
return 0;
v10 = (_QWORD *)*a1;
if ( !*a1 )
{
LABEL_7:
if ( a2 )
{
v11 = sub_100588710(40, (__int64)"ec_lib.c", 578);
if ( !v11 )
return 0;
v11[1] = a2;
v11[2] = a3;
v11[3] = a4;
v11[4] = a5;
*v11 = *a1;
*a1 = v11;
}
return 1;
}
while ( v10[2] != a3 || v10[3] != a4 || v10[4] != a5 )
{
v10 = (_QWORD *)*v10;
if ( !v10 )
goto LABEL_7;
}
sub_1005E0E48(16, 211, 108, "ec_lib.c", 569);
return 0;
}