//
// std::__ndk1::basic_streambuf>::xsputn from 0x4a9d14 to 0x4a9d66 (82 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 11:49:57 +0000
//
int __fastcall std::streambuf::xsputn(_DWORD *a1, unsigned __int8 *a2, int a3)
{
int v6; // r5
void *v7; // r0
unsigned int v8; // r3
size_t v9; // r4
signed int v10; // r3
const void *v11; // r1
v6 = 0;
while ( v6 < a3 )
{
v7 = (void *)a1[6];
v8 = a1[7];
if ( (unsigned int)v7 < v8 )
{
v9 = a3 - v6;
v10 = v8 - (_DWORD)v7;
v11 = a2;
if ( a3 - v6 >= v10 )
v9 = v10;
a2 += v9;
v6 += v9;
std::char_traits::copy(v7, v11, v9);
a1[6] += v9;
}
else
{
if ( (*(int (__fastcall **)(_DWORD *, _DWORD))(*a1 + 52))(a1, *a2) == -1 )
return v6;
++a2;
++v6;
}
}
return v6;
}