//
// sub_7D38E0 from 0x7d38e0 to 0x7d39bc (220 bytes)
//
// 1 xrefs:
// > ??> @ 0xa30868
//
// 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_7D38E0(_DWORD *a1, int a2, int a3, _DWORD *a4)
{
if ( a2 > 12 )
{
if ( a2 == 104 )
{
if ( a1 && a1[4] )
{
if ( a1[3] )
BIO_closesocket(a1[7]);
a1[3] = 0;
a1[5] = 0;
}
a1[7] = *a4;
a1[4] = a3;
a1[3] = 1;
return 1;
}
else
{
if ( a2 != 105 )
return 0;
if ( a1[3] )
{
if ( a4 )
*a4 = a1[7];
return a1[7];
}
else
{
return -1;
}
}
}
else
{
if ( a2 >= 11 )
return 1;
if ( a2 != 8 )
{
if ( a2 == 9 )
{
a1[4] = a3;
return 1;
}
return 0;
}
return a1[4];
}
}