//
// sub_100581A30 from 0x100581a30 to 0x100581ae4 (180 bytes)
//
// 2 xrefs:
// > sub_10056ECEC @ 0x10056eeac
// > sub_10056F020 @ 0x10056f1b4
//
// 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_100581A30(const char **a1, __int64 **a2)
{
__int64 *v4; // x20
__int64 *v5; // x21
const char *v6; // x0
const char **v7; // x22
char *v8; // x8
const char *v9; // t1
v4 = *a2;
if ( a1 )
{
v5 = sub_10056BAA4((__int64)sub_100581AE4);
if ( !v5 )
return 3;
v6 = *a1;
if ( *a1 )
{
v7 = a1 + 1;
do
{
v8 = off_10085DEC8(v6);
if ( !v8 || !(unsigned int)sub_10056BAE8(v5, v5[1], (__int64)v8) )
return 3;
v9 = *v7++;
v6 = v9;
}
while ( v9 );
}
}
else
{
v5 = nullptr;
}
if ( v4 )
sub_10056BC4C(v4, 0);
*a2 = v5;
return 0;
}