//
// sub_10091E2F0 from 0x10091e2f0 to 0x10091e3a4 (180 bytes)
//
// 1 xrefs:
// > sub_10091DEE0 @ 0x10091e20e
//
// 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:38:15 +0000
//
__int64 __fastcall sub_10091E2F0(_QWORD *a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rcx
__int64 v5; // rdx
_QWORD *v6; // rdi
char *v7; // rax
char v8; // r15
_QWORD *v9; // rdi
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (int)result >= 0 )
{
v4 = a1[85];
if ( (int)result < (int)(-1431655765 * ((unsigned __int64)(a1[86] - v4) >> 4)) )
{
v5 = 48LL * (unsigned int)result;
v6 = *(_QWORD **)(v4 + v5 + 16);
v7 = *(char **)(v4 + v5 + 24);
if ( !v6 )
v6 = a1;
v8 = *(_BYTE *)(v4 + v5 + 40);
v9 = (_QWORD *)((char *)v6 + *(_QWORD *)(v4 + v5 + 32));
if ( ((unsigned __int8)v7 & 1) != 0 )
v7 = *(char **)&v7[*v9 - 1];
result = ((__int64 (__fastcall *)(_QWORD *, __int64))v7)(v9, a2);
if ( (v8 & 1) != 0 )
{
(*(void (__fastcall **)(_QWORD *, _QWORD))(*a1 + 1072LL))(a1, 0);
return (*(__int64 (__fastcall **)(_QWORD *, __int64))(*a1 + 528LL))(a1, 1);
}
}
}
return result;
}