//
// pugi::xpath_node_set::sort from 0x816bc0 to 0x816c24 (100 bytes)
//
// 0 xrefs:
//
// 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
//
void (*__fastcall pugi::xpath_node_set::sort(void (*this)(), int a2, int a3))()
{
int *v3; // r6
void (*v4)(); // r4
int *v5; // r5
int v6; // r8
int v7; // r2
int *v8; // r0
_DWORD v9[3]; // [sp+0h] [bp-Ch] BYREF
v9[0] = this;
v9[1] = a2;
v9[2] = a3;
v3 = (int *)this;
v4 = *((void (**)())this + 3);
v5 = *((int **)this + 4);
if ( a2 )
v6 = 2;
else
v6 = 1;
v7 = *(_DWORD *)this;
if ( !*(_DWORD *)this )
{
this = sub_8165B4(v4, v5, (int)v9);
v7 = 1;
}
if ( v7 != v6 )
{
while ( (char *)v5 - (char *)v4 > 15 )
{
v5 -= 2;
v8 = (int *)v4;
v4 = (void (*)())((char *)v4 + 8);
this = (void (*)())sub_80FC3C(v8, v5);
}
}
*v3 = v6;
return this;
}