//
// SetupObjectOptions2Popup::onPlusButton from 0x140597d30 to 0x140597eab (379 bytes)
//
// 2 xrefs:
// > ??> @ 0x1407e54b0
// > ??> @ 0x14092d1dc
//
// 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 11:34:34 +0000
//
// Hidden C++ exception states: #wind=4
__int64 __fastcall SetupObjectOptions2Popup::onPlusButton(__int64 a1)
{
_QWORD *v2; // rax
__int64 v3; // rcx
void *v4; // rcx
_QWORD **v5; // rdi
_QWORD *v6; // rcx
_QWORD *v7; // rbx
int v9; // [rsp+30h] [rbp-48h] BYREF
void *v10; // [rsp+38h] [rbp-40h]
__int64 v11; // [rsp+40h] [rbp-38h]
void *Block[2]; // [rsp+48h] [rbp-30h] BYREF
__int64 v13; // [rsp+58h] [rbp-20h]
__int64 v14; // [rsp+60h] [rbp-18h]
__int64 v15; // [rsp+68h] [rbp-10h]
void *v16; // [rsp+90h] [rbp+18h]
v11 = 0;
v2 = operator new(0x18u);
*v2 = v2;
v2[1] = v2;
v10 = v2;
*(_OWORD *)Block = 0;
v13 = 0;
v14 = 7;
v15 = 8;
v9 = 1065353216;
sub_14003F200((__int64)Block, 0x10u, (unsigned __int64)v2);
v3 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v16 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v3 = qword_14090BFD0;
}
LevelEditorLayer::getNextFreeEnterChannel(*(_QWORD *)(v3 + 568), (__int64)&v9);
v4 = Block[0];
if ( Block[0] )
{
if ( ((v13 - (unsigned __int64)Block[0]) & 0xFFFFFFFFFFFFFFF8uLL) >= 0x1000 )
{
v4 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v4 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v4);
}
v5 = (_QWORD **)v10;
**((_QWORD **)v10 + 1) = 0;
v6 = *v5;
if ( *v5 )
{
do
{
v7 = (_QWORD *)*v6;
j_j_free(v6);
v6 = v7;
}
while ( v7 );
}
j_j_free(v5);
return SetupTriggerPopup::updateValue(a1, 343);
}