//
// sub_CF9840 from 0xcf9840 to 0xcf9890 (80 bytes)
//
// 0 xrefs:
//
// 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_CF9840(_QWORD *a1, unsigned __int8 a2)
{
unsigned __int64 v2; // x2
v2 = a1[2];
if ( a1[1] >= v2 || *(unsigned __int8 *)(v2 - 1) != a2 )
return (*(__int64 (__fastcall **)(_QWORD *, _QWORD))(*a1 + 88LL))(a1, a2);
a1[2] = v2 - 1;
return *(unsigned __int8 *)(v2 - 1);
}