//
// sub_8E3BB0 from 0x8e3bb0 to 0x8e3c34 (132 bytes)
//
// 2 xrefs:
// > __emutls_get_address @ 0x8e3d10
// > __emutls_get_address @ 0x8e3e10
//
// 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
//
_DWORD *__fastcall sub_8E3BB0(size_t *a1)
{
unsigned int v2; // r5
size_t v3; // r0
_DWORD *v4; // r0
_DWORD *v5; // r4
void *v6; // r0
const void *v7; // r1
size_t v8; // r2
v2 = a1[1];
v3 = *a1;
if ( v2 <= 4 )
{
v4 = malloc(v3 + 4);
if ( v4 )
{
*v4 = v4;
v5 = v4 + 1;
goto LABEL_7;
}
LABEL_4:
abort();
}
v6 = malloc(v2 + v3 + 3);
if ( !v6 )
goto LABEL_4;
v5 = (_DWORD *)(((unsigned int)v6 + v2 + 3) & -v2);
*(v5 - 1) = v6;
LABEL_7:
v7 = (const void *)a1[3];
v8 = *a1;
if ( v7 )
memcpy(v5, v7, v8);
else
memset(v5, 0, v8);
return v5;
}