//
// std::__ndk1::ios_base::iword from 0x95c568 to 0x95c618 (176 bytes)
//
// 0 xrefs:
//
// 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:34 +0000
//
int *__fastcall std::ios_base::iword(std::ios_base *this, int a2)
{
unsigned int v4; // r0
unsigned int v5; // r4
int v6; // r9
char *v7; // r5
unsigned int v8; // r6
unsigned int v9; // t1
unsigned int v10; // r10
unsigned int *v11; // r11
char *v12; // r0
char *v13; // r0
unsigned int v14; // r1
int *result; // r0
v4 = *((_DWORD *)this + 14);
v5 = a2 + 1;
if ( a2 + 1 <= v4 )
{
v9 = *((_DWORD *)this + 13);
v7 = (char *)this + 52;
v8 = v9;
v10 = *((_DWORD *)v7 - 1);
v11 = (unsigned int *)v7;
}
else
{
if ( v5 > 0x1FFFFFFE )
{
v6 = 0x3FFFFFFF;
}
else
{
v6 = 2 * v4;
if ( 2 * v4 < v5 )
v6 = a2 + 1;
}
v12 = (char *)realloc(*((void **)this + 12), 4 * v6);
v10 = (unsigned int)v12;
if ( !v12 )
{
std::ios_base::clear(this, *((_DWORD *)this + 4) | 1);
dword_D32E78 = 0;
return &dword_D32E78;
}
*((_DWORD *)this + 12) = v12;
v11 = (unsigned int *)((char *)this + 52);
v8 = *((_DWORD *)this + 13);
if ( (int)v8 < v6 )
{
v13 = &v12[4 * v8];
v14 = v10 + 4 * v6;
if ( (unsigned int)(v13 + 4) > v14 )
v14 = (unsigned int)(v13 + 4);
memset(v13, 0, (v14 - 4 * v8 + ~v10 + 4) & 0xFFFFFFFC);
}
*((_DWORD *)this + 14) = v6;
}
result = (int *)(v10 + 4 * a2);
if ( v8 < v5 )
v8 = v5;
*v11 = v8;
return result;
}