//
// sub_1002E8790 from 0x1002e8790 to 0x1002e887b (235 bytes)
//
// 1 xrefs:
// > sub_1002E7CF0 @ 0x1002e7daa
//
// This function is hookable on this platform (idp: pc, 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 12:28:22 +0000
//
_QWORD *__fastcall sub_1002E8790(_QWORD *a1, __int64 a2, int *a3)
{
char *v4; // r14
int v5; // eax
__int128 *v6; // r12
__int64 v7; // r13
char *v8; // rax
__int128 *v10; // [rsp+20h] [rbp-30h]
v4 = (char *)operator new(0x30u);
*a1 = v4;
a1[1] = a2;
a1[2] = 0;
*(_OWORD *)v4 = 0;
v5 = *a3;
*((_DWORD *)v4 + 4) = *a3;
*(_OWORD *)(v4 + 24) = 0;
*((_QWORD *)v4 + 5) = 0;
v6 = *((__int128 **)a3 + 1);
v10 = *((__int128 **)a3 + 2);
v7 = (char *)v10 - (char *)v6;
if ( v10 != v6 )
{
if ( (unsigned __int64)(0x6DB6DB6DB6DB6DB7LL * (v7 >> 3)) >= 0x492492492492493LL )
sub_1002E3BE0();
v8 = (char *)operator new((char *)v10 - (char *)v6);
*((_QWORD *)v4 + 3) = v8;
*((_QWORD *)v4 + 4) = v8;
*((_QWORD *)v4 + 5) = &v8[v7];
*((_QWORD *)v4 + 4) = sub_1002E82D0((__int64)(v4 + 24), v6, v10, (__int64)v8);
v5 = *((_DWORD *)v4 + 4);
}
*((_BYTE *)a1 + 16) = 1;
*((_QWORD *)v4 + 1) = v5;
return a1;
}