//
// sub_100510098 from 0x100510098 to 0x1005100fc (100 bytes)
//
// 1 xrefs:
// > sub_1005110EC @ 0x100511110
//
// 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_100510098(__int64 a1, int a2)
{
int v2; // w8
int v3; // w9
__int64 v4; // x8
if ( !*(_DWORD *)(a1 + 52) )
return 0;
v2 = *(_DWORD *)(a1 + 24);
if ( !v2 )
return 0;
v3 = *(_DWORD *)(*(_QWORD *)(a1 + 16) + 4LL * ((v2 - 1) & a2));
if ( v3 == -1 )
return 0;
v4 = *(_QWORD *)(a1 + 32);
while ( *(_DWORD *)(v4 + 16LL * v3) != a2 )
{
v3 = *(_DWORD *)(v4 + 16LL * v3 + 4);
if ( v3 == -1 )
return 0;
}
return *(_QWORD *)(v4 + 16LL * v3 + 8);
}