//
// lws_plat_set_socket_options from 0xe38aec to 0xe38bfc (272 bytes)
//
// 4 xrefs:
// > sub_E36E2C @ 0xe370fc
// > sub_E38FC8 @ 0xe39054
// > lws_server_socket_service @ 0xe39b84
// > ??> @ 0xf2d28
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:09:59 +0000
//
__int64 __fastcall lws_plat_set_socket_options(_DWORD *a1, int a2)
{
int v3; // w0
int v6; // [xsp+3Ch] [xbp+3Ch] BYREF
v3 = a1[1143];
v6 = 1;
if ( v3 )
{
if ( setsockopt(a2, 1, 9, &v6, 4u) < 0 )
return 1;
v6 = a1[1143];
if ( setsockopt(a2, 6, 4, &v6, 4u) < 0 )
return 1;
v6 = a1[1145];
if ( setsockopt(a2, 6, 5, &v6, 4u) < 0 )
return 1;
v6 = a1[1144];
if ( setsockopt(a2, 6, 6, &v6, 4u) < 0 )
return 1;
}
v6 = 1;
if ( setsockopt(a2, 6, 1, &v6, 4u) < 0 )
return 1;
else
return (unsigned int)fcntl(a2, 4, 2048) >> 31;
}