//
// TabbedPopupLayer::createTabButtons from 0x14066c650 to 0x14066cc07 (1463 bytes)
//
// 2 xrefs:
// > TabbedPopupLayer::createTabButtons_1 @ 0x14066c637
// > ??> @ 0x140932054
//
// 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:35:52 +0000
//
// Hidden C++ exception states: #wind=4
__int64 __fastcall TabbedPopupLayer::createTabButtons(
__int64 a1,
float a2,
float a3,
float a4,
int a5,
float a6,
int a7)
{
__int64 v8; // rax
__int64 v9; // rcx
cocos2d::CCArray *v10; // r13
unsigned __int64 v11; // r12
__int64 v12; // r8
_QWORD *v13; // r15
__int64 v14; // r14
int v15; // xmm6_4
_QWORD *v16; // rbx
__int64 v17; // rsi
const struct cocos2d::CCSize *v18; // rax
const char *v19; // rcx
struct cocos2d::CCSprite *v20; // rdi
__int64 v21; // rbx
__int64 v22; // rax
__int64 *v23; // rax
cocos2d::CCObject *v24; // rbx
__int64 v25; // rbx
__int64 v26; // rax
__int64 v27; // rax
float v28; // xmm7_4
float v29; // xmm6_4
__int64 *v30; // rdi
__int64 *v31; // rax
cocos2d::CCObject *v32; // rbx
_QWORD *v33; // r14
int v34; // xmm8_4
__int64 v35; // rsi
__int64 v36; // rbx
__int64 v37; // rdi
__int64 v38; // rax
__int64 v39; // rax
cocos2d::CCSprite *v40; // rdi
__int64 *v41; // rax
cocos2d::CCObject *v42; // rbx
__int64 v43; // rsi
__int64 v44; // rbx
__int64 v45; // rdi
__int64 v46; // rax
__int64 v47; // rax
float v49[2]; // [rsp+50h] [rbp-C8h] BYREF
void *v50; // [rsp+58h] [rbp-C0h]
_BYTE v51[8]; // [rsp+60h] [rbp-B8h] BYREF
void *v52; // [rsp+68h] [rbp-B0h] BYREF
float v53; // [rsp+120h] [rbp+8h] BYREF
float v54; // [rsp+124h] [rbp+Ch]
v8 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v8, &v53);
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9);
v11 = 0;
v12 = *(_QWORD *)(a1 + 1000);
v13 = (_QWORD *)(a1 + 552);
if ( (*(_QWORD *)(a1 + 1008) - v12) / 88 )
{
v14 = 0;
v15 = a5;
while ( 1 )
{
v16 = (_QWORD *)(v12 + v14);
if ( *(_QWORD *)(v12 + v14 + 24) > 0xFu )
v16 = (_QWORD *)*v16;
v50 = operator new(0x2C8u);
v17 = ButtonSprite::ButtonSprite((__int64)v50);
if ( v17 )
{
if ( ButtonSprite::init_1(
v17,
(__int64)v16,
(int)a3,
0,
v15,
0,
&qword_140704F78,
(__int64)"GJ_button_05.png",
1103626240) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v17);
}
else
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 8LL))(v17, 1);
v17 = 0;
}
}
*(_DWORD *)(v17 + 620) = 1066611507;
*(_DWORD *)(v17 + 664) = 1050253722;
if ( *(_QWORD *)(*(_QWORD *)(a1 + 1000) + v14 + 48) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v17 + 632) + 336LL))(*(_QWORD *)(v17 + 632), 0);
v18 = (const struct cocos2d::CCSize *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 320LL))(v17);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v49, v18);
v19 = (const char *)(v14 + *(_QWORD *)(a1 + 1000) + 32LL);
if ( *((_QWORD *)v19 + 3) > 0xFu )
v19 = *(const char **)v19;
v20 = cocos2d::CCSprite::createWithSpriteFrameName(v19);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v20 + 160LL))(v20);
v21 = *(_QWORD *)v20;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v51,
v49[0] * 0.5,
(float)((float)(v49[1] * 0.5) + *(float *)(v17 + 668)) - 1.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v21 + 184))(v20, v22);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v17 + 456LL))(v17, v20, 1);
}
v52 = operator new(0x208u);
v23 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v52);
v24 = (cocos2d::CCObject *)v23;
if ( !v23 )
goto LABEL_17;
if ( !CCMenuItemSpriteExtra::init(v23, (__int64 *)v17, 0, a1, (__int64)TabbedPopupLayer::onTab) )
break;
cocos2d::CCObject::autorelease(v24);
LABEL_18:
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v24 + 64LL))(v24, (unsigned int)v11);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(*(_QWORD *)*v13 + 464LL))(*v13, v24);
*(_QWORD *)(*(_QWORD *)(a1 + 1000) + v14 + 80) = v24;
cocos2d::CCArray::addObject(v10, v24);
++v11;
v14 += 88;
v12 = *(_QWORD *)(a1 + 1000);
if ( v11 >= (*(_QWORD *)(a1 + 1008) - v12) / 88 )
goto LABEL_19;
}
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v24 + 8LL))(v24, 1);
LABEL_17:
v24 = nullptr;
goto LABEL_18;
}
LABEL_19:
v25 = *v13;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v53 * 0.5, a2);
cocos2d::CCNode::convertToNodeSpace(v25, v51, v26);
GameToolbox::alignItemsHorisontally((__int64)v10, a4, v27, 0);
v28 = v54 * 0.5;
v29 = (float)(*(float *)(a1 + 732) * 0.5) + a6;
v30 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v52 = operator new(0x208u);
v31 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v52);
v32 = (cocos2d::CCObject *)v31;
v33 = (_QWORD *)(a1 + 552);
if ( v31 )
{
if ( CCMenuItemSpriteExtra::init(v31, v30, 0, a1, (__int64)TabbedPopupLayer::onTabPage) )
{
cocos2d::CCObject::autorelease(v32);
goto LABEL_24;
}
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v32 + 8LL))(v32, 1);
v33 = (_QWORD *)(a1 + 552);
}
v32 = nullptr;
LABEL_24:
*(_QWORD *)(a1 + 1056) = v32;
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v32 + 64LL))(v32, 0xFFFFFFFFLL);
v34 = a7;
*(_DWORD *)(*(_QWORD *)(a1 + 1056) + 372LL) = a7;
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v13 + 464LL))(*v13, *(_QWORD *)(a1 + 1056));
v35 = **(_QWORD **)(a1 + 1056);
v36 = *v13;
v37 = *(_QWORD *)(a1 + 1056);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, (float)(v53 * 0.5) - v29, v28);
cocos2d::CCNode::convertToNodeSpace(v36, v51, v38);
(*(void (__fastcall **)(__int64, __int64))(v35 + 184))(v37, v39);
v40 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v40, 1);
v52 = operator new(0x208u);
v41 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v52);
v42 = (cocos2d::CCObject *)v41;
if ( !v41 )
{
LABEL_28:
v42 = nullptr;
goto LABEL_29;
}
if ( !CCMenuItemSpriteExtra::init(v41, (__int64 *)v40, 0, a1, (__int64)TabbedPopupLayer::onTabPage) )
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v42 + 8LL))(v42, 1);
goto LABEL_28;
}
cocos2d::CCObject::autorelease(v42);
LABEL_29:
*(_QWORD *)(a1 + 1064) = v42;
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v42 + 64LL))(v42, 1);
*(_DWORD *)(*(_QWORD *)(a1 + 1064) + 372LL) = v34;
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*v33 + 464LL))(*v33, *(_QWORD *)(a1 + 1064));
v43 = **(_QWORD **)(a1 + 1064);
v44 = *v33;
v45 = *(_QWORD *)(a1 + 1064);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, (float)(v53 * 0.5) + v29, v28);
cocos2d::CCNode::convertToNodeSpace(v44, v51, v46);
return (*(__int64 (__fastcall **)(__int64, __int64))(v43 + 184))(v45, v47);
}