//
// sub_1006B8B70 from 0x1006b8b70 to 0x1006b8bf5 (133 bytes)
//
// 4 xrefs:
// > sub_1001EB1E0 @ 0x1001eb249
// > sub_1001EB1E0 @ 0x1001eb254
// > sub_1001EB1E0 @ 0x1001eb25f
// > kmGLPushMatrix @ 0x1001eb2ef
//
// 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:35:28 +0000
//
__int64 __fastcall sub_1006B8B70(int *a1, __int128 *a2)
{
__int128 *v3; // rdi
__int64 result; // rax
__int64 v5; // r14
void *v6; // r15
void *v7; // rax
v3 = (__int128 *)(*((_QWORD *)a1 + 2) + ((__int64)a1[1] << 6));
*((_QWORD *)a1 + 1) = v3;
kmMat4Assign(v3, a2);
result = (unsigned int)(a1[1] + 1);
a1[1] = result;
v5 = *a1;
if ( (int)result >= (int)v5 )
{
*a1 = v5 + 50;
v6 = *((void **)a1 + 2);
v7 = malloc((v5 + 50) << 6);
*((_QWORD *)a1 + 2) = v7;
memcpy(v7, v6, v5 << 6);
free(v6);
result = ((__int64)a1[1] << 6) + *((_QWORD *)a1 + 2) - 64;
*((_QWORD *)a1 + 1) = result;
}
return result;
}