//
// sub_1006DAA04 from 0x1006daa04 to 0x1006daa9c (152 bytes)
//
// 1 xrefs:
// > sub_1006E6084 @ 0x1006e60c4
//
// 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:12:30 +0000
//
__int64 __fastcall sub_1006DAA04(__int64 a1, __int64 a2, int a3)
{
__int64 v4; // x9
__int64 result; // x0
__int64 v6; // x11
__int64 v8; // x10
int v9; // w12
unsigned __int64 v10; // x13
int v11; // w14
LODWORD(v4) = *(_DWORD *)(a1 + 8);
if ( !(_DWORD)v4 )
return 0;
result = 0;
LABEL_3:
v4 = (int)v4;
v6 = 8LL * ((int)v4 - 1);
while ( v4-- >= 1 )
{
v8 = *(_QWORD *)(*(_QWORD *)a1 + v6);
v6 -= 8;
if ( v8 )
{
v9 = 0;
v10 = 0x8000000000000000LL;
do
{
if ( (v8 & v10) != 0 )
{
if ( (int)result < a3 )
*(_DWORD *)(a2 + 4LL * (int)result) = (((_DWORD)v4 << 6) | 0x3F) + v9;
result = (unsigned int)(result + 1);
}
v10 >>= 1;
v11 = v9 + 63;
--v9;
}
while ( v11 > 0 );
goto LABEL_3;
}
}
if ( (int)result < a3 )
{
*(_DWORD *)(a2 + 4LL * (int)result) = -1;
return (unsigned int)(result + 1);
}
return result;
}