//
// sub_77A0DC from 0x77a0dc to 0x77a10a (46 bytes)
//
// 6 xrefs:
// > sub_76E078 @ 0x76e196
// > sub_76E078 @ 0x76e1d4
// > sub_76E34C @ 0x76e46a
// > sub_76E34C @ 0x76e4a6
// > sub_76E624 @ 0x76e6b6
// > sub_76E7A4 @ 0x76e82c
//
// 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
//
ssize_t __fastcall sub_77A0DC(int a1, void *buf, size_t nbytes)
{
ssize_t result; // r0
while ( 1 )
{
result = read(*(__int16 *)(*(_DWORD *)a1 + 14), buf, nbytes);
if ( result != -1 )
break;
if ( *(_DWORD *)_errno() != 4 )
return -1;
}
return result;
}