//
// sub_CD5A40 from 0xcd5a40 to 0xcd5ba0 (352 bytes)
//
// 3 xrefs:
// > pugi::xml_document::load @ 0xb5a9f8
// > pugi::xml_document::load @ 0xb5aa04
// > pugi::xml_document::load @ 0xb5aa24
//
// 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 sub_CD5A40(unsigned int **a1)
{
char *v2; // x0
char v4; // [xsp+38h] [xbp+38h] BYREF
sub_CD43C0(&v4, a1, 1u);
if ( v4 && (v2 = (char *)a1 + *((_QWORD *)*a1 - 3), (*((_DWORD *)v2 + 8) & 5) == 0) )
return (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64, __int64))(**((_QWORD **)v2 + 29) + 32LL))(
*((_QWORD *)v2 + 29),
0,
1,
8);
else
return -1;
}