//
// sub_10053D350 from 0x10053d350 to 0x10053d4cc (380 bytes)
//
// 2 xrefs:
// > sub_100526FF8 @ 0x1005275dc
// > sub_100539B8C @ 0x100539c8c
//
// 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_10053D350(unsigned int *a1)
{
__int64 v2; // x2
__int64 v3; // x4
__int64 v4; // x21
char *v6; // x20
void (__fastcall *v7)(__int64, _QWORD, __int64, char *, __int64, unsigned int *, _QWORD); // x8
if ( (a1[166] & 3) != 1 )
{
v2 = 365;
v3 = 1514;
goto LABEL_8;
}
if ( a1[167] )
{
v2 = 366;
v3 = 1520;
LABEL_8:
sub_1005E0E48(20, 305, v2, "d1_both.c", v3);
return 0xFFFFFFFFLL;
}
if ( (sub_10053ED1C(a1) & 0x3000) != 0 || a1[11] )
{
v2 = 244;
v3 = 1526;
goto LABEL_8;
}
v6 = (char *)sub_100588710(37, "d1_both.c", 1546);
*(_WORD *)v6 = 1;
v6[2] = 18;
v6[3] = BYTE1(a1[168]);
v6[4] = a1[168];
if ( (sub_1005E0260(v6 + 5, 16) & 0x80000000) != 0 )
{
v4 = 0xFFFFFFFFLL;
}
else if ( (sub_1005E0260(v6 + 21, 16) & 0x80000000) != 0 )
{
v4 = 0xFFFFFFFFLL;
}
else
{
v4 = sub_10053B4E4((__int64)a1, 24, (__int64)v6, 37);
if ( (v4 & 0x80000000) == 0 )
{
v7 = *((void (__fastcall **)(__int64, _QWORD, __int64, char *, __int64, unsigned int *, _QWORD))a1 + 19);
if ( v7 )
v7(1, *a1, 24, v6, 37, a1, *((_QWORD *)a1 + 20));
sub_100539D24((__int64)a1);
a1[167] = 1;
}
}
sub_100588C44(v6);
return v4;
}