//
// tinyxml2::XMLUtil::GetCharacterRef from 0x18009cf30 to 0x18009d088 (344 bytes)
//
// 5 xrefs:
// > tinyxml2::StrPair::GetStr @ 0x18009d172
// > ??> @ 0x180147ac8
// > ??> @ 0x180147ad8
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c1038
//
// This function is hookable on this platform (idp: pc, 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 11:22:12 +0000
//
const char *__fastcall tinyxml2::XMLUtil::GetCharacterRef(const char *a1, char *a2, int *a3)
{
unsigned int v3; // edi
const char *result; // rax
char v8; // r9
const char *v9; // rcx
int v10; // ebx
char *v11; // rax
char v12; // cl
char *v13; // rdx
__int64 i; // rsi
int v15; // eax
int v16; // eax
char *v17; // rax
char v18; // cl
char *v19; // rdx
int v20; // eax
v3 = 0;
result = a1 + 1;
*a3 = 0;
if ( a1[1] == 35 )
{
v8 = a1[2];
v9 = a1 + 2;
if ( v8 )
{
v10 = 1;
if ( v8 == 120 )
{
if ( a1[3] )
{
v11 = strchr(a1 + 3, 59);
if ( v11 )
{
if ( *v11 )
{
v12 = *(v11 - 1);
v13 = v11 - 1;
for ( i = v11 - a1; v12 != 120; v3 += v16 )
{
if ( (unsigned __int8)(v12 - 48) > 9u )
{
if ( (unsigned __int8)(v12 - 97) > 5u )
{
if ( (unsigned __int8)(v12 - 65) > 5u )
return nullptr;
v15 = v12 - 55;
}
else
{
v15 = v12 - 87;
}
}
else
{
v15 = v12 - 48;
}
v12 = *--v13;
v16 = v10 * v15;
v10 *= 16;
}
goto LABEL_21;
}
}
}
}
else
{
v17 = strchr(v9, 59);
if ( v17 && *v17 )
{
v18 = *(v17 - 1);
v19 = v17 - 1;
i = v17 - a1;
if ( v18 == 35 )
{
LABEL_21:
tinyxml2::XMLUtil::ConvertUTF32ToUTF8(v3, a2, a3);
return &a1[i + 1];
}
while ( (unsigned __int8)(v18 - 48) <= 9u )
{
--v19;
v20 = v10 * (v18 - 48);
v10 *= 10;
v18 = *v19;
v3 += v20;
if ( *v19 == 35 )
goto LABEL_21;
}
}
}
return nullptr;
}
}
return result;
}