//
// sub_1002075C0 from 0x1002075c0 to 0x100207683 (195 bytes)
//
// 1 xrefs:
// > sub_1002075B0 @ 0x1002075b9
//
// 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
//
void *__fastcall sub_1002075C0(__int64 a1, unsigned __int8 *a2, size_t *a3, _QWORD *a4)
{
unsigned int v5; // eax
__int64 v7; // rax
unsigned int v9; // r14d
void *v10; // r12
__int128 v11; // [rsp+0h] [rbp-40h] BYREF
size_t __sz; // [rsp+10h] [rbp-30h]
if ( a3 )
*a3 = 0;
if ( !*a4 )
return nullptr;
v5 = *a2;
if ( (v5 & 1) != 0 )
{
if ( !*((_QWORD *)a2 + 1) )
return nullptr;
}
else if ( !(v5 >> 1) )
{
return nullptr;
}
v7 = sub_100207C20(a4 + 1);
if ( (_QWORD *)v7 == a4 + 2 )
return nullptr;
__sz = *(_QWORD *)(v7 + 72);
v11 = *(_OWORD *)(v7 + 56);
if ( (unsigned int)sub_1007C5240(*a4, &v11) || (unsigned int)sub_1007C59E0(*a4) )
return nullptr;
v9 = __sz;
v10 = operator new[](__sz);
sub_1007C5A60(*a4, v10, v9);
if ( a3 )
*a3 = __sz;
sub_1007C3DD0(*a4);
return v10;
}