//
// sub_180091FF0 from 0x180091ff0 to 0x1800920a6 (182 bytes)
//
// 5 xrefs:
// > ??> @ 0x180167200
// > ??> @ 0x1801850f0
// > ??> @ 0x180185104
// > ??> @ 0x180185118
// > ??> @ 0x1801fa800
//
// 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_180091FF0(__int64 a1, char a2, char a3, char a4)
{
__int64 v6; // rdi
if ( !a2 )
{
*(_DWORD *)(a1 + 564) = -1;
return 0;
}
if ( a3 )
{
v6 = *(_QWORD *)(a1 + 168);
if ( !a4 && v6 )
{
sub_1801021C0(*(_QWORD *)(a1 + 168), 3);
*(_DWORD *)(a1 + 564) = 0;
sub_180102300(v6, 3);
return 0;
}
goto LABEL_9;
}
if ( ((*(_DWORD *)(a1 + 564) + 1) & 0xFFFFFFFE) == 0 )
{
if ( (*(_DWORD *)(a1 + 100) & 0x100) != 0 )
{
LABEL_9:
*(_DWORD *)(a1 + 564) = 0;
return 0;
}
*(_DWORD *)(a1 + 564) = *(_DWORD *)(*(_QWORD *)(a1 + 168) + 69856LL) + 1;
}
return 0;
}