//
// sub_100539E34 from 0x100539e34 to 0x100539ee8 (180 bytes)
//
// 2 xrefs:
// > sub_100539B8C @ 0x100539c58
// > sub_10053A8A4 @ 0x10053af3c
//
// 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_100539E34(__int64 a1)
{
__int64 v2; // x8
unsigned int v3; // w9
__int64 v4; // x0
unsigned int v5; // w0
v2 = *(_QWORD *)(a1 + 136);
v3 = *(_DWORD *)(v2 + 840) + 1;
*(_DWORD *)(v2 + 840) = v3;
if ( v3 >= 3 )
{
if ( (sub_10053ED24(a1, 32, 0, 0) & 0x1000) != 0 )
{
v2 = *(_QWORD *)(a1 + 136);
}
else
{
v4 = sub_10053E840(a1);
v5 = sub_1005DAB78(v4, 47, 0, 0);
v2 = *(_QWORD *)(a1 + 136);
if ( v5 < *(_DWORD *)(v2 + 648) )
*(_DWORD *)(v2 + 648) = v5;
}
}
if ( *(_DWORD *)(v2 + 840) < 0xDu )
return 0;
sub_1005E0E48(20, 316, 312, "d1_lib.c", 480);
return 0xFFFFFFFFLL;
}