//
// sub_100901FE0 from 0x100901fe0 to 0x1009020c2 (226 bytes)
//
// 6 xrefs:
// > ??> @ 0x100bb3970
// > ??> @ 0x100bb8cd0
// > ??> @ 0x100bb9518
// > ??> @ 0x100bbdff8
// > ??> @ 0x100bbf7d0
// > ??> @ 0x100bd59b0
//
// 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:03 +0000
//
__int64 __fastcall sub_100901FE0(__int64 a1, __int64 a2, __int64 a3, unsigned int a4)
{
unsigned int v4; // ebx
__int64 v5; // r14
unsigned int v6; // r12d
char v7; // al
__int64 v8; // r15
__int64 v9; // rdi
v5 = a1 - 344;
if ( *(_BYTE *)(a1 + 751)
|| qword_100BE7A80
&& (v4 = a1, v6 = a3, v7 = sub_100495310(a1 - 344, qword_100BE7A80, a3, a4), a3 = v6, a2 = (unsigned int)a2, v7) )
{
*(_BYTE *)(a1 + 751) = 0;
LOBYTE(v4) = 1;
if ( (_BYTE)a3 )
{
if ( (_DWORD)a2 == 20067 )
{
v8 = qword_100BE7A80;
if ( qword_100BE7A80 )
{
if ( (unsigned __int8)sub_100495310(v5, qword_100BE7A80, a3, a4) )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 1160LL))(v8, 0);
}
}
else
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 1528LL))(v5);
}
}
}
else
{
v9 = *(_QWORD *)(a1 + 672);
if ( v9 )
return (*(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v9 + 1312LL))(v9, a2, (unsigned __int8)a3);
return 0;
}
return v4;
}