//
// sub_1004B2F00 from 0x1004b2f00 to 0x1004b2fb8 (184 bytes)
//
// 3 xrefs:
// > sub_1004B11CC @ 0x1004b128c
// > sub_1004B11CC @ 0x1004b12e0
// > sub_1004B11CC @ 0x1004b13d4
//
// This function is hookable on this platform (idp: arm, 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:06:12 +0000
//
__int64 *__fastcall sub_1004B2F00(__int64 a1, unsigned int a2)
{
__int64 *result; // x0
__int64 *v4; // x20
__int64 v5; // x8
unsigned __int64 v6; // x21
__int64 v7; // x23
__int64 v8; // x1
__int64 v9; // x1
unsigned int v10; // [xsp+Ch] [xbp-34h] BYREF
v10 = a2;
result = sub_10039078C((_QWORD *)(a1 + 344), &v10);
if ( result )
{
v4 = result;
v5 = result[3];
if ( result[4] != v5 )
{
v6 = 0;
do
{
v7 = *(_QWORD *)(a1 + 320) + 80LL * *(int *)(v5 + 4 * v6);
v8 = *(_QWORD *)(v7 + 64);
if ( v8 )
result = (__int64 *)(*(__int64 (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 408) + 552LL))(
*(_QWORD *)(a1 + 408),
v8,
0);
v9 = *(_QWORD *)(v7 + 72);
if ( v9 )
result = (__int64 *)(*(__int64 (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 416) + 552LL))(
*(_QWORD *)(a1 + 416),
v9,
0);
++v6;
v5 = v4[3];
}
while ( v6 < (v4[4] - v5) >> 2 );
}
}
return result;
}