//
// std::__ndk1::ios_base::pword from 0xf4e8e8 to 0xf4e9c4 (220 bytes)
//
// 1 xrefs:
// > ??> @ 0x7e2c8
//
// 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:15 +0000
//
__int64 *__fastcall std::ios_base::pword(std::ios_base *this, int a2)
{
__int64 v3; // x20
unsigned __int64 v4; // x21
__int64 v5; // x22
unsigned __int64 v6; // x8
char *v7; // x19
char *v8; // x0
unsigned __int64 *v9; // x9
char *v10; // x10
v3 = a2;
v4 = a2 + 1LL;
if ( v4 <= *((_QWORD *)this + 16) )
{
v7 = (char *)this + 120;
v6 = *((_QWORD *)this + 15);
v8 = *((char **)this + 14);
v9 = (unsigned __int64 *)v7;
}
else
{
if ( v4 > 0xFFFFFFFFFFFFFFELL )
{
v5 = 0x1FFFFFFFFFFFFFFFLL;
}
else if ( 2LL * *((_QWORD *)this + 13) >= v4 )
{
v5 = 2LL * *((_QWORD *)this + 13);
}
else
{
v5 = a2 + 1LL;
}
v8 = (char *)realloc(*((void **)this + 14), 8 * v5);
if ( !v8 )
{
std::ios_base::clear((__int64)this, *((_DWORD *)this + 8) | 1);
qword_1564088 = 0;
return &qword_1564088;
}
*((_QWORD *)this + 14) = v8;
v9 = (unsigned __int64 *)((char *)this + 120);
v6 = *((_QWORD *)this + 15);
if ( (__int64)v6 < v5 )
{
v10 = &v8[8 * v6];
do
{
*(_QWORD *)v10 = 0;
v10 += 8;
v8 = *((char **)this + 14);
}
while ( v10 < &v8[8 * v5] );
}
*((_QWORD *)this + 16) = v5;
}
if ( v6 < v4 )
v6 = v4;
*v9 = v6;
return (__int64 *)&v8[8 * v3];
}