//
// sub_1401787A0 from 0x1401787a0 to 0x140178804 (100 bytes)
//
// 1 xrefs:
// > ??> @ 0x14055bc10
//
// 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_1401787A0(__int64 a1)
{
unsigned __int8 **v1; // r10
unsigned __int8 *v3; // rcx
unsigned __int64 *v4; // rax
unsigned __int64 v5; // rdx
unsigned __int8 *v6; // rcx
v1 = *(unsigned __int8 ***)(a1 + 56);
v3 = *v1;
if ( *v1 )
{
if ( v3 < &v3[**(int **)(a1 + 80)] )
return *v3;
v4 = *(unsigned __int64 **)(a1 + 64);
if ( *v4 && (*(_BYTE *)(a1 + 112) & 4) == 0 )
{
v5 = *(_QWORD *)(a1 + 104);
if ( v5 < *v4 )
v5 = *v4;
if ( v5 > (unsigned __int64)v3 )
{
*(_QWORD *)(a1 + 104) = v5;
v6 = *v1;
*v1 = *v1;
**(_DWORD **)(a1 + 80) = v5 - (_DWORD)v6;
v3 = **(unsigned __int8 ***)(a1 + 56);
return *v3;
}
}
}
return 0xFFFFFFFFLL;
}