//
// sub_18001E2A0 from 0x18001e2a0 to 0x18001e36e (206 bytes)
//
// 2 xrefs:
// > ??> @ 0x1800e7060
// > ??> @ 0x1801aec08
//
// 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
//
fpos_t *__fastcall sub_18001E2A0(__int64 a1, fpos_t *a2, __int64 a3, int a4)
{
fpos_t v8; // rax
fpos_t Position; // [rsp+30h] [rbp+8h] BYREF
if ( std::streambuf::gptr(a1) == a1 + 112 && a4 == 1 && !*(_QWORD *)(a1 + 104) )
--a3;
if ( !*(_QWORD *)(a1 + 128)
|| !sub_180018A50(a1)
|| (a3 || a4 != 1) && fseeki64(*(FILE **)(a1 + 128), a3, a4)
|| fgetpos(*(FILE **)(a1 + 128), &Position) )
{
*a2 = -1;
v8 = 0;
}
else
{
sub_180018B60(a1);
v8 = *(_QWORD *)(a1 + 116);
*a2 = Position;
}
a2[1] = 0;
a2[2] = v8;
return a2;
}