//
// sub_1003AE278 from 0x1003ae278 to 0x1003ae30c (148 bytes)
//
// 1 xrefs:
// > ??> @ 0x10080e008
//
// 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
//
unsigned __int8 *__fastcall sub_1003AE278(unsigned __int8 *a1, unsigned __int8 a2)
{
int v3; // w20
unsigned __int8 *v4; // x8
int v5; // w9
int v6; // t1
_QWORD v8[2]; // [xsp+0h] [xbp-30h] BYREF
v3 = a2;
v8[0] = 0;
v8[1] = 0;
while ( 1 )
{
do
{
v4 = a1;
v6 = *a1++;
v5 = v6;
}
while ( (byte_100645E7D[v6] & 2) == 0 );
if ( v5 == v3 )
break;
if ( v5 == 38 )
{
a1 = (unsigned __int8 *)sub_1003AE978(v4, v8);
}
else if ( !v5 )
{
return nullptr;
}
}
*(_BYTE *)sub_1003AE928(v8, v4) = 0;
return a1;
}