//
// sub_6078F4 from 0x6078f4 to 0x607972 (126 bytes)
//
// 2 xrefs:
// > sub_607BBC @ 0x607c4c
// > sub_607BBC @ 0x607e46
//
// 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
//
int __fastcall sub_6078F4(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_6076AC(*(_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;
}