//
// sub_50CA4 from 0x50ca4 to 0x50ce2 (62 bytes)
//
// 1 xrefs:
// > sub_522EC @ 0x52312
//
// 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
//
int __fastcall sub_50CA4(int a1, int a2, int *a3)
{
int v5; // r5
int result; // r0
int v7; // r1
v5 = accept(a1, nullptr, nullptr);
if ( v5 == -1 )
{
v7 = *(_DWORD *)_errno();
result = 43;
if ( v7 == 11 )
return 45;
}
else
{
result = sub_50A6C(v5, a2);
if ( !result )
{
*a3 = v5;
return 0;
}
}
return result;
}