//
// sub_100161F70 from 0x100161f70 to 0x100161fb8 (72 bytes)
//
// 1 xrefs:
// > ??> @ 0x100ac7518
//
// 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:25:08 +0000
//
__int64 __fastcall sub_100161F70(__int64 a1, unsigned int a2)
{
__int64 result; // rax
unsigned __int64 v3; // rcx
result = 0xFFFFFFFFLL;
if ( *(_QWORD *)(a1 + 120) )
{
v3 = *(_QWORD *)(a1 + 24);
if ( *(_QWORD *)(a1 + 16) < v3 )
{
if ( a2 == -1 )
{
*(_QWORD *)(a1 + 24) = v3 - 1;
return 0;
}
else if ( (*(_BYTE *)(a1 + 392) & 0x10) != 0 || *(_BYTE *)(v3 - 1) == (_BYTE)a2 )
{
*(_QWORD *)(a1 + 24) = v3 - 1;
*(_BYTE *)(v3 - 1) = a2;
return a2;
}
}
}
return result;
}