//
// LevelEditorLayer::tryUpdateSpeedObject from 0x1000bcd40 to 0x1000bce7f (319 bytes)
//
// 3 xrefs:
// > EditorUI::onToggleGuide @ 0x10000e6c9
// > LevelEditorLayer::addSpecial @ 0x1000af86a
// > LevelEditorLayer::removeSpecial @ 0x1000b1cc9
//
// 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:32 +0000
//
__int64 __fastcall LevelEditorLayer::tryUpdateSpeedObject(__int64 a1, __int64 a2, char a3)
{
__int64 v3; // r14
char v4; // r12
int v5; // r13d
char isSpeedObject; // r15
__int64 v7; // r13
__int64 v8; // rdi
__int64 v9; // r15
char v10; // al
v3 = a1;
v4 = a3 | *(_BYTE *)(a2 + 1768) ^ 1;
v5 = *(_DWORD *)(a2 + 1028);
isSpeedObject = GameObject::isSpeedObject(a2);
if ( v5 > 659 )
{
if ( v5 != 660 && v5 != 1933 && v5 != 1331 )
goto LABEL_13;
}
else if ( v5 != 13 && v5 != 47 && v5 != 111 )
{
goto LABEL_13;
}
v7 = *(_QWORD *)(a1 + 14288);
v8 = *(_QWORD *)(v7 + 552);
if ( v4 )
{
sub_1007FF140(v8, a2, 1);
}
else if ( !(unsigned __int8)sub_1007FF080(v8, a2) )
{
sub_1007FEBF0(*(_QWORD *)(v7 + 552), a2);
}
LABEL_13:
if ( isSpeedObject
|| (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1680LL))(a2) && *(_BYTE *)(a2 + 1780) == 1 )
{
v9 = *(_QWORD *)(v3 + 14288);
v10 = sub_1007FF080(*(_QWORD *)(v9 + 560), a2);
LOBYTE(v3) = 1;
if ( v4 )
{
if ( v10 )
{
sub_1007FF140(*(_QWORD *)(v9 + 560), a2, 1);
*(_BYTE *)(v9 + 601) = 1;
}
}
else if ( !v10 )
{
sub_1007FEBF0(*(_QWORD *)(v9 + 560), a2);
*(_BYTE *)(v9 + 601) = 1;
EffectGameObject::updateSpeedModType(a2);
}
}
else
{
LODWORD(v3) = 0;
}
return (unsigned int)v3;
}