//
// SetupSpawnPopup::onDeleteRemap from 0x1405f4e50 to 0x1405f4fe7 (407 bytes)
//
// 4 xrefs:
// > SetupSpawnPopup::init @ 0x1405f493b
// > ??> @ 0x1408e3834
// > ??> @ 0x1408e3894
// > ??> @ 0x14092f420
//
// 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:07 +0000
//
void __fastcall SetupSpawnPopup::onDeleteRemap(__int64 a1)
{
_DWORD *v2; // r15
struct cocos2d::CCObject *v3; // rcx
cocos2d::CCArray *v4; // r14
unsigned int v5; // ebx
__int64 v6; // rcx
struct cocos2d::CCObject *v7; // rbp
__int64 v8; // r10
__int64 v9; // r8
int v10; // r9d
__int64 v11; // rdx
bool v12; // zf
__int64 v13; // rax
__int64 v14; // rax
if ( !*(_BYTE *)(a1 + 1000) )
{
v2 = (_DWORD *)(a1 + 1044);
if ( *(_DWORD *)(a1 + 1040) || *v2 )
{
v3 = *(struct cocos2d::CCObject **)(a1 + 680);
if ( v3 )
v4 = cocos2d::CCArray::createWithObject(v3);
else
v4 = *(cocos2d::CCArray **)(a1 + 688);
v5 = 0;
if ( cocos2d::CCArray::count(v4) )
{
do
{
v7 = cocos2d::CCArray::objectAtIndex(v4, v5);
v8 = *((_QWORD *)v7 + 233);
v9 = *((_QWORD *)v7 + 232);
if ( v9 != v8 )
{
v10 = 0;
if ( (v8 - v9) >> 4 )
{
v11 = 0;
while ( *(_DWORD *)(v11 + v9) != *(_DWORD *)(a1 + 1040) || *(_DWORD *)(v11 + v9 + 8) != *v2 )
{
++v10;
v11 += 16;
if ( v10 >= (unsigned __int64)((v8 - v9) >> 4) )
goto LABEL_16;
}
memmove((void *)(v9 + 16LL * v10), (const void *)(v9 + 16LL * v10 + 16), v8 - (v9 + 16LL * v10 + 16));
*((_QWORD *)v7 + 233) -= 16LL;
}
}
LABEL_16:
++v5;
}
while ( v5 < cocos2d::CCArray::count(v4) );
v2 = (_DWORD *)(a1 + 1044);
}
v12 = *(_BYTE *)(a1 + 1000) == 0;
*(_DWORD *)(a1 + 1040) = 0;
*v2 = 0;
if ( v12 )
{
v13 = cocos2d::CCDirector::sharedDirector(v6);
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 112LL))(v13);
cocos2d::CCScheduler::scheduleSelector(v14, SetupSpawnPopup::updateRemapButtons, a1);
}
}
}
}