//
// sub_1005B8870 from 0x1005b8870 to 0x1005b88f4 (132 bytes)
//
// 2 xrefs:
// > sub_1005BB970 @ 0x1005bc1f8
// > sub_1005BC950 @ 0x1005bcd7c
//
// 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_1005B8870(__int64 a1, unsigned __int64 a2, __int64 a3)
{
__int64 (*v3)(void); // x4
__int64 v4; // x9
__int64 v6; // x2
__int64 v7; // x4
v3 = *(__int64 (**)(void))(*(_QWORD *)a1 + 224LL);
if ( v3 )
{
if ( !a2 )
return v3();
v4 = 0;
while ( *(_QWORD *)a1 == **(_QWORD **)(a3 + 8 * v4) )
{
if ( ++v4 >= a2 )
return v3();
}
v6 = 101;
v7 = 1032;
}
else
{
v6 = 66;
v7 = 1027;
}
sub_1005E0E48(16, 136, v6, "ec_lib.c", v7);
return 0;
}