//
// EditorSoundsLayer::showTab from 0x1008fe8d0 to 0x1008fecea (1050 bytes)
//
// 1 xrefs:
// > ??> @ 0x100bb7c28
//
// 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:38:01 +0000
//
void __fastcall EditorSoundsLayer::showTab(__int64 a1, int a2)
{
int v4; // r15d
int v5; // r13d
__int64 v6; // r12
const std::string::value_type *data; // rsi
std::string::size_type size; // rdx
std::string *v9; // rax
__int64 v10; // rdi
__int64 v11; // rdi
__int64 v12; // rdi
__int64 v13; // rax
__int64 v14; // r15
float v15; // xmm1_4
__int64 v16; // r15
__int64 v17; // rdi
int v18; // edx
int v19; // ecx
int v20; // r8d
int v21; // r9d
__int64 v22; // rax
__int64 v23; // r15
const std::string::value_type *v24; // rsi
std::string::size_type v25; // rdx
std::string *v26; // rax
char v27; // r14
__int64 v28; // [rsp+8h] [rbp-88h] BYREF
float v29; // [rsp+10h] [rbp-80h]
float v30; // [rsp+14h] [rbp-7Ch]
std::string v31; // [rsp+18h] [rbp-78h] BYREF
__int128 v32; // [rsp+30h] [rbp-60h] BYREF
void *__p; // [rsp+40h] [rbp-50h]
std::string v34; // [rsp+50h] [rbp-40h] BYREF
if ( a2 >= 0 && (int)(954437177 * ((*(_QWORD *)(a1 + 1024) - *(_QWORD *)(a1 + 1016)) >> 3)) > a2 )
{
v4 = *(_DWORD *)(a1 + 1064);
v5 = *(_DWORD *)(a1 + 1144);
v6 = *(_QWORD *)(a1 + 1152);
if ( v6 == 0 || v4 < 0 )
goto LABEL_11;
strcpy((char *)&v31, "\"editorsounds.tab.");
std::to_string(&v34, v4);
if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) != 0 )
{
data = v34.__r_.__value_.__l.__data_;
size = v34.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v34.__r_.__value_.__l.0 >> 1;
data = v34.__r_.__value_.__s.__data_;
}
v9 = std::string::append(&v31, data, size);
__p = v9->__r_.__value_.__l.__data_;
v32 = *(_OWORD *)&v9->__r_.__value_.__l.0;
*(_OWORD *)&v9->__r_.__value_.__l.0 = 0;
v9->__r_.__value_.__r.__words[2] = 0;
sub_10096B6A0(v6, &v32);
if ( (v32 & 1) != 0 )
{
operator delete(__p);
if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_9:
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
LABEL_10:
operator delete(v31.__r_.__value_.__l.__data_);
LABEL_11:
v10 = *(_QWORD *)(a1 + 1096);
if ( v10 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v10 + 344LL))(v10, v5 == a2);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 1096) + 1000LL))(*(_QWORD *)(a1 + 1096), v5 == a2);
if ( v4 == v5 && v5 != a2 )
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 1096) + 1160LL))(*(_QWORD *)(a1 + 1096), 0);
}
v11 = *(_QWORD *)(a1 + 1104);
if ( v11 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v11 + 344LL))(v11, v5 == a2);
v12 = *(_QWORD *)(a1 + 1112);
if ( v12 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v12 + 344LL))(v12, v5 == a2);
*(_DWORD *)(a1 + 1064) = a2;
v13 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v28, v13);
v14 = *(_QWORD *)(a1 + 1152);
if ( v14 )
{
v15 = flt_100A11140[v5 == a2];
v29 = (float)(*((float *)&v28 + 1) * 0.5) + -100.0;
v30 = *(float *)(a1 + 732) + -30.0;
sub_100278260((float *)&v32, v30, (float)(v15 + (float)(*((float *)&v28 + 1) * 0.5)) - v29);
ScrollableContentLayer::setViewSize(v14, &v32);
v16 = *(_QWORD *)(a1 + 1152);
sub_100278250((float *)&v32, (float)(0.5 * *(float *)&v28) - (float)(v30 * 0.5), v29);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v16 + 184LL))(v16, &v32);
v17 = *(_QWORD *)(*(_QWORD *)(a1 + 1152) + 416LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 584LL))(v17, 1);
v22 = cocos2d::CCMenu::create(v17, 1, v18, v19, v20, v21);
*(_QWORD *)(a1 + 1160) = v22;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v22 + 296LL))(v22, &unk_100BE7228);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1160) + 320LL))(
*(_QWORD *)(a1 + 1160),
&unk_100BE7230);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1160) + 184LL))(
*(_QWORD *)(a1 + 1160),
&unk_100BE7228);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(a1 + 1152) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 1152) + 416LL),
*(_QWORD *)(a1 + 1160),
2);
}
EditorSoundsLayer::buildContentForTab(a1, a2);
v23 = *(_QWORD *)(a1 + 1152);
if ( !v23 )
goto LABEL_29;
strcpy((char *)&v31, "\"editorsounds.tab.");
std::to_string(&v34, a2);
if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) != 0 )
{
v24 = v34.__r_.__value_.__l.__data_;
v25 = v34.__r_.__value_.__l.__size_;
}
else
{
v25 = *(_BYTE *)&v34.__r_.__value_.__l.0 >> 1;
v24 = v34.__r_.__value_.__s.__data_;
}
v26 = std::string::append(&v31, v24, v25);
__p = v26->__r_.__value_.__l.__data_;
v32 = *(_OWORD *)&v26->__r_.__value_.__l.0;
*(_OWORD *)&v26->__r_.__value_.__l.0 = 0;
v26->__r_.__value_.__r.__words[2] = 0;
v27 = sub_10096B700(v23, &v32);
if ( (v32 & 1) != 0 )
{
operator delete(__p);
if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_26:
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_27;
goto LABEL_33;
}
}
else if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_26;
}
operator delete(v34.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_27:
if ( v27 )
{
LABEL_29:
sub_10063FEA0(a1, (__int64)"GJ_button_02.png", (__int64)"GJ_button_05.png");
sub_10063FF50(a1);
return;
}
LABEL_28:
ScrollableContentLayer::scrollTo(0.0);
goto LABEL_29;
}
LABEL_33:
operator delete(v31.__r_.__value_.__l.__data_);
if ( v27 )
goto LABEL_29;
goto LABEL_28;
}
}
else if ( (*(_BYTE *)&v34.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_9;
}
operator delete(v34.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_11;
goto LABEL_10;
}
}