//
// EditorSoundsLayer::showTab from 0x1004d81d0 to 0x1004d857c (940 bytes)
//
// 1 xrefs:
// > ??> @ 0x10098ac30
//
// This function is hookable on this platform (idp: arm, 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:06:32 +0000
//
__int64 __fastcall EditorSoundsLayer::showTab(__int64 result, __int64 a2)
{
__int64 v3; // x19
int v4; // w23
int v5; // w22
__int64 v6; // x21
std::string *v7; // x1
std::string::size_type size; // x2
std::string *v9; // x0
__int128 v10; // q0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x21
float v16; // s0
float v17; // s1
float v18; // s8
float v19; // s9
__n128 v20; // q0
__int64 v21; // x21
__int64 v22; // x0
__int64 v23; // x21
std::string *v24; // x1
std::string::size_type v25; // x2
std::string *v26; // x0
__int128 v27; // q0
char v28; // w20
__int64 v29; // [xsp+8h] [xbp-A8h] BYREF
std::string v30; // [xsp+10h] [xbp-A0h] BYREF
std::string v31; // [xsp+28h] [xbp-88h] BYREF
void *__p[2]; // [xsp+40h] [xbp-70h] BYREF
std::string::size_type v33; // [xsp+50h] [xbp-60h]
if ( (a2 & 0x80000000) == 0 )
{
v3 = result;
if ( (int)(954437177 * ((*(_QWORD *)(result + 1024) - *(_QWORD *)(result + 1016)) >> 3)) > (int)a2 )
{
v4 = *(_DWORD *)(result + 1064);
v5 = *(_DWORD *)(result + 1144);
v6 = *(_QWORD *)(result + 1152);
if ( v6 && (v4 & 0x80000000) == 0 )
{
sub_100009900(&v31, "editorsounds.tab.");
std::to_string(&v30, *(_DWORD *)(v3 + 1064));
if ( (v30.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v7 = &v30;
else
v7 = (std::string *)v30.__r_.__value_.__r.__words[0];
if ( (v30.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
size = HIBYTE(v30.__r_.__value_.__r.__words[2]);
else
size = v30.__r_.__value_.__l.__size_;
v9 = std::string::append(&v31, (const std::string::value_type *)v7, size);
v10 = *(_OWORD *)&v9->__r_.__value_.__l.__data_;
v33 = v9->__r_.__value_.__r.__words[2];
*(_OWORD *)__p = v10;
v9->__r_.__value_.__l.__size_ = 0;
v9->__r_.__value_.__r.__words[2] = 0;
v9->__r_.__value_.__r.__words[0] = 0;
sub_100524C24(v6, __p);
if ( SHIBYTE(v33) < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v30.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
}
v11 = *(_QWORD *)(v3 + 1096);
if ( v11 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v11 + 344LL))(v11, v5 == (_DWORD)a2);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(v3 + 1096) + 1000LL))(
*(_QWORD *)(v3 + 1096),
v5 == (_DWORD)a2);
if ( v4 == v5 && v5 != (_DWORD)a2 )
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v3 + 1096) + 1160LL))(*(_QWORD *)(v3 + 1096), 0);
}
v12 = *(_QWORD *)(v3 + 1104);
if ( v12 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v12 + 344LL))(v12, v5 == (_DWORD)a2);
v13 = *(_QWORD *)(v3 + 1112);
if ( v13 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v13 + 344LL))(v13, v5 == (_DWORD)a2);
*(_DWORD *)(v3 + 1064) = a2;
v14 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v14, &v29);
v15 = *(_QWORD *)(v3 + 1152);
if ( v15 )
{
v16 = *((float *)&v29 + 1) * 0.5;
v17 = 96.0;
if ( v5 == (_DWORD)a2 )
v17 = 64.0;
v18 = v16 + -100.0;
v19 = *(float *)(v3 + 732) + -30.0;
sub_1000262C4((float *)__p, v19, (float)(v17 + v16) - (float)(v16 + -100.0));
ScrollableContentLayer::setViewSize(v15, __p, v20);
v21 = *(_QWORD *)(v3 + 1152);
sub_1000262BC((float *)__p, (float)(*(float *)&v29 * 0.5) - (float)(v19 * 0.5), v18);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v21 + 184LL))(v21, __p);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(v3 + 1152) + 416LL) + 584LL))(
*(_QWORD *)(*(_QWORD *)(v3 + 1152) + 416LL),
1);
v22 = cocos2d::CCMenu::create();
*(_QWORD *)(v3 + 1160) = v22;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v22 + 296LL))(v22, &unk_1009F80B0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v3 + 1160) + 320LL))(
*(_QWORD *)(v3 + 1160),
&unk_1009F80B8);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v3 + 1160) + 184LL))(
*(_QWORD *)(v3 + 1160),
&unk_1009F80B0);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(v3 + 1152) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(v3 + 1152) + 416LL),
*(_QWORD *)(v3 + 1160),
2);
}
EditorSoundsLayer::buildContentForTab(v3, a2);
v23 = *(_QWORD *)(v3 + 1152);
if ( v23 )
{
sub_100009900(&v31, "editorsounds.tab.");
std::to_string(&v30, a2);
if ( (v30.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v24 = &v30;
else
v24 = (std::string *)v30.__r_.__value_.__r.__words[0];
if ( (v30.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v25 = HIBYTE(v30.__r_.__value_.__r.__words[2]);
else
v25 = v30.__r_.__value_.__l.__size_;
v26 = std::string::append(&v31, (const std::string::value_type *)v24, v25);
v27 = *(_OWORD *)&v26->__r_.__value_.__l.__data_;
v33 = v26->__r_.__value_.__r.__words[2];
*(_OWORD *)__p = v27;
v26->__r_.__value_.__l.__size_ = 0;
v26->__r_.__value_.__r.__words[2] = 0;
v26->__r_.__value_.__r.__words[0] = 0;
v28 = sub_100524CA8(v23, __p);
if ( SHIBYTE(v33) < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v30.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( SHIBYTE(v31.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v31.__r_.__value_.__l.__data_);
if ( (v28 & 1) == 0 )
ScrollableContentLayer::scrollTo(*(_QWORD *)(v3 + 1152), 0.0);
}
sub_1001AA740((_QWORD *)v3, (__int64)"GJ_button_02.png", (__int64)"GJ_button_05.png");
return sub_1001AA7E8(v3);
}
}
return result;
}