//
// ChanceTriggerGameObject::remapChanceObjects from 0x1406554f0 to 0x1406555da (234 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::applyRemap @ 0x140323185
// > ??> @ 0x1408e91d4
// > ??> @ 0x1408e91e4
// > ??> @ 0x140931700
//
// This function is hookable on this platform (idp: pc, 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 11:35:44 +0000
//
void __fastcall ChanceTriggerGameObject::remapChanceObjects(__int64 a1, _QWORD *a2)
{
unsigned __int8 *v2; // rbx
unsigned __int8 *v4; // r9
__int64 v5; // r10
__int64 v6; // r8
__int64 *v7; // rdx
__int64 v8; // rax
__int64 v9; // rdx
v2 = *(unsigned __int8 **)(a1 + 1864);
v4 = *(unsigned __int8 **)(a1 + 1856);
if ( v4 != v2 )
{
v5 = a2[1];
v6 = v5;
while ( 1 )
{
v7 = (__int64 *)(a2[3]
+ 16
* (a2[6]
& (0x100000001B3LL
* (v4[3]
^ (0x100000001B3LL
* (v4[2] ^ (0x100000001B3LL * (v4[1] ^ (0x100000001B3LL * (*v4 ^ 0xCBF29CE484222325uLL))))))))));
v8 = v7[1];
if ( v8 == v6 )
goto LABEL_9;
v9 = *v7;
if ( *(_DWORD *)v4 != *(_DWORD *)(v8 + 16) )
break;
LABEL_10:
if ( !v8 )
v8 = v6;
if ( v8 != v6 )
{
*(_DWORD *)v4 = *(_DWORD *)(v8 + 20);
v5 = a2[1];
v6 = v5;
}
v4 += 16;
if ( v4 == v2 )
return;
}
while ( v8 != v9 )
{
v8 = *(_QWORD *)(v8 + 8);
if ( *(_DWORD *)v4 == *(_DWORD *)(v8 + 16) )
{
v6 = v5;
goto LABEL_10;
}
}
v6 = v5;
LABEL_9:
v8 = 0;
goto LABEL_10;
}
}