//
// sub_100587658 from 0x100587658 to 0x10058776c (276 bytes)
//
// 1 xrefs:
// > sub_1005587A4 @ 0x100558874
//
// 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_100587658(_QWORD *a1)
{
void **v2; // x20
char *v3; // x0
_BYTE *v4; // x8
unsigned __int64 v5; // x8
__int64 v6; // x21
__int64 v7; // x22
char *v8; // x24
__int64 v9; // x0
v2 = (void **)(a1 + 4398);
v3 = (char *)a1[4398];
if ( v3 )
{
v4 = (_BYTE *)a1[14];
if ( !v4 || (*v4 & 0x10) == 0 )
{
v5 = a1[145];
if ( v5 )
{
v6 = 0;
v7 = 0;
while ( 1 )
{
v8 = &v3[v6];
v9 = *(_QWORD *)&v3[v6 + 8];
if ( v9 )
{
sub_100583484(v9);
*((_QWORD *)v8 + 1) = 0;
*((_QWORD *)v8 + 3) = 0;
off_10085DEB8(*((void **)v8 + 9));
*((_QWORD *)v8 + 9) = 0;
off_10085DEB8(*((void **)v8 + 8));
*((_QWORD *)v8 + 8) = 0;
off_10085DEB8(*((void **)v8 + 14));
*((_QWORD *)v8 + 14) = 0;
off_10085DEB8(*((void **)v8 + 13));
*((_QWORD *)v8 + 13) = 0;
off_10085DEB8(*((void **)v8 + 12));
*((_QWORD *)v8 + 12) = 0;
off_10085DEB8(*(void **)v8);
*(_QWORD *)v8 = 0;
v5 = a1[145];
}
if ( ++v7 >= v5 )
break;
v6 += 176;
v3 = (char *)*v2;
}
v3 = (char *)*v2;
}
off_10085DEB8(v3);
*v2 = nullptr;
}
}
return sub_100583488((__int64)a1);
}