//
// EditorSoundConfigUploadPopup::updateVisibilityState from 0xcd3d9c to 0xcd3f14 (376 bytes)
//
// 3 xrefs:
// > EditorSoundConfigUploadPopup::onToggleUnlisted @ 0xcd3f50
// > EditorSoundConfigUploadPopup::init @ 0xcd4f60
// > ??> @ 0x9d798
//
// 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 13:06:29 +0000
//
__int64 __fastcall EditorSoundConfigUploadPopup::updateVisibilityState(EditorSoundConfigUploadPopup *this)
{
__int64 v2; // x1
__int64 v3; // x0
unsigned int v4; // w23
__int64 v5; // x22
__int64 v6; // x0
unsigned int v7; // w0
CCMenuItemToggler *v8; // x0
bool v9; // cf
__int64 v10; // x0
char v11; // w1
__int64 v12; // x0
__int64 v13; // x19
_BYTE v15[8]; // [xsp+40h] [xbp+40h] BYREF
v2 = *((_QWORD *)this + 133);
v3 = *((_QWORD *)this + 134);
v4 = *(_DWORD *)(v2 + 316) > 0;
if ( v3 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v3 + 1056LL))(v3, *(_DWORD *)(v2 + 316) <= 0);
v5 = *((_QWORD *)this + 136);
v6 = *((_QWORD *)this + 134);
if ( v4 != 1 )
{
v15[0] = -1;
v15[1] = -1;
v15[2] = -1;
}
else
{
memset(v15, 125, 3);
}
if ( v6 )
CCMenuItemToggler::setSpriteColor(v6, (__int64)v15);
if ( v5 )
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v5 + 1072LL))(v5, v15);
}
v7 = *((unsigned __int8 *)this + 1104);
if ( !*((_BYTE *)this + 1104) )
{
if ( !*((_BYTE *)this + 1105) )
{
v10 = *((_QWORD *)this + 135);
goto LABEL_21;
}
v8 = *((CCMenuItemToggler **)this + 135);
*((_BYTE *)this + 1105) = 0;
if ( !v8 )
return _stack_chk_guard;
CCMenuItemToggler::toggle(v8, 0);
v7 = *((unsigned __int8 *)this + 1104);
}
v9 = v4 >= v7;
v10 = *((_QWORD *)this + 135);
if ( !v9 )
{
if ( !v10 )
return _stack_chk_guard;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 1056LL))(v10, 1);
v11 = -1;
goto LABEL_15;
}
LABEL_21:
if ( !v10 )
return _stack_chk_guard;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 1056LL))(v10, 0);
v11 = 125;
LABEL_15:
v12 = *((_QWORD *)this + 135);
v15[0] = v11;
v15[1] = v11;
v15[2] = v11;
v13 = *((_QWORD *)this + 137);
if ( v12 )
CCMenuItemToggler::setSpriteColor(v12, (__int64)v15);
if ( v13 )
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v13 + 1072LL))(v13, v15);
return _stack_chk_guard;
}