//
// lws_plat_set_socket_options from 0x64c070 to 0x64c122 (178 bytes)
//
// 1 xrefs:
// > sub_64A6CC @ 0x64a982
//
// 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
//
unsigned int __fastcall lws_plat_set_socket_options(_DWORD *a1, int a2)
{
int v2; // r3
int v6; // [sp+Ch] [bp-4h] BYREF
v2 = a1[1153];
v6 = 1;
if ( v2 )
{
if ( setsockopt(a2, 1, 9, &v6, 4) < 0 )
return 1;
v6 = a1[1153];
if ( setsockopt(a2, 6, 4, &v6, 4) < 0 )
return 1;
v6 = a1[1155];
if ( setsockopt(a2, 6, 5, &v6, 4) < 0 )
return 1;
v6 = a1[1154];
if ( setsockopt(a2, 6, 6, &v6, 4) < 0 )
return 1;
}
v6 = 1;
if ( setsockopt(a2, 6, 1, &v6, 4) < 0 )
return 1;
else
return (unsigned int)fcntl(a2, 4, 2048) >> 31;
}