//
// sub_1000331EC from 0x1000331ec to 0x100033270 (132 bytes)
//
// 2 xrefs:
// > sub_100033168 @ 0x100033194
// > sub_100033168 @ 0x1000331c0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:57:31 +0000
//
void *__fastcall sub_1000331EC(__int64 a1, __int64 a2, int a3)
{
char *v3; // x8
char *v4; // x20
__int64 v5; // x10
__int64 v7; // x9
size_t v8; // x21
void *result; // x0
v3 = *(char **)(a2 + 1848);
v4 = *(char **)(a2 + 1840);
v5 = v3 - v4;
if ( v3 != v4 )
{
v7 = v5 >> 4;
if ( (unsigned __int64)(v5 >> 4) <= 1 )
v7 = 1;
v8 = v5 - 16;
while ( *(_DWORD *)v4 != a3 )
{
v4 += 16;
v8 -= 16LL;
if ( !--v7 )
return result;
}
if ( v4 + 16 != v3 )
result = memmove(v4, v4 + 16, v8);
*(_QWORD *)(a2 + 1848) = &v4[v8];
}
return result;
}