//
// sub_140253930 from 0x140253930 to 0x140253a27 (247 bytes)
//
// 4 xrefs:
// > sub_140251180 @ 0x140251339
// > ??> @ 0x140683ef8
// > ??> @ 0x140683f08
// > ??> @ 0x1406cf6b4
//
// 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_140253930(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
void **v4; // rbx
void **i; // rsi
void **v10; // r8
__int64 result; // rax
v4 = *(void ***)a1;
if ( *(_QWORD *)a1 )
{
for ( i = *(void ***)(a1 + 8); v4 != i; v4 += 29 )
{
sub_14005E430((__int64)(v4 + 25));
sub_1402508A0(v4, (__int64)v4);
}
v10 = *(void ***)a1;
if ( (unsigned __int64)(232 * ((*(_QWORD *)(a1 + 16) - *(_QWORD *)a1) / 232LL)) >= 0x1000 )
{
if ( (unsigned __int64)((char *)v10 - (_BYTE *)*(v10 - 1) - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
v10 = (void **)*(v10 - 1);
}
j_j_free(v10);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 232 * a3;
result = a2 + 232 * a4;
*(_QWORD *)(a1 + 16) = result;
return result;
}