//
// sub_86F80C from 0x86f80c to 0x86f984 (376 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::removeCustomEnterEffects @ 0x86f9a8
// > GJBaseGameLayer::removeCustomEnterEffects @ 0x86f9bc
//
// 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_86F80C(__int64 *a1, int *a2)
{
unsigned __int64 v2; // x20
unsigned __int64 v4; // x19
__int64 **v5; // x0
__int64 v6; // x2
__int64 *v7; // x22
__int64 **v8; // x4
__int64 v9; // x1
unsigned __int64 v10; // x20
__int64 v11; // x20
void *v12; // x21
void *v13; // x0
__int64 v14; // x19
void *v15; // x0
__int64 v17; // x5
unsigned __int64 v18; // x20
__int64 *v19; // x1
v2 = a1[1];
v4 = *a2 % v2;
v5 = (__int64 **)sub_855E28(a1, v4, a2);
if ( !v5 )
return 0;
v6 = *a1;
v7 = *v5;
v8 = (__int64 **)(*a1 + 8 * v4);
if ( v5 != (__int64 **)*v8 )
{
v9 = *v7;
if ( *v7 )
{
v10 = *(int *)(v9 + 8) % v2;
if ( v4 != v10 )
{
*(_QWORD *)(v6 + 8 * v10) = v5;
v9 = *v7;
}
}
goto LABEL_6;
}
v17 = *v7;
if ( !*v7 )
{
v19 = (__int64 *)v5;
goto LABEL_20;
}
v9 = *v7;
v18 = *(int *)(v17 + 8) % v2;
if ( v4 != v18 )
{
*(_QWORD *)(v6 + 8 * v18) = v5;
v8 = (__int64 **)(*a1 + 8 * v4);
v19 = *v8;
LABEL_20:
if ( v19 == a1 + 2 )
a1[2] = v17;
*v8 = nullptr;
v9 = *v7;
}
LABEL_6:
v11 = v7[2];
v12 = (void *)v7[3];
*v5 = (__int64 *)v9;
if ( (void *)v11 != v12 )
{
do
{
v13 = *(void **)(v11 + 232);
if ( v13 )
operator delete(v13);
v14 = *(_QWORD *)(v11 + 16);
while ( v14 )
{
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_erase(
v11,
*(_QWORD **)(v14 + 24));
v15 = (void *)v14;
v14 = *(_QWORD *)(v14 + 16);
operator delete(v15);
}
v11 += 264;
}
while ( v12 != (void *)v11 );
v12 = (void *)v7[2];
}
if ( v12 )
operator delete(v12);
operator delete(v7);
--a1[3];
return 1;
}