//
// std::__ndk1::basic_streambuf>::xsputn from 0x7fd644 to 0x7fd708 (196 bytes)
//
// 5 xrefs:
// > ??> @ 0xe01e8
// > ??> @ 0x143eeb0
// > ??> @ 0x143ef50
// > ??> @ 0x1531f50
// > ??> @ 0x1533210
//
// 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 12:54:42 +0000
//
__int64 __fastcall std::streambuf::xsputn(_QWORD *a1, unsigned __int8 *a2, __int64 a3)
{
__int64 i; // x20
signed __int64 v7; // x19
unsigned __int64 v8; // x2
__int64 v9; // x1
char *v11; // x0
for ( i = 0; a3 > i; a1[6] = &v11[v7] )
{
while ( 1 )
{
v11 = (char *)a1[6];
v8 = a1[7];
v7 = v8 - (_QWORD)v11;
if ( (unsigned __int64)v11 < v8 )
break;
v9 = *a2++;
if ( (*(unsigned int (__fastcall **)(_QWORD *, __int64))(*a1 + 104LL))(a1, v9) != -1 && a3 > ++i )
continue;
return i;
}
if ( a3 - i <= v7 )
v7 = a3 - i;
i += v7;
if ( v7 )
{
memcpy(v11, a2, v7);
v11 = (char *)a1[6];
}
a2 += v7;
}
return i;
}