//
// sub_1005B4794 from 0x1005b4794 to 0x1005b489c (264 bytes)
//
// 1 xrefs:
// > sub_1005B4F84 @ 0x1005b5008
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1005B4794(__int64 a1, __int64 *a2, __int64 a3)
{
__int64 v3; // x9
int v4; // w8
__int64 v5; // x12
__int64 v7; // x11
int v8; // w13
unsigned __int64 v9; // x14
int v10; // w15
int v12[6]; // [xsp+0h] [xbp-30h] BYREF
LODWORD(v3) = *(_DWORD *)(a3 + 8);
if ( (_DWORD)v3 )
{
v4 = 0;
LABEL_3:
v3 = (int)v3;
v5 = 8LL * ((int)v3 - 1);
while ( v3-- >= 1 )
{
v7 = *(_QWORD *)(*(_QWORD *)a3 + v5);
v5 -= 8;
if ( v7 )
{
v8 = 0;
v9 = 0x8000000000000000LL;
do
{
if ( (v9 & v7) != 0 )
{
if ( v4 <= 5 )
v12[v4] = (((_DWORD)v3 << 6) | 0x3F) + v8;
++v4;
}
v9 >>= 1;
v10 = v8 + 63;
--v8;
}
while ( v10 > 0 );
goto LABEL_3;
}
}
if ( v4 <= 5 )
v12[v4++] = -1;
if ( v4 && v4 < 7 )
return sub_1005B4454(a1, a2, v12);
}
sub_1005E0E48(3, 131, 106, "bn_gf2m.c", 477);
return 0;
}