//
// sub_1002A8460 from 0x1002a8460 to 0x1002a8572 (274 bytes)
//
// 0 xrefs:
//
// 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:27:56 +0000
//
void __fastcall sub_1002A8460(__int64 a1)
{
__int64 v1; // r12
size_t v2; // rbx
void *v3; // rax
__int16 v4; // r14
void *v5; // rdi
size_t v6; // rcx
int v7; // r13d
__int64 v8; // r15
__int64 v9; // rbx
size_t v10; // r12
__int64 v11; // [rsp+8h] [rbp-48h]
__int64 v12; // [rsp+18h] [rbp-38h]
void *__dst; // [rsp+20h] [rbp-30h]
v1 = a1;
v2 = *(__int16 *)(a1 + 6) * (unsigned __int64)(*(unsigned __int8 *)(a1 + 5) >> 3);
v3 = malloc(v2);
if ( v3 )
{
v4 = *(_WORD *)(a1 + 8);
v5 = v3;
if ( v4 >= 2 )
{
v6 = v2;
v7 = -1;
v8 = 0;
v9 = 0;
v12 = v1;
__dst = v3;
do
{
v11 = *(_QWORD *)(v12 + 16);
v10 = v6;
memcpy(__dst, (const void *)(v11 + v8), v6);
++v9;
memcpy((void *)(v11 + v8), (const void *)(v11 + (int)v10 * (v7 + v4)), v10);
memcpy((void *)(*(_QWORD *)(v12 + 16) + (int)v10 * (v7 + *(__int16 *)(v12 + 8))), __dst, v10);
v6 = v10;
v5 = __dst;
v1 = v12;
v4 = *(_WORD *)(v12 + 8);
v8 += v6;
--v7;
}
while ( v9 < (__int16)((unsigned int)(__int16)(v4 + ((unsigned __int16)v4 >> 15)) >> 1) );
}
free(v5);
*(_DWORD *)(v1 + 24) = 0;
}
}