//
// sub_1004F5F4C from 0x1004f5f4c to 0x1004f5fd8 (140 bytes)
//
// 2 xrefs:
// > sub_10044D7E4 @ 0x10044d8b4
// > sub_1004AB2B8 @ 0x1004ab510
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1004F5F4C(int a1, char *a2, unsigned int a3, _DWORD *a4)
{
unsigned int v5; // w20
ssize_t v8; // x0
*a4 = 0;
if ( !a3 )
return 0;
v5 = a3;
while ( 1 )
{
v8 = send(a1, a2, v5, 0x80000);
if ( v8 == -1 )
break;
*a4 += v8;
a2 += v8;
v5 -= v8;
if ( !v5 )
return 0;
}
if ( *__error() == 35 )
return 45;
else
return 43;
}