//
// EditorUI::playSoundForCreatedObject from 0x7c2114 to 0x7c22d0 (444 bytes)
//
// 2 xrefs:
// > EditorUI::onCreate @ 0x7ca858
// > ??> @ 0x58468
//
// 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:54:07 +0000
//
__int64 __fastcall EditorUI::playSoundForCreatedObject(EditorUI *this, GameObject *a2)
{
int v2; // w19
int v3; // w20
unsigned int v4; // w21
int v5; // w22
EditorSFXManager *v6; // x0
EditorSFXManager *hasSoundsForAction; // x0
EditorSFXManager *v8; // x0
int v9; // w1
v2 = 263;
if ( !a2 )
goto LABEL_11;
v3 = *((_DWORD *)a2 + 257);
v4 = (*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a2 + 1800LL))(a2);
v5 = *((_DWORD *)a2 + 312);
this = (EditorUI *)(*(unsigned __int8 (__fastcall **)(GameObject *))(*(_QWORD *)a2 + 1736LL))(a2);
if ( v3 == 1334 )
goto LABEL_21;
if ( v3 <= 1334 )
{
if ( v3 == 914 )
goto LABEL_17;
if ( v3 > 914 )
{
if ( v3 == 918 || v3 >= 918 && (unsigned int)(v3 - 1327) <= 1 )
goto LABEL_33;
goto LABEL_9;
}
if ( (unsigned int)(v3 - 200) > 3 )
goto LABEL_9;
LABEL_21:
v2 = 265;
goto LABEL_11;
}
if ( v3 == 1700 )
goto LABEL_22;
if ( v3 > 1700 )
{
v2 = 260;
if ( v3 == 2063 )
goto LABEL_11;
if ( v3 != 2065 )
{
if ( v3 != 2012 )
goto LABEL_9;
LABEL_33:
v2 = 264;
goto LABEL_11;
}
LABEL_22:
v2 = 251;
goto LABEL_11;
}
switch ( v3 )
{
case 1586:
goto LABEL_22;
case 1615:
LABEL_17:
v2 = 252;
goto LABEL_11;
case 1584:
goto LABEL_33;
}
LABEL_9:
if ( v4 <= 0x2F )
{
v2 = word_1142210[v4];
if ( (_BYTE)this )
{
if ( v2 == 256 )
{
v2 = 255;
goto LABEL_11;
}
if ( v2 == 263 )
{
v2 = 254;
goto LABEL_11;
}
}
if ( v2 != 263 )
goto LABEL_11;
}
else
{
v2 = 254;
if ( (_BYTE)this )
goto LABEL_11;
}
if ( v5 == 2
|| (this = (EditorUI *)(*(unsigned __int8 (__fastcall **)(GameObject *))(*(_QWORD *)a2 + 1728LL))(a2), (_BYTE)this) )
{
v2 = 253;
}
else
{
this = (EditorUI *)(off_F8 + 2);
if ( v5 == 1 )
v2 = 250;
else
v2 = 263;
}
LABEL_11:
v6 = (EditorSFXManager *)EditorSFXManager::sharedState(this);
hasSoundsForAction = (EditorSFXManager *)(unsigned __int8)EditorSFXManager::hasSoundsForAction(v6, v2);
if ( (_BYTE)hasSoundsForAction )
{
v8 = (EditorSFXManager *)EditorSFXManager::sharedState(hasSoundsForAction);
v9 = v2;
}
else
{
v8 = (EditorSFXManager *)EditorSFXManager::sharedState(hasSoundsForAction);
v9 = 100;
}
return EditorSFXManager::playAction(v8, v9);
}