//
// EditorUI::toggleDuplicateButton from 0x7c4698 to 0x7c485c (452 bytes)
//
// 2 xrefs:
// > EditorUI::updateButtons @ 0x7c809c
// > ??> @ 0xb9f98
//
// 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:08 +0000
//
__int64 __fastcall EditorUI::toggleDuplicateButton(EditorUI *this)
{
__int64 (*v2)(void); // x2
GameManager *v3; // x0
__int64 v4; // x2
__int64 v5; // x1
_BOOL4 v6; // w1
void (*v7)(void); // x2
if ( *((_QWORD *)this + 187) || (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
*(_BYTE *)(*((_QWORD *)this + 141) + 408LL) = 1;
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)this + 141) + 960LL))(
*((_QWORD *)this + 141),
&qword_1142200);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 141) + 912LL))(*((_QWORD *)this + 141), 0xFFFFFFFFLL);
*(_BYTE *)(*((_QWORD *)this + 142) + 408LL) = 1;
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)this + 142) + 960LL))(
*((_QWORD *)this + 142),
&qword_1142200);
v2 = *(__int64 (**)(void))(**((_QWORD **)this + 142) + 912LL);
}
else
{
*(_BYTE *)(*((_QWORD *)this + 141) + 408LL) = 0;
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)this + 141) + 960LL))(
*((_QWORD *)this + 141),
&qword_1142270);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 141) + 912LL))(*((_QWORD *)this + 141), 4294967215LL);
*(_BYTE *)(*((_QWORD *)this + 142) + 408LL) = 0;
(*(void (__fastcall **)(_QWORD, __int64 *))(**((_QWORD **)this + 142) + 960LL))(
*((_QWORD *)this + 142),
&qword_1142270);
v2 = *(__int64 (**)(void))(**((_QWORD **)this + 142) + 912LL);
}
v3 = (GameManager *)v2();
v4 = GameManager::sharedState(v3) + 512;
v5 = *(_BYTE *)v4 >> 1;
if ( (*(_BYTE *)v4 & 1) != 0 )
v5 = *(_QWORD *)(v4 + 8);
v6 = v5 != 0;
*(_BYTE *)(*((_QWORD *)this + 143) + 408LL) = v6;
v7 = *(void (**)(void))(**((_QWORD **)this + 143) + 960LL);
if ( v6 )
{
v7();
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 143) + 912LL))(
*((_QWORD *)this + 143),
255);
}
else
{
v7();
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 143) + 912LL))(
*((_QWORD *)this + 143),
175);
}
}