//
// sub_D77B58 from 0xd77b58 to 0xd77c14 (188 bytes)
//
// 1 xrefs:
// > ??> @ 0x11223e8
//
// 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_D77B58(__int64 a1, char *a2)
{
int v4; // w0
unsigned int *v5; // x1
int v6; // w22
__int64 result; // x0
int v8; // w19
v4 = strlen(a2);
v5 = *(unsigned int **)(a1 + 48);
v6 = v4;
if ( *v5 != 5 )
{
LODWORD(result) = sub_D773BC(a1, v5);
if ( (int)result <= 0 )
return (unsigned int)result;
}
*(_DWORD *)__errno() = 0;
v8 = write(*(_DWORD *)(a1 + 40), a2, v6);
BIO_clear_flags(a1, 15);
if ( v8 <= 0 )
{
if ( (unsigned int)BIO_sock_should_retry((unsigned int)v8) )
BIO_set_flags(a1, 10);
}
return (unsigned int)v8;
}