//
// sub_10053BFB8 from 0x10053bfb8 to 0x10053c0f0 (312 bytes)
//
// 2 xrefs:
// > sub_10053BADC @ 0x10053bb00
// > sub_10053BADC @ 0x10053bf08
//
// 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_10053BFB8(__int64 a1)
{
__int64 v2; // x8
int v3; // w20
__int64 v4; // x0
unsigned int v5; // w20
__int64 v6; // x8
__int64 v7; // x0
__int64 v8; // x0
unsigned int v9; // w20
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x0
v2 = *(_QWORD *)(a1 + 136);
v3 = *(_DWORD *)(v2 + 644);
if ( v3 )
{
v4 = sub_10053E840(a1);
v5 = v3 - sub_1005DAB78(v4, 49, 0, 0);
v6 = *(_QWORD *)(a1 + 136);
*(_DWORD *)(v6 + 648) = v5;
*(_DWORD *)(v6 + 644) = 0;
}
else
{
v5 = *(_DWORD *)(v2 + 648);
}
v7 = sub_10053E840(a1);
if ( v5 >= 256 - (unsigned int)sub_1005DAB78(v7, 49, 0, 0) )
return 1;
if ( (sub_10053ED24(a1, 32, 0, 0) & 0x1000) == 0 )
{
v8 = sub_10053E840(a1);
v9 = sub_1005DAB78(v8, 40, 0, 0);
*(_DWORD *)(*(_QWORD *)(a1 + 136) + 648LL) = v9;
v10 = sub_10053E840(a1);
if ( v9 < 256 - (unsigned int)sub_1005DAB78(v10, 49, 0, 0) )
{
v11 = sub_10053E840(a1);
*(_DWORD *)(*(_QWORD *)(a1 + 136) + 648LL) = 256 - sub_1005DAB78(v11, 49, 0, 0);
v12 = sub_10053E840(a1);
sub_1005DAB78(v12, 42, *(unsigned int *)(*(_QWORD *)(a1 + 136) + 648LL), 0);
}
return 1;
}
return 0;
}