//
// pugi::xml_attribute::as_int from 0xb51290 to 0xb51328 (152 bytes)
//
// 2 xrefs:
// > DS_Dictionary::checkCompatibility @ 0xb41b80
// > ??> @ 0x43098
//
// 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::xml_attribute::as_int(pugi::xml_attribute *this, unsigned int a2)
{
pugi::xml_attribute_struct *attr; // x0
const char *v3; // x0
int v4; // w2
const char *v5; // x1
int v6; // t1
bool v7; // zf
int v8; // w2
attr = this->_attr;
if ( !attr )
return a2;
v3 = *((const char **)attr + 2);
if ( !v3 )
return a2;
v4 = *(unsigned __int8 *)v3;
if ( (byte_F1EC70[*(unsigned __int8 *)v3] & 8) != 0 )
{
v5 = v3;
do
{
v6 = *(unsigned __int8 *)++v5;
v4 = v6;
}
while ( (byte_F1EC70[v6] & 8) != 0 );
}
else
{
v5 = v3;
}
v7 = v4 == 45;
v8 = 10;
if ( v7 )
++v5;
if ( *v5 == 48 )
{
if ( (v5[1] & 0xDF) == 0x58 )
v8 = 16;
else
v8 = 10;
}
return strtol(v3, nullptr, v8);
}