//
// sub_1000548C8 from 0x1000548c8 to 0x10005498c (196 bytes)
//
// 2 xrefs:
// > sub_100054540 @ 0x1000545bc
// > sub_100197FDC @ 0x1001981e4
//
// 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 10:57:44 +0000
//
_DWORD *__fastcall sub_1000548C8(__int64 a1, int *a2, _DWORD *a3, _OWORD *a4)
{
__int64 v7; // x9
_QWORD *v8; // x23
int v9; // w8
_QWORD *v10; // x21
int v11; // w9
_DWORD *v12; // x24
__int128 v13; // q1
v8 = (_QWORD *)(a1 + 8);
v7 = *(_QWORD *)(a1 + 8);
if ( v7 )
{
v9 = *a2;
while ( 1 )
{
while ( 1 )
{
v10 = (_QWORD *)v7;
v11 = *(_DWORD *)(v7 + 28);
if ( v9 >= v11 )
break;
v7 = *v10;
v8 = v10;
if ( !*v10 )
goto LABEL_10;
}
if ( v11 >= v9 )
break;
v7 = v10[1];
if ( !v7 )
{
v8 = v10 + 1;
goto LABEL_10;
}
}
}
else
{
v10 = (_QWORD *)(a1 + 8);
LABEL_10:
v12 = operator new(0x40u);
v12[7] = *a3;
v13 = a4[1];
*((_OWORD *)v12 + 2) = *a4;
*((_OWORD *)v12 + 3) = v13;
sub_10000A0F0((__int64 **)a1, (__int64)v10, v8, v12);
return v12;
}
return v10;
}