//
// std::__ndk1::ios_base::register_callback from 0x95c6b4 to 0x95c73a (134 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::register_callback(std::ios_base *this, void (*a2)(event, std::ios_base *, int), int a3)
{
int v5; // r0
unsigned int v6; // r2
unsigned int v8; // r1
int v9; // r10
void *v10; // r6
void *v11; // r5
int result; // r0
v6 = *((_DWORD *)this + 11);
v5 = *((_DWORD *)this + 10);
v8 = v5 + 1;
if ( v5 + 1 > v6 )
{
if ( v8 > 0x1FFFFFFE )
{
v9 = 0x3FFFFFFF;
}
else
{
v9 = 2 * v6;
if ( 2 * v6 < v8 )
v9 = v5 + 1;
}
v10 = realloc(*((void **)this + 8), 4 * v9);
if ( !v10 )
std::ios_base::clear(this, *((_DWORD *)this + 4) | 1);
*((_DWORD *)this + 8) = v10;
v11 = realloc(*((void **)this + 9), 4 * v9);
if ( !v11 )
std::ios_base::clear(this, *((_DWORD *)this + 4) | 1);
*((_DWORD *)this + 9) = v11;
*((_DWORD *)this + 11) = v9;
v5 = *((_DWORD *)this + 10);
}
*(_DWORD *)(*((_DWORD *)this + 8) + 4 * v5) = a2;
*(_DWORD *)(*((_DWORD *)this + 9) + 4 * v5) = a3;
result = *((_DWORD *)this + 10) + 1;
*((_DWORD *)this + 10) = result;
return result;
}