//
// sub_1800219D0 from 0x1800219d0 to 0x180021a4c (124 bytes)
//
// 2 xrefs:
// > ??> @ 0x1800e7040
// > ??> @ 0x1801aee48
//
// 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_1800219D0(__int64 a1)
{
unsigned __int64 v2; // rbx
__int64 result; // rax
unsigned int v4; // ebx
if ( std::streambuf::gptr(a1) )
{
v2 = std::streambuf::egptr(a1);
if ( std::streambuf::gptr(a1) < v2 )
return *(unsigned __int8 *)std::streambuf::gptr(a1);
}
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 56LL))(a1);
v4 = result;
if ( (_DWORD)result != -1 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 32LL))(a1, (unsigned int)result);
return v4;
}
return result;
}