//
// sub_1003AF9EC from 0x1003af9ec to 0x1003afac0 (212 bytes)
//
// 2 xrefs:
// > sub_1003AC600 @ 0x1003ac8e0
// > sub_1003AC600 @ 0x1003acb78
//
// 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_1003AF9EC(__int64 a1, _BYTE *a2)
{
__int64 i; // x8
int v5; // w9
size_t v6; // x2
_BYTE *v7; // x21
__int64 result; // x0
do
{
sub_1003AFAC0(a1, 60, 33, 91, 67, 68);
sub_1003AF75C(a1, 65, 84, 65, 91);
for ( i = 0; ; ++i )
{
v5 = (unsigned __int8)a2[i];
if ( v5 == 93 )
break;
if ( !a2[i] )
goto LABEL_8;
LABEL_7:
;
}
if ( a2[i + 1] != 93 || a2[i + 2] != 62 )
goto LABEL_7;
LABEL_8:
v6 = i + 2LL * (v5 != 0);
v7 = &a2[v6];
sub_1003B0158(a1, a2, v6);
result = sub_1003ACFA0(a1, 93, 93, 62);
a2 = v7;
}
while ( *v7 );
return result;
}