//
// sub_18001C670 from 0x18001c670 to 0x18001c6fd (141 bytes)
//
// 2 xrefs:
// > ??> @ 0x1800ecbe8
// > ??> @ 0x1801b8b9c
//
// 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 11:21:26 +0000
//
__int64 __fastcall sub_18001C670(__int64 a1, unsigned int a2)
{
unsigned __int64 v4; // rsi
v4 = std::streambuf::gptr(a1);
if ( !v4
|| v4 <= std::streambuf::eback(a1)
|| a2 != -1 && (_BYTE)a2 != *(_BYTE *)(v4 - 1) && (*(_BYTE *)(a1 + 112) & 2) != 0 )
{
return 0xFFFFFFFFLL;
}
std::streambuf::gbump(a1, 0xFFFFFFFFLL);
if ( a2 == -1 )
return 0;
else
*(_BYTE *)std::streambuf::gptr(a1) = a2;
return a2;
}