//
// sub_100653308 from 0x100653308 to 0x10065337c (116 bytes)
//
// 1 xrefs:
// > sub_10064F638 @ 0x10064f7b0
//
// This function is hookable on this platform (idp: arm, 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 11:10:51 +0000
//
__int64 __fastcall sub_100653308(__int64 a1, __int64 a2, int a3, int a4)
{
unsigned int v4; // w8
int v6; // w10
int v7; // w9
int v8; // w9
int v9; // w10
v4 = *(_DWORD *)(a2 + 4);
if ( a4 + 1 > v4 )
return 0;
v6 = *(unsigned __int8 *)(*(_QWORD *)(a2 + 16) + v4 - 1);
v7 = v6 + a4 + 1;
++v6;
v8 = ((v4 - v7) ^ v7 | v7 ^ v4) ^ v4 | (a3 - v6) & ~a3;
v9 = v6 & ~(v8 >> 31);
*(_DWORD *)(a2 + 4) = v4 - v9;
*(_DWORD *)a2 |= v9 << 8;
return (~(v8 >> 31) | 1) ^ 0xFFFFFFFE;
}