//
// LevelEditorLayer::removeSpecial from 0x7903bc to 0x790824 (1128 bytes)
//
// 7 xrefs:
// > LevelEditorLayer::removeObject @ 0x790878
// > LevelEditorLayer::handleAction @ 0x7a1e48
// > LevelEditorLayer::handleAction @ 0x7a1eac
// > LevelEditorLayer::refreshSpecial @ 0x7a247c
// > EditorUI::createNewKeyframeAnim @ 0x7c3e04
// > EditorUI::onCreateObject @ 0x7ca58c
// > ??> @ 0x8e990
//
// This function is hookable on this platform (idp: arm, 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:53:29 +0000
//
__int64 __fastcall LevelEditorLayer::removeSpecial(LevelEditorLayer *this, GameObject *a2)
{
int v4; // w0
bool v5; // cc
char *v6; // x22
int v7; // w2
int v8; // w0
GameObject *v9; // x23
float v10; // s8
int v11; // w22
float v12; // s0
int v13; // w23
int v14; // w0
__int64 v15; // x0
__int64 v17; // [xsp+48h] [xbp+48h] BYREF
__int64 v18; // [xsp+50h] [xbp+50h] BYREF
if ( *((_BYTE *)a2 + 1258) )
{
v4 = *((_DWORD *)a2 + 257);
v5 = v4 <= 1329;
if ( v4 != 1329 )
goto LABEL_3;
LABEL_37:
v6 = (char *)this + 12288;
v13 = *((_DWORD *)this + 3539) - *((_DWORD *)this + 3540) - 1;
*((_DWORD *)this + 3541) = v13;
v14 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 3540) = v14;
*((_DWORD *)this + 3539) = v13 + v14;
goto LABEL_7;
}
v11 = *((_DWORD *)this + 3568) - *((_DWORD *)this + 3569) - 1;
*((_DWORD *)this + 3570) = v11;
v12 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 3569) = (int)v12;
*((_DWORD *)this + 3568) = v11 + (int)v12;
v4 = *((_DWORD *)a2 + 257);
v5 = v4 <= 1329;
if ( v4 == 1329 )
goto LABEL_37;
LABEL_3:
if ( v5 )
{
if ( v4 != 747 || (v9 = *((GameObject **)a2 + 231)) == nullptr )
{
LABEL_35:
v6 = (char *)this + 12288;
goto LABEL_7;
}
v6 = (char *)this + 12288;
cocos2d::CCObject::retain(*((cocos2d::CCObject **)a2 + 231));
(*(void (__fastcall **)(__int64 *__return_ptr, GameObject *))(*(_QWORD *)v9 + 1816LL))(&v17, v9);
v10 = *((float *)&v17 + 1);
(*(void (__fastcall **)(__int64 *__return_ptr, GameObject *))(*(_QWORD *)a2 + 1816LL))(&v18, a2);
*((float *)a2 + 465) = v10 - *((float *)&v18 + 1);
if ( !*((_BYTE *)this + 14808) )
LevelEditorLayer::removeObject(this, v9, 1);
*((_QWORD *)a2 + 231) = 0;
cocos2d::CCObject::release(v9);
LABEL_7:
if ( !*((_BYTE *)a2 + 1255) )
goto LABEL_8;
goto LABEL_22;
}
if ( v4 != 2065 )
{
if ( v4 == 3032 )
{
v6 = (char *)this + 12288;
GJBaseGameLayer::removeKeyframe(this, a2);
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1762), a2, 1);
goto LABEL_7;
}
goto LABEL_35;
}
v6 = (char *)this + 12288;
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1761), a2, 1);
if ( !*((_BYTE *)a2 + 1255) )
{
LABEL_8:
if ( !*((_BYTE *)a2 + 1252) )
goto LABEL_9;
LABEL_23:
DrawGridLayer::removeFromEffects(*((cocos2d::CCArray ***)this + 1786), a2);
v7 = *((_DWORD *)a2 + 312);
if ( v7 != 1 )
goto LABEL_10;
goto LABEL_24;
}
LABEL_22:
cocos2d::CCPoint::operator=((char *)a2 + 1800, &dword_155C6A8);
if ( *((_BYTE *)a2 + 1252) )
goto LABEL_23;
LABEL_9:
v7 = *((_DWORD *)a2 + 312);
if ( v7 != 1 )
goto LABEL_10;
LABEL_24:
LevelEditorLayer::tryUpdateSpeedObject((cocos2d::CCArray ***)this, a2, v7);
LABEL_10:
v8 = *((_DWORD *)a2 + 257);
if ( v8 == 1814 )
goto LABEL_63;
if ( v8 > 1814 )
{
if ( v8 == 2067 )
goto LABEL_63;
if ( v8 <= 2067 )
{
if ( v8 != 1912 )
{
if ( v8 == 2016 )
{
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1760), a2, 1);
goto LABEL_41;
}
goto LABEL_57;
}
}
else
{
if ( v8 == 3016 )
goto LABEL_63;
if ( v8 == 3642 )
{
DrawGridLayer::removeAudioLineObject(*((_QWORD **)this + 1786), (__int64)a2);
goto LABEL_41;
}
if ( v8 != 2068 )
goto LABEL_57;
}
goto LABEL_59;
}
if ( v8 == 1007 )
{
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1757), a2, 1);
goto LABEL_41;
}
if ( v8 <= 1007 )
{
if ( v8 != 901 )
{
if ( v8 == 1006 )
{
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1755), a2, 1);
if ( *((_BYTE *)a2 + 1253) )
goto LABEL_17;
goto LABEL_42;
}
goto LABEL_57;
}
LABEL_63:
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1759), a2, 1);
goto LABEL_41;
}
if ( v8 == 1268 )
{
LABEL_59:
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1758), a2, 1);
goto LABEL_41;
}
if ( v8 >= 1268 && (unsigned int)(v8 - 1346) <= 1 )
goto LABEL_63;
LABEL_57:
if ( (unsigned __int8)GameObject::isColorTrigger(a2) )
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1756), a2, 1);
LABEL_41:
if ( *((_BYTE *)a2 + 1253) )
{
LABEL_17:
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1772), a2, 1);
v6[1896] = 1;
if ( *((_BYTE *)a2 + 1257) )
goto LABEL_43;
goto LABEL_18;
}
LABEL_42:
if ( *((_BYTE *)a2 + 1257) )
{
LABEL_43:
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1764), a2, 1);
if ( !*((_BYTE *)a2 + 1255) )
goto LABEL_44;
goto LABEL_20;
}
LABEL_18:
if ( (*(unsigned __int8 (__fastcall **)(GameObject *))(*(_QWORD *)a2 + 1688LL))(a2) )
goto LABEL_43;
if ( *((_BYTE *)a2 + 1255) )
LABEL_20:
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 1754), a2, 1);
LABEL_44:
v15 = *((_QWORD *)this + 1852);
if ( v15 && *(_DWORD *)(v15 + 916) == *((_DWORD *)a2 + 229) )
*((_QWORD *)this + 1852) = 0;
if ( *((GameObject **)this + 1853) == a2 )
*((_QWORD *)this + 1853) = 0;
if ( *((GameObject **)this + 1854) == a2 )
*((_QWORD *)this + 1854) = 0;
if ( *((GameObject **)this + 1869) == a2 )
*((_QWORD *)this + 1869) = 0;
if ( *((GameObject **)this + 1870) == a2 )
*((_QWORD *)this + 1870) = 0;
cocos2d::CCArray::removeObject(*((cocos2d::CCArray **)this + 410), a2, 1);
GJBaseGameLayer::removeFromGroupParents(this, a2);
GJBaseGameLayer::removeFromGroups(this, a2);
GJBaseGameLayer::removeFromStickyGroup(this, a2);
v6[2650] = 1;
return _stack_chk_guard;
}