//
// EditorUI::toggleDuplicateButton from 0x10000bf60 to 0x10000c08e (302 bytes)
//
// 1 xrefs:
// > EditorUI::updateButtons @ 0x10000ae1c
//
// 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:18:50 +0000
//
__int64 __fastcall EditorUI::toggleDuplicateButton(_QWORD *a1)
{
_BYTE *v2; // rdi
int v3; // eax
void *v4; // r14
unsigned __int8 v5; // r15
char v6; // r12
_BYTE *v7; // rdi
__int64 v8; // rdi
__int64 v9; // rdx
__int64 v10; // rax
unsigned int v11; // ecx
__int64 v12; // rcx
_BYTE *v13; // rdi
void *v14; // rsi
unsigned int v15; // r14d
if ( a1[187] )
{
v2 = (_BYTE *)a1[141];
v2[408] = 1;
LABEL_4:
v4 = &unk_100A038D0;
v5 = -1;
v6 = 1;
goto LABEL_5;
}
v3 = sub_1007FEF90(a1[112]);
v2 = (_BYTE *)a1[141];
v2[408] = v3 != 0;
if ( v3 )
goto LABEL_4;
v6 = 0;
v4 = &unk_100A038D3;
v5 = -81;
LABEL_5:
(*(void (__fastcall **)(_BYTE *, void *))(*(_QWORD *)v2 + 960LL))(v2, v4);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)a1[141] + 912LL))(a1[141], v5);
v7 = (_BYTE *)a1[142];
v7[408] = v6;
(*(void (__fastcall **)(_BYTE *, void *))(*(_QWORD *)v7 + 960LL))(v7, v4);
v8 = a1[142];
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 912LL))(v8, v5);
v10 = GameManager::sharedState(v8, v5, v9);
v11 = *(unsigned __int8 *)(v10 + 512);
if ( (v11 & 1) != 0 )
v12 = *(_QWORD *)(v10 + 520);
else
v12 = v11 >> 1;
v13 = (_BYTE *)a1[143];
v13[408] = v12 != 0;
v14 = &unk_100A038D3;
if ( v12 )
v14 = &unk_100A038D0;
v15 = 175;
if ( v12 )
v15 = 255;
(*(void (__fastcall **)(_BYTE *, void *))(*(_QWORD *)v13 + 960LL))(v13, v14);
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)a1[143] + 912LL))(a1[143], v15);
}