//
// std::__ndk1::basic_istream>::get from 0xf463c4 to 0xf46580 (444 bytes)
//
// 2 xrefs:
// > std::__ndk1::basic_istream>::get @ 0xf46380
// > ??> @ 0x98db8
//
// This function is hookable on this platform (idp: arm, 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 13:13:10 +0000
//
__int64 *__fastcall std::istream::get(__int64 *a1, _BYTE *a2, __int64 a3, unsigned __int8 a4)
{
__int64 v5; // x8
__int64 v8; // x9
__int64 v10; // x0
int v11; // w10
_QWORD *v13; // x0
bool v14; // cc
__int64 v15; // x22
int v16; // w9
_QWORD *v17; // x0
_BYTE *v18; // x8
int v19; // w0
__int64 v20; // x9
__int64 v21; // x8
_QWORD *v22; // x0
__int64 v23; // x9
v5 = *a1;
a1[1] = 0;
v8 = *(_QWORD *)(v5 - 24);
v10 = (__int64)a1 + v8;
v11 = *(_DWORD *)(v10 + 32);
if ( v11 )
{
std::ios_base::clear(v10, v11 | 4);
return a1;
}
v13 = *(_QWORD **)(v10 + 136);
if ( !v13 || (std::ostream::flush(v13), v5 = *a1, v8 = *(_QWORD *)(*a1 - 24), !*(_DWORD *)((char *)a1 + v8 + 32)) )
{
v14 = a3 < 1;
v15 = a3 - 1;
if ( v14 )
{
std::ios_base::clear((__int64)a1 + v8, 4);
return a1;
}
if ( a1[1] >= v15 )
{
v16 = 0;
goto LABEL_20;
}
while ( 1 )
{
v17 = *(_QWORD **)((char *)a1 + v8 + 40);
v18 = (_BYTE *)v17[3];
if ( v18 == (_BYTE *)v17[4] )
{
v19 = (*(__int64 (__fastcall **)(_QWORD *))(*v17 + 72LL))(v17);
if ( v19 == -1 )
{
v16 = 2;
LABEL_19:
v5 = *a1;
LABEL_20:
*a2 = 0;
if ( !a1[1] )
v16 |= 4u;
std::ios_base::clear(
(__int64)a1 + *(_QWORD *)(v5 - 24),
*(_DWORD *)((char *)a1 + *(_QWORD *)(v5 - 24) + 32) | v16);
return a1;
}
}
else
{
LOBYTE(v19) = *v18;
}
if ( (unsigned __int8)v19 == a4 )
goto LABEL_18;
*a2++ = v19;
v20 = *a1;
v21 = a1[1] + 1;
a1[1] = v21;
v22 = *(_QWORD **)((char *)a1 + *(_QWORD *)(v20 - 24) + 40);
v23 = v22[3];
if ( v23 == v22[4] )
{
(*(void (__fastcall **)(_QWORD *))(*v22 + 80LL))(v22);
v21 = a1[1];
}
else
{
v22[3] = v23 + 1;
}
if ( v21 >= v15 )
{
LABEL_18:
v16 = 0;
goto LABEL_19;
}
v8 = *(_QWORD *)(*a1 - 24);
}
}
return a1;
}