//
// sub_10053E630 from 0x10053e630 to 0x10053e6e3 (179 bytes)
//
// 3 xrefs:
// > sub_1000D5190 @ 0x1000d53c4
// > sub_1000D5780 @ 0x1000d5b7e
// > sub_1006CC260 @ 0x1006ccb91
//
// 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 12:31:56 +0000
//
_QWORD *__fastcall sub_10053E630(_QWORD *a1, __int64 a2)
{
unsigned __int8 v2; // al
__int64 v3; // r15
std::string v5; // [rsp+0h] [rbp-30h] BYREF
v2 = *(_BYTE *)(a2 + 1440);
if ( (v2 & 1) == 0 )
{
v3 = a2 + 1440;
if ( v2 >> 1 )
goto LABEL_3;
LABEL_6:
sub_1004EF000(&v5, 16);
if ( (*(_BYTE *)v3 & 1) != 0 )
operator delete(*(void **)(a2 + 1456));
*(std::string *)v3 = v5;
if ( (*(_BYTE *)v3 & 1) == 0 )
goto LABEL_4;
LABEL_9:
sub_10001AD30(a1, *(const void **)(a2 + 1456), *(_QWORD *)(a2 + 1448));
return a1;
}
v3 = a2 + 1440;
if ( !*(_QWORD *)(a2 + 1448) )
goto LABEL_6;
LABEL_3:
if ( (v2 & 1) != 0 )
goto LABEL_9;
LABEL_4:
a1[2] = *(_QWORD *)(v3 + 16);
*(_OWORD *)a1 = *(_OWORD *)v3;
return a1;
}