//
// GJBaseGameLayer::stopCustomEnterEffect from 0x1000fb1f0 to 0x1000fb307 (279 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::stopCustomEnterEffect_1 @ 0x1000fb1bd
// > GJBaseGameLayer::stopCustomEnterEffect_1 @ 0x1000fb1dc
//
// 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 12:21:18 +0000
//
__int64 __fastcall GJBaseGameLayer::stopCustomEnterEffect(_QWORD *a1, __int64 a2, int a3)
{
char v3; // r14
signed int v6; // ecx
_QWORD *v7; // rdi
__int64 result; // rax
__int64 v9; // rcx
__int64 v10; // rsi
int v11; // r8d
__int64 v12; // r9
__int64 v13; // rsi
__int64 v14; // r15
_QWORD *v15; // rcx
_QWORD *v16; // rbx
signed int *v17; // [rsp+8h] [rbp-28h] BYREF
signed int v18; // [rsp+10h] [rbp-20h] BYREF
_BYTE v19[25]; // [rsp+17h] [rbp-19h] BYREF
v3 = a3;
v6 = 0;
if ( *(_DWORD *)(a2 + 2032) < 0x65u )
v6 = *(_DWORD *)(a2 + 2032);
v18 = v6;
if ( a3 )
v7 = a1 + 169;
else
v7 = a1 + 174;
v17 = &v18;
result = sub_100146680(v7, &v18, &unk_100A04ED8, &v17, v19);
v9 = *(_QWORD *)(result + 24);
v10 = *(_QWORD *)(result + 32) - v9;
if ( v10 )
{
v11 = *(_DWORD *)(a2 + 1992);
if ( v11 )
{
v12 = (0xEEEEEEEEEEEEEEEFLL * (v10 >> 4) == 0) - 0x1111111111111111LL * (v10 >> 4);
v13 = *(_QWORD *)(result + 24);
while ( *(_DWORD *)(*(_QWORD *)(v13 + 168) + 1992LL) != v11 )
{
v13 += 240;
if ( !--v12 )
{
if ( *(_QWORD *)(result + 32) != v9 )
return result;
goto LABEL_15;
}
}
v14 = result;
result = sub_1000FAFD0(result + 24, v13);
if ( *(_QWORD *)(v14 + 32) != *(_QWORD *)(v14 + 24) )
return result;
}
else
{
GJBaseGameLayer::removeCustomEnterEffects(a1, v18, v3);
}
LABEL_15:
result = v18;
v15 = a1 + 182;
v16 = a1 + 179;
if ( !v3 )
v16 = v15;
*(_DWORD *)(*v16 + 4LL * v18) = -2;
}
return result;
}