//
// EditorUI::recreateButtonTabs from 0x1401f69e0 to 0x1401f6e75 (1173 bytes)
//
// 2 xrefs:
// > EditorPauseLayer::onResume @ 0x140182582
// > ??> @ 0x14091aabc
//
// 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:28:10 +0000
//
// Hidden C++ exception states: #wind=6
void __fastcall EditorUI::recreateButtonTabs(__int64 a1)
{
__int64 v2; // rbx
cocos2d::CCString *v3; // rax
int v4; // r12d
void *v5; // r8
__int64 v6; // rbx
cocos2d::CCString *v7; // rax
int v8; // r14d
void *v9; // r8
unsigned int i; // ebx
struct cocos2d::CCObject *v11; // rax
cocos2d::CCObject *v12; // rdx
__int64 v13; // rcx
char v14; // r15
__int64 v15; // rcx
char v16; // r13
__int64 v17; // rcx
char v18; // bl
char v19; // al
__int64 v20; // rcx
cocos2d::CCObject *v21; // rdx
__int64 v22; // rcx
cocos2d::CCObject *v23; // rcx
cocos2d::CCObject *v24; // rcx
__int64 v25; // rcx
cocos2d::CCObject *v26; // rcx
__int64 v27; // rdx
__int64 v28; // rcx
__int64 v29; // rcx
void *v30; // [rsp+30h] [rbp-50h]
void *v31; // [rsp+30h] [rbp-50h]
void *v32; // [rsp+30h] [rbp-50h]
void *v33; // [rsp+30h] [rbp-50h]
void *Block[2]; // [rsp+38h] [rbp-48h] BYREF
__int64 v35; // [rsp+48h] [rbp-38h]
unsigned __int64 v36; // [rsp+50h] [rbp-30h]
void *Src[2]; // [rsp+58h] [rbp-28h] BYREF
__int64 v38; // [rsp+68h] [rbp-18h]
unsigned __int64 v39; // [rsp+70h] [rbp-10h]
*(_BYTE *)(a1 + 1663) = 0;
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v30 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v30);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
*(_OWORD *)Block = 0;
v35 = 3;
v36 = 15;
LODWORD(Block[0]) = 6256231;
sub_140044D80(Block, "0049", 4u);
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v2 + 432), Block);
v4 = cocos2d::CCString::intValue(v3);
if ( v36 > 0xF )
{
v5 = Block[0];
if ( v36 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
v35 = 0;
v36 = 15;
LOBYTE(Block[0]) = 0;
v6 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v31 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v31);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v6 = qword_14090BFD0;
}
*(_OWORD *)Src = 0;
v38 = 3;
v39 = 15;
LODWORD(Src[0]) = 6256231;
sub_140044D80(Src, "0050", 4u);
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*(_QWORD *)(v6 + 432), Src);
v8 = cocos2d::CCString::intValue(v7);
if ( v39 > 0xF )
{
v9 = Src[0];
if ( v39 + 1 >= 0x1000 )
{
v9 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v9);
}
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 1240)); ++i )
{
v11 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 1240), i);
v12 = *((cocos2d::CCObject **)v11 + 42);
if ( v12 )
EditButtonBar::loadFromItems((__int64)v11, v12, v4, v8, 0);
}
v13 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v32 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v32);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v13 = qword_14090BFD0;
}
v14 = GameManager::getGameVariable(v13, "0191") ^ 1;
v15 = *(_QWORD *)(a1 + 1664);
v16 = v15 != 0;
if ( !v15 )
goto LABEL_26;
v17 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v33 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v33);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v17 = qword_14090BFD0;
}
v18 = *(_BYTE *)(a1 + 1676);
if ( (unsigned __int8)GameManager::getGameVariable(v17, "0247") == v18 )
LABEL_26:
v19 = 0;
else
v19 = 1;
if ( v14 != v16 || v19 )
{
v22 = *(_QWORD *)(a1 + 1664);
if ( v22 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v22 + 512LL))(v22);
*(_QWORD *)(a1 + 1664) = 0;
}
v23 = *(cocos2d::CCObject **)(a1 + 1680);
if ( v23 )
cocos2d::CCObject::release(v23);
*(_QWORD *)(a1 + 1680) = 0;
v24 = *(cocos2d::CCObject **)(a1 + 1688);
if ( v24 )
cocos2d::CCObject::release(v24);
*(_QWORD *)(a1 + 1688) = 0;
*(_QWORD *)(a1 + 1696) = 0;
v25 = *(_QWORD *)(a1 + 880);
if ( v25 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v25 + 512LL))(v25);
*(_QWORD *)(a1 + 880) = 0;
}
v26 = *(cocos2d::CCObject **)(a1 + 864);
if ( v26 )
cocos2d::CCObject::release(v26);
*(_QWORD *)(a1 + 864) = 0;
EditorUI::createMoveMenu(a1);
LOBYTE(v27) = !*(_BYTE *)(a1 + 1661) && *(_DWORD *)(a1 + 1508) == 3;
v28 = *(_QWORD *)(a1 + 1664);
if ( v28 )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v28 + 336LL))(v28, v27);
v29 = *(_QWORD *)(a1 + 880);
if ( v29 )
{
v27 = 0;
LABEL_50:
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 336LL))(v29, v27);
}
}
else
{
v29 = *(_QWORD *)(a1 + 880);
if ( v29 )
goto LABEL_50;
}
EditorUI::updateButtons(a1);
return;
}
v20 = *(_QWORD *)(a1 + 880);
if ( v20 )
{
v21 = *(cocos2d::CCObject **)(v20 + 336);
if ( v21 )
EditButtonBar::loadFromItems(v20, v21, v4, v8, 0);
}
}