//
// sub_1800214B0 from 0x1800214b0 to 0x1800215a5 (245 bytes)
//
// 3 xrefs:
// > DS_Dictionary::setRectForKey @ 0x18001fc67
// > DS_Dictionary::setVec2ForKey @ 0x180020af5
// > ??> @ 0x1801aee00
//
// 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
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall sub_1800214B0(__int64 a1, __int64 a2)
{
__int64 v3; // rbx
__int128 v4; // rdi
unsigned __int64 *v5; // r8
unsigned __int64 v7; // [rsp+28h] [rbp-40h] BYREF
__int128 v8; // [rsp+30h] [rbp-38h]
__int64 v9; // [rsp+48h] [rbp-20h]
v9 = a2;
v3 = a1 + 24;
*(_OWORD *)a2 = 0;
*(_QWORD *)(a2 + 16) = 0;
*(_QWORD *)(a2 + 24) = 15;
*(_BYTE *)a2 = 0;
v8 = 0;
if ( (*(_DWORD *)(a1 + 136) & 0x22) == 2 || !std::streambuf::pptr(a1 + 24) )
{
if ( (*(_BYTE *)(v3 + 112) & 4) != 0 || !std::streambuf::gptr(v3) )
{
v4 = v8;
}
else
{
*(_QWORD *)&v4 = std::streambuf::eback(v3);
*((_QWORD *)&v4 + 1) = std::streambuf::egptr(v3) - v4;
}
}
else
{
*(_QWORD *)&v4 = std::streambuf::pbase(v3);
v7 = std::streambuf::pptr(v3);
v5 = &v7;
if ( v7 < *(_QWORD *)(v3 + 104) )
v5 = (unsigned __int64 *)(v3 + 104);
*((_QWORD *)&v4 + 1) = *v5 - v4;
std::streambuf::epptr(v3);
}
if ( (_QWORD)v4 )
sub_180010050((void **)a2, (void *)v4, *((size_t *)&v4 + 1));
return a2;
}