//
// sub_18001E520 from 0x18001e520 to 0x18001e5b3 (147 bytes)
//
// 2 xrefs:
// > ??> @ 0x1800e7068
// > ??> @ 0x1801aec20
//
// 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_18001E520(__int64 a1, fpos_t *a2, _QWORD *a3)
{
bool v5; // zf
fpos_t v7; // rax
fpos_t Position; // [rsp+30h] [rbp+8h] BYREF
v5 = *(_QWORD *)(a1 + 128) == 0;
Position = *a3 + a3[1];
if ( v5 || !sub_180018A50(a1) || fsetpos(*(FILE **)(a1 + 128), &Position) )
{
*a2 = -1;
v7 = 0;
}
else
{
*(_QWORD *)(a1 + 116) = a3[2];
sub_180018B60(a1);
v7 = *(_QWORD *)(a1 + 116);
*a2 = Position;
}
a2[1] = 0;
a2[2] = v7;
return a2;
}