//
// tinyxml2::XMLDocument::LoadFile from 0x180099c80 to 0x180099d26 (166 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b6ec4
//
// 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 tinyxml2::XMLDocument::LoadFile(__int64 a1, const char *a2)
{
void *v4; // rcx
errno_t v5; // eax
FILE *Stream; // [rsp+30h] [rbp+8h] BYREF
tinyxml2::XMLNode::DeleteChildren((tinyxml2::XMLNode *)a1);
v4 = *(void **)(a1 + 120);
*(_DWORD *)(a1 + 92) = 0;
*(_QWORD *)(a1 + 104) = 0;
*(_QWORD *)(a1 + 112) = 0;
j_j_free_0(v4);
*(_QWORD *)(a1 + 120) = 0;
Stream = nullptr;
v5 = fopen_s(&Stream, a2, "rb");
if ( !Stream || v5 )
{
*(_QWORD *)(a1 + 112) = 0;
*(_DWORD *)(a1 + 92) = 3;
*(_QWORD *)(a1 + 104) = a2;
return 3;
}
else
{
tinyxml2::XMLDocument::LoadFile(a1, Stream);
fclose(Stream);
return *(unsigned int *)(a1 + 92);
}
}