//
// sub_1002DC410 from 0x1002dc410 to 0x1002dc670 (608 bytes)
//
// 1 xrefs:
// > GJEffectManager::createKeyframeCommand @ 0x1002cbd77
//
// 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:17 +0000
//
char *__fastcall sub_1002DC410(__int64 a1)
{
__int64 v1; // rcx
__int64 v2; // r14
unsigned __int64 v3; // r15
char *v5; // rax
char *v6; // r12
_QWORD *v7; // rdx
__int64 v8; // r15
void *v9; // rdi
char *v11; // [rsp+20h] [rbp-30h]
v1 = *(_QWORD *)a1;
v2 = 0x6DB6DB6DB6DB6DB7LL * ((__int64)(*(_QWORD *)(a1 + 8) - *(_QWORD *)a1) >> 6);
v3 = v2 + 1;
if ( (unsigned __int64)(v2 + 1) > 0x92492492492492LL )
sub_1002DBA80();
if ( 0xDB6DB6DB6DB6DB6ELL * ((*(_QWORD *)(a1 + 16) - v1) >> 6) > v3 )
v3 = 0xDB6DB6DB6DB6DB6ELL * ((*(_QWORD *)(a1 + 16) - v1) >> 6);
if ( (unsigned __int64)(0x6DB6DB6DB6DB6DB7LL * ((*(_QWORD *)(a1 + 16) - v1) >> 6)) >= 0x49249249249249LL )
v3 = 0x92492492492492LL;
if ( v3 )
{
if ( v3 > 0x92492492492492LL )
sub_10001ADB0();
v5 = (char *)operator new(448 * v3);
}
else
{
v5 = nullptr;
}
v6 = &v5[448 * v2];
v11 = &v5[448 * v3];
*((_OWORD *)v6 + 8) = 0;
*((_OWORD *)v6 + 7) = 0;
*((_OWORD *)v6 + 6) = 0;
*((_OWORD *)v6 + 5) = 0;
*((_OWORD *)v6 + 4) = 0;
*((_OWORD *)v6 + 3) = 0;
*((_OWORD *)v6 + 2) = 0;
*((_QWORD *)v6 + 18) = 0;
*(_OWORD *)v6 = 0;
v6[16] = 0;
*(_QWORD *)(v6 + 20) = 0;
*(_DWORD *)(v6 + 27) = 0;
*((_QWORD *)v6 + 20) = 0x20000001ELL;
*((_DWORD *)v6 + 42) = 2;
*((_OWORD *)v6 + 11) = 0;
v6[192] = 0;
*(_OWORD *)(v6 + 200) = 0;
*(_OWORD *)(v6 + 216) = 0;
*(_OWORD *)(v6 + 232) = 0;
*(_OWORD *)(v6 + 248) = 0;
*(_OWORD *)(v6 + 264) = 0;
*(_OWORD *)(v6 + 280) = 0;
*(_OWORD *)(v6 + 296) = 0;
*((_QWORD *)v6 + 39) = 0;
*((_QWORD *)v6 + 41) = 0x20000001ELL;
*((_DWORD *)v6 + 84) = 2;
*(_OWORD *)(v6 + 344) = 0;
v6[360] = 0;
*((_OWORD *)v6 + 23) = 0;
*((_QWORD *)v6 + 48) = 0;
sub_1002782A0((_QWORD *)v6 + 49);
sub_1002782A0((_QWORD *)v6 + 50);
*(_OWORD *)(v6 + 408) = xmmword_100A036A0;
*(_OWORD *)(v6 + 424) = 0;
*((_DWORD *)v6 + 110) = 1065353216;
v7 = *(_QWORD **)(a1 + 8);
v8 = (__int64)&v6[*(_QWORD *)a1 - (_QWORD)v7];
sub_1002DC290(a1, *(_QWORD **)a1, v7, v8);
v9 = *(void **)a1;
*(_QWORD *)a1 = v8;
*(_QWORD *)(a1 + 8) = v6 + 448;
*(_QWORD *)(a1 + 16) = v11;
if ( v9 )
operator delete(v9);
return v6 + 448;
}