//
// getRemappedID from 0x6638b0 to 0x66391c (108 bytes)
//
// 4 xrefs:
// > processTraceOutSource @ 0x680040
// > processTraceOutSource @ 0x6805e4
// > processTraceOutSource @ 0x6805f4
// > ??> @ 0x46800
//
// 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 getRemappedID(__int64 result, _QWORD *a2)
{
unsigned __int64 v2; // x4
unsigned __int64 v3; // x7
_QWORD *v4; // x6
_QWORD *v5; // x3
int v6; // w5
__int64 v7; // x1
v2 = a2[1];
v3 = (int)result % v2;
v4 = *(_QWORD **)(*a2 + 8 * v3);
if ( v4 )
{
v5 = (_QWORD *)*v4;
v6 = *(_DWORD *)(*v4 + 8LL);
while ( (_DWORD)result != v6 )
{
v7 = *v5;
v4 = v5;
v5 = (_QWORD *)v7;
if ( v7 )
{
v6 = *(_DWORD *)(v7 + 8);
if ( v3 == v6 % v2 )
continue;
}
return result;
}
if ( *v4 )
return *(unsigned int *)(*v4 + 12LL);
}
return result;
}