//
// sub_61C8C from 0x61c8c to 0x61d00 (116 bytes)
//
// 2 xrefs:
// > sub_836EC @ 0x837cc
// > sub_E0F84 @ 0xe1428
//
// 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:13:53 +0000
//
__int64 __fastcall sub_61C8C(int fd, char *buf, size_t n, _DWORD *a4)
{
unsigned int v5; // w20
ssize_t v8; // x0
__int64 v10; // x0
v5 = n;
*a4 = 0;
if ( !(_DWORD)n )
return 0;
while ( 1 )
{
v8 = send(fd, buf, v5, 0x4000);
if ( v8 == -1 )
break;
v5 -= v8;
buf += v8;
*a4 += v8;
if ( !v5 )
return 0;
}
v10 = __errno();
return sub_61D9C(v10);
}