//
// pugi::xpath_variable_set::add from 0x819268 to 0x819386 (286 bytes)
//
// 4 xrefs:
// > pugi::xpath_variable_set::set @ 0x81939e
// > pugi::xpath_variable_set::set @ 0x8193b8
// > pugi::xpath_variable_set::set @ 0x8193d2
// > pugi::xpath_variable_set::set @ 0x8193ea
//
// 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:44 +0000
//
pugi::xpath_variable *__fastcall pugi::xpath_variable_set::add(int a1, const char *a2, int a3)
{
unsigned int v6; // r6
pugi::xpath_variable *i; // r4
char *v8; // r0
pugi::xpath_variable *result; // r0
size_t v10; // r0
size_t v11; // r9
_DWORD *v12; // r0
_DWORD *v13; // r4
void *v14; // r0
size_t v15; // r0
_DWORD *v16; // r0
size_t v17; // r0
_DWORD *v18; // r0
size_t v19; // r0
_DWORD *v20; // r0
v6 = sub_80F818((int)a2) & 0x3F;
for ( i = *(pugi::xpath_variable **)(a1 + 4 * v6); i; i = *((pugi::xpath_variable **)i + 1) )
{
v8 = pugi::xpath_variable::name(i);
if ( sub_80FCB4(v8, a2) )
{
if ( pugi::xpath_variable::type(i) == a3 )
return i;
else
return nullptr;
}
}
switch ( a3 )
{
case 1:
v10 = strlen(a2);
v11 = v10;
if ( !v10 )
goto LABEL_22;
v12 = (_DWORD *)off_D2006C(v10 + 32);
v13 = v12;
if ( !v12 )
goto LABEL_22;
memset(v12, 0, 0x20u);
pugi::xpath_variable::xpath_variable(v13);
pugi::xpath_node_set::xpath_node_set((pugi::xpath_node_set *)(v13 + 2));
v14 = v13 + 7;
goto LABEL_21;
case 2:
v15 = strlen(a2);
v11 = v15;
if ( !v15 )
goto LABEL_22;
v16 = (_DWORD *)off_D2006C(v15 + 24);
v13 = v16;
if ( !v16 )
goto LABEL_22;
pugi::xpath_variable::xpath_variable(v16);
v14 = v13 + 4;
*((_QWORD *)v13 + 1) = 0;
goto LABEL_21;
case 3:
v17 = strlen(a2);
v11 = v17;
if ( !v17 )
goto LABEL_22;
v18 = (_DWORD *)off_D2006C(v17 + 16);
v13 = v18;
if ( !v18 )
goto LABEL_22;
pugi::xpath_variable::xpath_variable(v18);
v14 = v13 + 3;
v13[2] = 0;
goto LABEL_21;
case 4:
v19 = strlen(a2);
v11 = v19;
if ( !v19 )
goto LABEL_22;
v20 = (_DWORD *)off_D2006C(v19 + 12);
v13 = v20;
if ( !v20 )
goto LABEL_22;
pugi::xpath_variable::xpath_variable(v20);
v14 = (char *)v13 + 9;
*((_BYTE *)v13 + 8) = 0;
LABEL_21:
memcpy(v14, a2, v11 + 1);
*v13 = a3;
v13[1] = *(_DWORD *)(a1 + 4 * v6);
*(_DWORD *)(a1 + 4 * v6) = v13;
result = (pugi::xpath_variable *)v13;
break;
default:
LABEL_22:
result = nullptr;
break;
}
return result;
}