//
// sub_CD2540 from 0xcd2540 to 0xcd2674 (308 bytes)
//
// 2 xrefs:
// > pugi::xml_document::load @ 0xb5a788
// > pugi::xml_document::load @ 0xb5a904
//
// 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
//
unsigned __int64 *__fastcall sub_CD2540(unsigned __int64 *a1, __int64 a2, __int64 a3)
{
__int64 v7; // x0
__int64 v8; // x0
char v9; // [xsp+48h] [xbp+48h] BYREF
a1[1] = 0;
sub_CD14C0(&v9, a1, 1);
if ( !v9 )
return a1;
v7 = *(unsigned __int64 *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v8 = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v7 + 64LL))(v7, a2, a3);
a1[1] = v8;
if ( a3 == v8 )
return a1;
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32) | 6);
return a1;
}