//
// sub_816A28 from 0x816a28 to 0x816aa6 (126 bytes)
//
// 2 xrefs:
// > sub_816CF0 @ 0x816d80
// > sub_816CF0 @ 0x816f7a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:42 +0000
//
int __fastcall sub_816A28(int result, int a2, int a3)
{
int v3; // r6
char *v4; // r4
char *v5; // r7
int *v6; // r5
_DWORD *i; // r4
int *v8; // r8
int v9; // r1
_DWORD v10[3]; // [sp+0h] [bp-Ch] BYREF
v10[0] = result;
v10[1] = a2;
v10[2] = a3;
v3 = result;
if ( !*(_DWORD *)result )
result = sub_8167E0(*(_DWORD *)(result + 4), *(int **)(result + 8), (int)v10);
v4 = *(char **)(v3 + 4);
v5 = *(char **)(v3 + 8);
while ( v5 - v4 > 15 )
{
result = pugi::xpath_node::operator!=(v4, (_DWORD *)v4 + 2);
if ( !result )
break;
v4 += 8;
}
v6 = (int *)v4;
if ( v4 != v5 )
{
for ( i = v4 + 16; ; i += 2 )
{
v8 = i - 2;
if ( i - 2 == (_DWORD *)v5 )
break;
result = pugi::xpath_node::operator!=(i - 2, v6);
if ( result )
{
result = *v8;
v9 = *(i - 1);
v6 += 2;
*v6 = *v8;
v6[1] = v9;
}
}
v5 = (char *)(v6 + 2);
}
*(_DWORD *)(v3 + 8) = v5;
return result;
}