//
// sub_100589560 from 0x100589560 to 0x100589624 (196 bytes)
//
// 5 xrefs:
// > sub_100589A60 @ 0x100589c14
// > sub_1005C7CA8 @ 0x1005c7cac
// > sub_1005CECB4 @ 0x1005cecb8
// > sub_1005D66F8 @ 0x1005d66fc
// > sub_100601108 @ 0x10060110c
//
// 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_100589560(__int64 *a1, __int64 a2, __int64 a3)
{
__int64 v6; // x0
int v7; // w8
__int64 v8; // x0
int v9; // w22
__int64 v11; // x4
v6 = *a1;
if ( v6 || (v6 = sub_1005DE4A4(0), (*a1 = v6) != 0) )
{
v7 = sub_1005DEA4C(v6);
v8 = *a1;
if ( v7 > (int)a2 )
{
LABEL_7:
sub_1005DEA90(v8, a2, a3);
return 1;
}
v9 = v7 - 1;
while ( (unsigned int)sub_1005DE80C(v8, 0) )
{
v8 = *a1;
if ( ++v9 >= (int)a2 )
goto LABEL_7;
}
v11 = 623;
}
else
{
v11 = 615;
}
sub_1005E0E48(15, 102, 65, "ex_data.c", v11);
return 0;
}