//
// sub_1800BF360 from 0x1800bf360 to 0x1800bf3e6 (134 bytes)
//
// 7 xrefs:
// > kmGLPushMatrix @ 0x1800bf609
// > sub_1800BF740 @ 0x1800bf7a8
// > sub_1800BF740 @ 0x1800bf7b9
// > sub_1800BF740 @ 0x1800bf7ca
// > ??> @ 0x18014adb4
// > ??> @ 0x18014adc4
// > ??> @ 0x1801c31f8
//
// 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 11:22:24 +0000
//
__int64 __fastcall sub_1800BF360(unsigned int *a1, _OWORD *a2)
{
_OWORD *v3; // rcx
__int64 result; // rax
unsigned int v5; // eax
void *v6; // rbx
void *v7; // rax
int v8; // edx
v3 = (_OWORD *)(*((_QWORD *)a1 + 2) + ((__int64)(int)a1[1] << 6));
*((_QWORD *)a1 + 1) = v3;
kmMat4Fill(v3, a2);
++a1[1];
result = *a1;
if ( (int)a1[1] >= (int)result )
{
v5 = result + 50;
v6 = *((void **)a1 + 2);
*a1 = v5;
v7 = malloc((__int64)(int)v5 << 6);
v8 = *a1 - 50;
*((_QWORD *)a1 + 2) = v7;
memcpy(v7, v6, (__int64)v8 << 6);
free(v6);
result = a1[1] - 1;
*((_QWORD *)a1 + 1) = *((_QWORD *)a1 + 2) + ((__int64)(int)result << 6);
}
return result;
}