//
// std::__ndk1::basic_istream>::getline from 0x9570e8 to 0x957220 (312 bytes)
//
// 1 xrefs:
// > std::__ndk1::basic_istream>::getline @ 0x9570b0
//
// 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:05:29 +0000
//
_DWORD *__fastcall std::istream::getline(_DWORD *a1, _BYTE *a2, int a3, int a4)
{
int v8; // r0
__int64 v9; // kr00_8
int v10; // r0
int v11; // r0
__int64 v12; // kr08_8
int v13; // r0
__int64 v14; // kr10_8
int v15; // r1
bool v17; // [sp+4h] [bp-14h] BYREF
a1[1] = 0;
std::istream::sentry::sentry(&v17, a1, 1);
if ( v17 )
{
while ( 1 )
{
v8 = *(_DWORD *)((char *)a1 + *(_DWORD *)(*a1 - 12) + 24);
v9 = *(_QWORD *)(v8 + 12);
if ( (_DWORD)v9 == HIDWORD(v9) )
{
v10 = (*(int (__fastcall **)(int))(*(_DWORD *)v8 + 36))(v8);
if ( v10 == -1 )
{
v15 = 2;
goto LABEL_18;
}
}
else
{
LOBYTE(v10) = *(_BYTE *)v9;
}
if ( (unsigned __int8)v10 == a4 )
break;
if ( a1[1] >= a3 - 1 )
{
v15 = 4;
goto LABEL_18;
}
*a2++ = v10;
v11 = *(_DWORD *)((char *)a1 + *(_DWORD *)(*a1 - 12) + 24);
v12 = *(_QWORD *)(v11 + 12);
if ( (_DWORD)v12 == HIDWORD(v12) )
(*(void (__fastcall **)(int))(*(_DWORD *)v11 + 40))(v11);
else
*(_DWORD *)(v11 + 12) = v12 + 1;
++a1[1];
}
v13 = *(_DWORD *)((char *)a1 + *(_DWORD *)(*a1 - 12) + 24);
v14 = *(_QWORD *)(v13 + 12);
if ( (_DWORD)v14 == HIDWORD(v14) )
(*(void (__fastcall **)(int))(*(_DWORD *)v13 + 40))(v13);
else
*(_DWORD *)(v13 + 12) = v14 + 1;
v15 = 0;
++a1[1];
LABEL_18:
if ( a3 >= 1 )
*a2 = 0;
if ( !a1[1] )
v15 |= 4u;
std::ios_base::clear(
(std::ios_base *)((char *)a1 + *(_DWORD *)(*a1 - 12)),
v15 | *(_DWORD *)((char *)a1 + *(_DWORD *)(*a1 - 12) + 16));
}
return a1;
}