//
// LevelEditorLayer::removeSpecial from 0x1000b1a50 to 0x1000b1f36 (1254 bytes)
//
// 9 xrefs:
// > EditorUI::onCreateObject @ 0x100011310
// > EditorUI::createNewKeyframeAnim @ 0x100016723
// > LevelEditorLayer::removeObject @ 0x1000b1a37
// > LevelEditorLayer::removeSpecial @ 0x1000b1bcf
// > LevelEditorLayer::removeAllObjects @ 0x1000b1fda
// > LevelEditorLayer::removeAllObjectsOfType @ 0x1000b2245
// > LevelEditorLayer::handleAction @ 0x1000b24b7
// > LevelEditorLayer::handleAction @ 0x1000b25cf
// > LevelEditorLayer::refreshSpecial @ 0x1000bd3dd
//
// 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:20:20 +0000
//
__int64 __fastcall LevelEditorLayer::removeSpecial(__int64 a1, __int64 a2)
{
int v3; // r15d
float v4; // xmm0_4
int v5; // eax
int v6; // r15d
float v7; // xmm0_4
__int64 v8; // rdi
__int64 v9; // r15
int v10; // eax
__int64 v11; // rdi
__int64 v12; // r15
__int64 *v13; // rdi
__int64 v14; // rax
__int64 result; // rax
_BYTE v16[4]; // [rsp+4h] [rbp-2Ch] BYREF
float v17; // [rsp+8h] [rbp-28h]
int v18[2]; // [rsp+Ch] [rbp-24h] BYREF
float v19; // [rsp+14h] [rbp-1Ch]
if ( !*(_BYTE *)(a2 + 1258) )
{
v3 = *(_DWORD *)(a1 + 14272) + ~*(_DWORD *)(a1 + 14276);
*(_DWORD *)(a1 + 14280) = v3;
v4 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*(_DWORD *)(a1 + 14276) = (int)v4;
*(_DWORD *)(a1 + 14272) = (int)v4 + v3;
}
v5 = *(_DWORD *)(a2 + 1028);
if ( v5 > 2064 )
{
if ( v5 == 2065 )
{
v8 = *(_QWORD *)(a1 + 14088);
}
else
{
if ( v5 != 3032 )
goto LABEL_16;
GJBaseGameLayer::removeKeyframe(a1, a2);
v8 = *(_QWORD *)(a1 + 14096);
}
sub_1007FF140(v8, a2, 1);
}
else if ( v5 == 747 )
{
v9 = *(_QWORD *)(a2 + 1848);
if ( v9 )
{
cocos2d::CCObject::retain(*(_QWORD *)(a2 + 1848));
(*(void (__fastcall **)(int *, __int64))(*(_QWORD *)v9 + 1816LL))(v18, v9);
v19 = *(float *)&v18[1];
(*(void (__fastcall **)(_BYTE *, __int64))(*(_QWORD *)a2 + 1816LL))(v16, a2);
*(float *)(a2 + 1860) = v19 - v17;
if ( !*(_BYTE *)(a1 + 14808) )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 1312LL))(v9, 1);
GJBaseGameLayer::removeObjectFromSection(a1, v9);
LevelEditorLayer::removeSpecial(a1, v9);
*(_BYTE *)(a1 + 14938) = 1;
}
*(_QWORD *)(a2 + 1848) = 0;
cocos2d::CCObject::release(v9);
}
}
else if ( v5 == 1329 )
{
v6 = *(_DWORD *)(a1 + 14156) + ~*(_DWORD *)(a1 + 14160);
*(_DWORD *)(a1 + 14164) = v6;
v7 = (float)((float)rand() * 4.6566129e-10) * 1000.0;
*(_DWORD *)(a1 + 14160) = (int)v7;
*(_DWORD *)(a1 + 14156) = (int)v7 + v6;
}
LABEL_16:
if ( *(_BYTE *)(a2 + 1255) == 1 )
{
sub_100278300(a2 + 1800, &dword_100BE1180);
if ( *(_BYTE *)(a2 + 1252) != 1 )
{
LABEL_18:
if ( *(_DWORD *)(a2 + 1248) != 1 )
goto LABEL_19;
goto LABEL_27;
}
}
else if ( *(_BYTE *)(a2 + 1252) != 1 )
{
goto LABEL_18;
}
v12 = *(_QWORD *)(a1 + 14288);
sub_1007FF140(*(_QWORD *)(v12 + 544), a2, 1);
*(_BYTE *)(v12 + 492) = 1;
if ( *(_DWORD *)(a2 + 1248) != 1 )
{
LABEL_19:
v10 = *(_DWORD *)(a2 + 1028);
if ( v10 <= 1911 )
goto LABEL_20;
goto LABEL_28;
}
LABEL_27:
LevelEditorLayer::tryUpdateSpeedObject(a1, a2, 1);
v10 = *(_DWORD *)(a2 + 1028);
if ( v10 <= 1911 )
{
LABEL_20:
if ( v10 <= 1267 )
{
if ( v10 != 901 )
{
if ( v10 == 1006 )
{
v11 = *(_QWORD *)(a1 + 14040);
goto LABEL_50;
}
if ( v10 == 1007 )
{
v11 = *(_QWORD *)(a1 + 14056);
goto LABEL_50;
}
goto LABEL_36;
}
LABEL_43:
v11 = *(_QWORD *)(a1 + 14072);
goto LABEL_50;
}
if ( (unsigned int)(v10 - 1346) < 2 )
goto LABEL_43;
if ( v10 != 1268 )
{
if ( v10 == 1814 )
goto LABEL_43;
goto LABEL_36;
}
goto LABEL_44;
}
LABEL_28:
if ( v10 <= 2067 )
{
if ( v10 != 1912 )
{
if ( v10 == 2016 )
{
v11 = *(_QWORD *)(a1 + 14080);
goto LABEL_50;
}
if ( v10 == 2067 )
goto LABEL_43;
LABEL_36:
if ( !(unsigned __int8)GameObject::isColorTrigger(a2) )
{
if ( *(_BYTE *)(a2 + 1253) == 1 )
goto LABEL_51;
goto LABEL_38;
}
v11 = *(_QWORD *)(a1 + 14048);
LABEL_50:
sub_1007FF140(v11, a2, 1);
if ( *(_BYTE *)(a2 + 1253) == 1 )
goto LABEL_51;
LABEL_38:
if ( *(_BYTE *)(a2 + 1257) )
goto LABEL_56;
goto LABEL_52;
}
LABEL_44:
v11 = *(_QWORD *)(a1 + 14064);
goto LABEL_50;
}
if ( v10 == 2068 )
goto LABEL_44;
if ( v10 != 3642 )
{
if ( v10 == 3016 )
goto LABEL_43;
goto LABEL_36;
}
v13 = (__int64 *)(*(_QWORD *)(a1 + 14288) + 432LL);
v18[0] = *(_DWORD *)(a2 + 916);
sub_10001C120(v13, v18);
if ( *(_BYTE *)(a2 + 1253) != 1 )
goto LABEL_38;
LABEL_51:
sub_1007FF140(*(_QWORD *)(a1 + 14176), a2, 1);
*(_BYTE *)(a1 + 14184) = 1;
if ( *(_BYTE *)(a2 + 1257) )
goto LABEL_56;
LABEL_52:
if ( !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1688LL))(a2) )
{
if ( *(_BYTE *)(a2 + 1255) != 1 )
goto LABEL_54;
goto LABEL_57;
}
LABEL_56:
sub_1007FF140(*(_QWORD *)(a1 + 14112), a2, 1);
if ( *(_BYTE *)(a2 + 1255) != 1 )
{
LABEL_54:
v14 = *(_QWORD *)(a1 + 14816);
if ( !v14 )
goto LABEL_60;
goto LABEL_58;
}
LABEL_57:
sub_1007FF140(*(_QWORD *)(a1 + 14032), a2, 1);
v14 = *(_QWORD *)(a1 + 14816);
if ( !v14 )
goto LABEL_60;
LABEL_58:
if ( *(_DWORD *)(v14 + 916) == *(_DWORD *)(a2 + 916) )
*(_QWORD *)(a1 + 14816) = 0;
LABEL_60:
if ( *(_QWORD *)(a1 + 14824) == a2 )
{
*(_QWORD *)(a1 + 14824) = 0;
if ( *(_QWORD *)(a1 + 14832) != a2 )
{
LABEL_62:
if ( *(_QWORD *)(a1 + 14952) != a2 )
goto LABEL_63;
LABEL_67:
*(_QWORD *)(a1 + 14952) = 0;
if ( *(_QWORD *)(a1 + 14960) != a2 )
goto LABEL_64;
LABEL_68:
*(_QWORD *)(a1 + 14960) = 0;
goto LABEL_64;
}
}
else if ( *(_QWORD *)(a1 + 14832) != a2 )
{
goto LABEL_62;
}
*(_QWORD *)(a1 + 14832) = 0;
if ( *(_QWORD *)(a1 + 14952) == a2 )
goto LABEL_67;
LABEL_63:
if ( *(_QWORD *)(a1 + 14960) == a2 )
goto LABEL_68;
LABEL_64:
sub_1007FF140(*(_QWORD *)(a1 + 3280), a2, 1);
GJBaseGameLayer::removeFromGroupParents(a1, a2);
GJBaseGameLayer::removeFromGroups(a1, a2);
result = GJBaseGameLayer::removeFromStickyGroup(a1, a2);
*(_BYTE *)(a1 + 14938) = 1;
return result;
}