//
// pugi::xpath_node_set::sort from 0xb5e0ec to 0xb5e1b4 (200 bytes)
//
// 1 xrefs:
// > ??> @ 0x71c40
//
// 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 pugi::xpath_node_set::sort(pugi::xpath_node_set *this, char a2)
{
int v3; // w0
int v4; // w21
char *v5; // x19
char *v6; // x20
__int64 v7; // t1
__int64 v8; // x4
__int64 v9; // x5
__int64 v10; // x0
_BYTE v12[8]; // [xsp+40h] [xbp+40h] BYREF
v3 = *(_DWORD *)this;
if ( a2 )
v4 = 2;
else
v4 = 1;
v5 = *((char **)this + 3);
v6 = *((char **)this + 4);
if ( !v3 )
{
sub_B5D32C(*((char **)this + 3), *((char **)this + 4), (__int64)v12);
v3 = 1;
}
if ( v3 != v4 && v6 - v5 > 31 )
{
do
{
v7 = *(_QWORD *)v5;
v5 += 16;
v8 = *((_QWORD *)v6 - 2);
v9 = *((_QWORD *)v6 - 1);
v6 -= 16;
v10 = *((_QWORD *)v5 - 1);
*((_QWORD *)v5 - 2) = v8;
*((_QWORD *)v5 - 1) = v9;
*(_QWORD *)v6 = v7;
*((_QWORD *)v6 + 1) = v10;
}
while ( v6 - v5 > 31 );
}
*(_DWORD *)this = v4;
return _stack_chk_guard;
}