//
// std::__ndk1::basic_istream>::read from 0x81af04 to 0x81af76 (114 bytes)
//
// 3 xrefs:
// > pugi::xml_document::load @ 0x81b032
// > pugi::xml_document::load @ 0x81b23e
// > std::__ndk1::basic_istream>::readsome @ 0x957442
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:45 +0000
//
int *__fastcall std::istream::read(int *a1, int a2, int a3)
{
int v6; // r3
int v7; // r0
int v8; // r0
std::ios_base *v9; // r0
unsigned int v10; // r1
_DWORD v12[3]; // [sp+0h] [bp-Ch] BYREF
v12[0] = a1;
v12[1] = a2;
v12[2] = a3;
a1[1] = 0;
std::istream::sentry::sentry((bool *)v12, a1, 1);
v6 = *a1;
if ( !LOBYTE(v12[0]) )
{
v9 = (std::ios_base *)((char *)a1 + *(_DWORD *)(v6 - 12));
v10 = *((_DWORD *)v9 + 4) | 4;
goto LABEL_5;
}
v7 = *(int *)((char *)a1 + *(_DWORD *)(v6 - 12) + 24);
v8 = (*(int (__fastcall **)(int, int, int))(*(_DWORD *)v7 + 32))(v7, a2, a3);
a1[1] = v8;
if ( v8 != a3 )
{
v9 = (std::ios_base *)((char *)a1 + *(_DWORD *)(*a1 - 12));
v10 = *((_DWORD *)v9 + 4) | 6;
LABEL_5:
std::ios_base::clear(v9, v10);
}
return a1;
}