//
// KeybindingsLayer::showTab from 0x1006e3b60 to 0x1006e3f76 (1046 bytes)
//
// 2 xrefs:
// > ??> @ 0x100b93b70
// > ??> @ 0x100bc1340
//
// 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:35:46 +0000
//
void __fastcall KeybindingsLayer::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
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // rax
__int64 v21; // r15
const std::string::value_type *v22; // rsi
std::string::size_type v23; // rdx
std::string *v24; // rax
char v25; // r14
__int64 v26; // [rsp+8h] [rbp-88h] BYREF
float v27; // [rsp+10h] [rbp-80h]
float v28; // [rsp+14h] [rbp-7Ch]
std::string v29; // [rsp+18h] [rbp-78h] BYREF
__int128 v30; // [rsp+30h] [rbp-60h] BYREF
void *__p; // [rsp+40h] [rbp-50h]
std::string v32; // [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 + 1184);
v6 = *(_QWORD *)(a1 + 1136);
if ( v6 == 0 || v4 < 0 )
goto LABEL_11;
strcpy((char *)&v29, " keybindings.tab.");
std::to_string(&v32, v4);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
{
data = v32.__r_.__value_.__l.__data_;
size = v32.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v32.__r_.__value_.__l.0 >> 1;
data = v32.__r_.__value_.__s.__data_;
}
v9 = std::string::append(&v29, data, size);
__p = v9->__r_.__value_.__l.__data_;
v30 = *(_OWORD *)&v9->__r_.__value_.__l.0;
*(_OWORD *)&v9->__r_.__value_.__l.0 = 0;
v9->__r_.__value_.__r.__words[2] = 0;
sub_10096B6A0(v6, &v30);
if ( (v30 & 1) != 0 )
{
operator delete(__p);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_9:
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) != 0 )
LABEL_10:
operator delete(v29.__r_.__value_.__l.__data_);
LABEL_11:
v10 = *(_QWORD *)(a1 + 1112);
if ( v10 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v10 + 344LL))(v10, v5 == a2);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 1112) + 1000LL))(*(_QWORD *)(a1 + 1112), v5 == a2);
if ( v4 == v5 && v5 != a2 )
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 1112) + 1160LL))(*(_QWORD *)(a1 + 1112), 0);
}
v11 = *(_QWORD *)(a1 + 1120);
if ( v11 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v11 + 344LL))(v11, v5 == a2);
v12 = *(_QWORD *)(a1 + 1128);
if ( v12 )
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v12 + 344LL))(v12, v5 == a2);
*(_DWORD *)(a1 + 1064) = a2;
v13 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v26, v13);
v14 = *(_QWORD *)(a1 + 1136);
if ( v14 )
{
v15 = flt_100A11140[v5 == a2];
v27 = (float)(*((float *)&v26 + 1) * 0.5) + -128.0;
v28 = *(float *)(a1 + 732) + -30.0;
sub_100278260((float *)&v30, v28, (float)(v15 + (float)(*((float *)&v26 + 1) * 0.5)) - v27);
ScrollableContentLayer::setViewSize(v14, &v30);
v16 = *(_QWORD *)(a1 + 1136);
sub_100278250((float *)&v30, (float)(0.5 * *(float *)&v26) - (float)(v28 * 0.5), v27);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v16 + 184LL))(v16, &v30);
v17 = *(_QWORD *)(*(_QWORD *)(a1 + 1136) + 416LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 584LL))(v17, 1);
v20 = cocos2d::CCMenu::create(v17, 1, v18, v19);
*(_QWORD *)(a1 + 1144) = v20;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v20 + 296LL))(v20, &unk_100BE6438);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1144) + 320LL))(
*(_QWORD *)(a1 + 1144),
&unk_100BE6440);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1144) + 184LL))(
*(_QWORD *)(a1 + 1144),
&unk_100BE6438);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(*(_QWORD *)(a1 + 1136) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 1136) + 416LL),
*(_QWORD *)(a1 + 1144),
2);
}
KeybindingsLayer::buildContentForTab(a1, a2);
v21 = *(_QWORD *)(a1 + 1136);
if ( !v21 )
goto LABEL_29;
strcpy((char *)&v29, " keybindings.tab.");
std::to_string(&v32, a2);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) != 0 )
{
v22 = v32.__r_.__value_.__l.__data_;
v23 = v32.__r_.__value_.__l.__size_;
}
else
{
v23 = *(_BYTE *)&v32.__r_.__value_.__l.0 >> 1;
v22 = v32.__r_.__value_.__s.__data_;
}
v24 = std::string::append(&v29, v22, v23);
__p = v24->__r_.__value_.__l.__data_;
v30 = *(_OWORD *)&v24->__r_.__value_.__l.0;
*(_OWORD *)&v24->__r_.__value_.__l.0 = 0;
v24->__r_.__value_.__r.__words[2] = 0;
v25 = sub_10096B700(v21, &v30);
if ( (v30 & 1) != 0 )
{
operator delete(__p);
if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_26:
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_27;
goto LABEL_33;
}
}
else if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_26;
}
operator delete(v32.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_27:
if ( v25 )
{
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(v29.__r_.__value_.__l.__data_);
if ( v25 )
goto LABEL_29;
goto LABEL_28;
}
}
else if ( (*(_BYTE *)&v32.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_9;
}
operator delete(v32.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v29.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_11;
goto LABEL_10;
}
}