//
// EditorUI::playSoundForCreatedObject from 0x481fac to 0x4820cc (288 bytes)
//
// 1 xrefs:
// > EditorUI::onCreate @ 0x487892
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:49:23 +0000
//
int __fastcall EditorUI::playSoundForCreatedObject(EditorUI *this, GameObject *a2)
{
int v3; // r4
int v4; // r0
int v5; // r6
unsigned int v6; // r7
bool v7; // zf
int v8; // r4
EditorSFXManager *v9; // r0
EditorSFXManager *hasSoundsForAction; // r0
EditorSFXManager *v11; // r0
int v12; // r1
if ( !a2 )
{
v8 = 263;
goto LABEL_43;
}
v3 = *((_DWORD *)a2 + 223);
v4 = (*(int (__fastcall **)(GameObject *))(*(_DWORD *)a2 + 900))(a2);
v5 = *((_DWORD *)a2 + 271);
v6 = v4;
this = (EditorUI *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)a2 + 868))(a2);
if ( v3 == 1334 )
goto LABEL_26;
if ( v3 > 1334 )
{
if ( v3 != 1700 )
{
if ( v3 > 1700 )
{
if ( v3 == 2063 )
{
v8 = 260;
goto LABEL_43;
}
if ( v3 != 2065 )
{
v7 = v3 == 2012;
goto LABEL_20;
}
}
else if ( v3 != 1586 )
{
if ( v3 == 1615 )
goto LABEL_24;
v7 = v3 == 1584;
LABEL_20:
if ( !v7 )
goto LABEL_27;
LABEL_40:
v8 = 264;
goto LABEL_43;
}
}
v8 = 251;
goto LABEL_43;
}
if ( v3 == 914 )
{
LABEL_24:
v8 = 252;
goto LABEL_43;
}
if ( v3 <= 914 )
{
if ( (unsigned int)(v3 - 200) > 3 )
goto LABEL_27;
LABEL_26:
v8 = 265;
goto LABEL_43;
}
if ( v3 == 918 || v3 >= 918 && (unsigned int)(v3 - 1327) <= 1 )
goto LABEL_40;
LABEL_27:
if ( v6 > 0x2F )
{
if ( this )
goto LABEL_42;
}
else
{
v8 = word_BEBDD8[v6 + 2];
if ( this )
{
if ( v8 != 263 )
{
if ( v8 == 256 )
v8 = 255;
goto LABEL_43;
}
LABEL_42:
v8 = 254;
goto LABEL_43;
}
if ( v8 != 263 )
goto LABEL_43;
}
if ( v5 == 2 || (this = (EditorUI *)(*(int (__fastcall **)(GameObject *))(*(_DWORD *)a2 + 864))(a2)) != nullptr )
{
v8 = 253;
}
else
{
v8 = 263;
if ( v5 == 1 )
v8 = 250;
}
LABEL_43:
v9 = (EditorSFXManager *)EditorSFXManager::sharedState(this);
hasSoundsForAction = (EditorSFXManager *)EditorSFXManager::hasSoundsForAction(v9, v8);
if ( hasSoundsForAction )
{
v11 = (EditorSFXManager *)EditorSFXManager::sharedState(hasSoundsForAction);
v12 = v8;
}
else
{
v11 = (EditorSFXManager *)EditorSFXManager::sharedState(nullptr);
v12 = 100;
}
return EditorSFXManager::playAction(v11, v12);
}