//
// sub_100886B40 from 0x100886b40 to 0x100886c0f (207 bytes)
//
// 2 xrefs:
// > sub_1008857C0 @ 0x100885824
// > sub_1008857C0 @ 0x10088583d
//
// 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:36:59 +0000
//
__int64 __fastcall sub_100886B40(__int64 a1, __int64 a2, unsigned __int8 a3)
{
__int64 result; // rax
unsigned int v5; // r14d
unsigned int v6; // r15d
__int64 v7; // r13
__int64 v8; // r12
unsigned int v9; // ecx
_DWORD v10[13]; // [rsp-34h] [rbp-34h] BYREF
if ( a2 )
{
v10[0] = HIDWORD(result);
if ( a3 )
{
BYTE2(v10[0]) = -106;
LOWORD(v10[0]) = -26986;
result = sub_1007FEF90(a2);
if ( (unsigned int)result < 2 )
return result;
}
else
{
BYTE2(v10[0]) = -1;
LOWORD(v10[0]) = -1;
result = sub_1007FEF90(a2);
if ( (unsigned int)result < 2 )
return result;
}
v5 = 0;
v6 = a3 ^ 1;
do
{
v7 = sub_1007FEFE0(a2, v5);
v8 = sub_1007FEFE0(a2, v5 + 1);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 1056LL))(v7, v6);
sub_10001F080(v7, (__int64)v10);
(*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v8 + 1072LL))(v8, v10);
result = sub_1007FEF90(a2);
v9 = v5 + 3;
v5 += 2;
}
while ( v9 < (unsigned int)result );
}
return result;
}