//
// sub_10063FB70 from 0x10063fb70 to 0x10063fbf4 (132 bytes)
//
// 2 xrefs:
// > sub_10063F6F0 @ 0x10063f9c7
// > sub_10063F6F0 @ 0x10063fa92
//
// This function is hookable on this platform (idp: pc, 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 12:34:42 +0000
//
__int64 __fastcall sub_10063FB70(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // rcx
__int64 v4; // rbx
int v5; // eax
bool v6; // sf
int v7; // eax
__int64 v8; // rdx
__int64 v9; // rcx
result = *(int *)(a1 + 1064);
if ( result >= 0 )
{
v3 = *(_QWORD *)(a1 + 1016);
if ( (int)result < (int)(954437177 * ((unsigned __int64)(*(_QWORD *)(a1 + 1024) - v3) >> 3)) )
{
result *= 9;
if ( *(int *)(v3 + 8 * result + 56) >= 2 )
{
v4 = v3 + 8 * result;
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
v6 = *(_DWORD *)(v4 + 52) + v5 < 0;
v7 = *(_DWORD *)(v4 + 52) + v5;
*(_DWORD *)(v4 + 52) = v7;
v8 = *(unsigned int *)(v4 + 56);
if ( v6 )
{
v8 = (unsigned int)(v8 - 1);
v9 = (unsigned int)v8;
}
else
{
v9 = 0;
if ( v7 < (int)v8 )
return (*(__int64 (__fastcall **)(__int64, _QWORD, __int64, __int64))(*(_QWORD *)a1 + 1504LL))(
a1,
*(unsigned int *)(a1 + 1064),
v8,
v9);
}
*(_DWORD *)(v4 + 52) = v9;
return (*(__int64 (__fastcall **)(__int64, _QWORD, __int64, __int64))(*(_QWORD *)a1 + 1504LL))(
a1,
*(unsigned int *)(a1 + 1064),
v8,
v9);
}
}
}
return result;
}