//
// sub_62E01C from 0x62e01c to 0x62e0a2 (134 bytes)
//
// 1 xrefs:
// > sub_618F58 @ 0x6190e0
//
// 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_62E01C(int *a1, int a2, int *a3, int *a4)
{
int v6; // r10
int *v7; // r4
int v8; // r9
int v9; // r8
int v10; // r6
size_t v11; // r2
int (__fastcall *v12)(_DWORD, _DWORD, int *); // r3
int v13; // r0
int result; // r0
int v15; // [sp+0h] [bp-90h] BYREF
v6 = *a1;
v7 = a3;
if ( !a3 )
v7 = &v15;
v8 = *(_DWORD *)(a2 + 4);
*v7 = v8;
v9 = a1[35];
v7[1] = v9;
if ( a1[35] == 2 )
v10 = 17;
else
v10 = *(_DWORD *)(a2 + 12);
v7[2] = v10;
v11 = *(_DWORD *)(a2 + 16);
if ( v11 > 0x80 )
v11 = 128;
v7[3] = v11;
memcpy(v7 + 4, *(const void **)(a2 + 24), v11);
v12 = *(int (__fastcall **)(_DWORD, _DWORD, int *))(v6 + 472);
if ( v12 )
v13 = v12(*(_DWORD *)(v6 + 476), 0, v7);
else
v13 = socket(v8, v9, v10);
*a4 = v13;
if ( v13 == -1 )
return 7;
result = a1[34];
if ( result )
{
if ( *v7 == 10 )
v7[10] = result;
return 0;
}
return result;
}