//
// sub_83E09C from 0x83e09c to 0x83e122 (134 bytes)
//
// 1 xrefs:
// > sub_828FD8 @ 0x829160
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:02:18 +0000
//
int __fastcall sub_83E09C(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;
}