//
// sub_100182B80 from 0x100182b80 to 0x100182bc8 (72 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008c3c48
//
// 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_100182B80(__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;
}