//
// pugi::xpath_variable_set::add from 0xdd6fc8 to 0xdd71e4 (540 bytes)
//
// 5 xrefs:
// > pugi::xpath_variable_set::set @ 0xdd71f8
// > pugi::xpath_variable_set::set @ 0xdd7230
// > pugi::xpath_variable_set::set @ 0xdd7264
// > pugi::xpath_variable_set::set @ 0xdd72a0
// > ??> @ 0x5f308
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:09:04 +0000
//
pugi::xpath_variable *__fastcall pugi::xpath_variable_set::add(__int64 a1, char *a2, int a3)
{
unsigned int v6; // w22
pugi::xpath_variable *v7; // x19
const char *v8; // x0
pugi::xpath_variable *result; // x0
size_t v10; // x0
size_t v11; // x24
_QWORD *v12; // x0
_QWORD *v13; // x19
size_t v14; // x0
size_t v15; // x0
size_t v16; // x24
_QWORD *v17; // x0
_QWORD *v18; // x19
size_t v19; // x0
size_t v20; // x24
char *v21; // x0
char *v22; // x19
v6 = sub_DBDE60(a2) & 0x3F;
v7 = *(pugi::xpath_variable **)(a1 + 8LL * v6);
if ( v7 )
{
while ( 1 )
{
v8 = (const char *)pugi::xpath_variable::name(v7);
if ( !strcmp(v8, a2) )
break;
v7 = *((pugi::xpath_variable **)v7 + 1);
if ( !v7 )
goto LABEL_10;
}
if ( (unsigned int)pugi::xpath_variable::type(v7) == a3 )
return v7;
else
return nullptr;
}
else
{
LABEL_10:
switch ( a3 )
{
case 1:
v15 = strlen(a2);
v16 = v15;
if ( !v15 )
goto LABEL_9;
v17 = off_154A348(v15 + 64);
v18 = v17;
if ( !v17 )
goto LABEL_9;
*(_DWORD *)v17 = 0;
v17[1] = 0;
*((_DWORD *)v17 + 4) = 0;
v17[3] = 0;
v17[4] = 0;
v17[5] = 0;
v17[6] = 0;
*((_BYTE *)v17 + 56) = 0;
pugi::xpath_variable::xpath_variable((__int64)v17);
pugi::xpath_node_set::xpath_node_set((pugi::xpath_node_set *)(v18 + 2));
memcpy(v18 + 7, a2, v16 + 1);
result = (pugi::xpath_variable *)v18;
goto LABEL_14;
case 2:
v14 = strlen(a2);
v11 = v14;
if ( v14 )
{
v12 = off_154A348(v14 + 32);
v13 = v12;
if ( v12 )
goto LABEL_13;
}
goto LABEL_9;
case 3:
v10 = strlen(a2);
v11 = v10;
if ( !v10 )
goto LABEL_9;
v12 = off_154A348(v10 + 32);
v13 = v12;
if ( !v12 )
goto LABEL_9;
LABEL_13:
pugi::xpath_variable::xpath_variable((__int64)v12);
v13[2] = 0;
memcpy(v13 + 3, a2, v11 + 1);
result = (pugi::xpath_variable *)v13;
goto LABEL_14;
case 4:
v19 = strlen(a2);
v20 = v19;
if ( !v19 )
goto LABEL_9;
v21 = (char *)off_154A348(v19 + 24);
v22 = v21;
if ( !v21 )
goto LABEL_9;
pugi::xpath_variable::xpath_variable((__int64)v21);
v22[16] = 0;
memcpy(v22 + 17, a2, v20 + 1);
result = (pugi::xpath_variable *)v22;
LABEL_14:
*(_DWORD *)result = a3;
*((_QWORD *)result + 1) = *(_QWORD *)(a1 + 8LL * v6);
*(_QWORD *)(a1 + 8LL * v6) = result;
break;
default:
LABEL_9:
result = nullptr;
break;
}
}
return result;
}