//
// sub_609CC0 from 0x609cc0 to 0x609ea2 (482 bytes)
//
// 1 xrefs:
// > sub_608878 @ 0x608d46
//
// 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_609CC0(double a1, void (**a2)(), int **a3)
{
pugi::xpath_variable **v5; // r7
pugi::xpath_variable **v6; // r8
int v7; // r3
int v8; // r4
pugi::xpath_node *i; // r5
pugi::xpath_node *v10; // r7
int **v11; // r0
pugi::xpath_node *v12; // r5
const char *v14; // [sp+4h] [bp-60h] BYREF
int *v15[4]; // [sp+Ch] [bp-58h] BYREF
pugi::xml_attribute_struct *v16[4]; // [sp+1Ch] [bp-48h] BYREF
int *v17; // [sp+2Ch] [bp-38h] BYREF
pugi::xpath_node *v18; // [sp+30h] [bp-34h]
pugi::xpath_node *v19; // [sp+34h] [bp-30h]
int *v20; // [sp+3Ch] [bp-28h] BYREF
pugi::xpath_node *v21; // [sp+40h] [bp-24h]
pugi::xpath_node *v22; // [sp+44h] [bp-20h]
int *v23[4]; // [sp+4Ch] [bp-18h] BYREF
v5 = (pugi::xpath_variable **)HIDWORD(a1);
v6 = (pugi::xpath_variable **)LODWORD(a1);
v7 = *(unsigned __int8 *)(HIDWORD(a1) + 1);
if ( *(_BYTE *)(LODWORD(a1) + 1) == 1 )
{
if ( v7 == 1 )
{
sub_600130(v15, *a3);
sub_607BBC(v16, v6, a2, (int)a3);
sub_607BBC((pugi::xml_attribute_struct **)&v17, v5, a2, (int)a3);
for ( i = v16[1]; i != v16[2]; i = (pugi::xpath_node *)((char *)i + 8) )
{
sub_600130(&v20, *a3);
sub_606D38((int)v23, i, (int)*a3);
sub_601A90((const char *)v23[0]);
v10 = v18;
if ( v18 != v19 )
{
sub_600130(v23, *a3);
sub_606D38((int)&v14, v10, (int)*a3);
sub_601A90(v14);
sub_600144((int)v23);
sub_600144((int)&v20);
v8 = 1;
goto LABEL_11;
}
sub_600144((int)&v20);
}
v8 = 0;
LABEL_11:
v11 = v15;
goto LABEL_19;
}
sub_600130(&v17, *a3);
sub_607BBC((pugi::xml_attribute_struct **)&v20, v6, a2, (int)a3);
sub_608F28(COERCE_DOUBLE(__PAIR64__((unsigned int)a2, (unsigned int)v5)), a3);
v12 = v21;
if ( v21 != v22 )
goto LABEL_13;
goto LABEL_17;
}
if ( v7 == 1 )
{
sub_600130(&v17, *a3);
sub_608F28(COERCE_DOUBLE(__PAIR64__((unsigned int)a2, (unsigned int)v6)), a3);
sub_607BBC((pugi::xml_attribute_struct **)&v20, v5, a2, (int)a3);
v12 = v21;
if ( v21 != v22 )
{
LABEL_13:
sub_600130(v23, *a3);
sub_606D38((int)v16, v12, (int)*a3);
sub_601A90((const char *)v16[0]);
sub_600144((int)v23);
v8 = 1;
LABEL_18:
v11 = &v17;
LABEL_19:
sub_600144((int)v11);
return v8;
}
LABEL_17:
v8 = 0;
goto LABEL_18;
}
HIDWORD(a1) = a2;
sub_608F28(a1, a3);
sub_608F28(COERCE_DOUBLE(__PAIR64__((unsigned int)a2, (unsigned int)v5)), a3);
return 1;
}