//
// sub_1005817EC from 0x1005817ec to 0x100581948 (348 bytes)
//
// 2 xrefs:
// > sub_10056ECEC @ 0x10056eea0
// > sub_10056F020 @ 0x10056f27c
//
// 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_1005817EC(const char **a1, __int64 **a2)
{
__int64 *v4; // x21
__int64 *v5; // x19
const char *v6; // x0
const char **v7; // x24
char *v8; // x23
_WORD *v9; // x22
char *v10; // x0
const char *v11; // t1
v4 = *a2;
if ( a1 )
{
v5 = sub_10056BAA4((__int64)sub_100581948);
if ( !v5 )
return 3;
v6 = *a1;
if ( *a1 )
{
v7 = a1 + 1;
while ( 1 )
{
v8 = off_10085DEC8(v6);
if ( !v8 )
break;
v9 = off_10085DEB0(0x10u);
if ( !v9 )
{
off_10085DEB8(v8);
break;
}
v10 = strchr(v8, 58);
if ( v10 )
{
*v10 = 0;
v9[4] = strtol(v10 + 1, nullptr, 10);
}
else
{
v9[4] = 80;
}
*(_QWORD *)v9 = v8;
if ( !(unsigned int)sub_10056BAE8(v5, v5[1], (__int64)v9) )
{
off_10085DEB8(*(void **)v9);
*(_QWORD *)v9 = 0;
off_10085DEB8(v9);
break;
}
v11 = *v7++;
v6 = v11;
if ( !v11 )
goto LABEL_14;
}
sub_10056BC4C(v5, 0);
return 3;
}
}
else
{
v5 = nullptr;
}
LABEL_14:
if ( v4 )
sub_10056BC4C(v4, 0);
*a2 = v5;
return 0;
}