//
// VirtualKeyboardNode::buildKeys from 0xd091c8 to 0xd09530 (872 bytes)
//
// 2 xrefs:
// > VirtualKeyboardNode::init @ 0xd09564
// > ??> @ 0xabc40
//
// 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 13:06:58 +0000
//
__int64 __fastcall VirtualKeyboardNode::buildKeys(VirtualKeyboardNode *this)
{
float v1; // s1
int v3; // w19
float *v4; // x22
float v5; // s0
float v6; // w23
float v7; // t1
int v8; // w20
void (__fastcall *v9)(VirtualKeyboardNode *, char **); // x19
float v10; // s9
__int64 (__fastcall *v11)(VirtualKeyboardNode *, char **); // x19
cocos2d::CCMenu *v12; // x0
__int64 v13; // x0
cocos2d::CCDirector *v14; // x0
__int64 v15; // x0
cocos2d::CCTouchDispatcher *v16; // x0
const char *v17; // x6
char *v18; // x28
unsigned int i; // w20
float v20; // s8
__int64 v21; // x23
__int64 v22; // x19
void (__fastcall *v23)(__int64, char **); // x27
__int64 v24; // x19
float v25; // w1
int v26; // w0
bool v27; // cc
__int64 v28; // x0
int v29; // w0
__int64 **v30; // x27
__int64 *v31; // x1
__int64 v32; // x0
cocos2d::CCDirector **v34; // x19
void (__fastcall *v35)(cocos2d::CCDirector **, _QWORD); // x20
__int64 v36; // x0
__int64 v37; // x0
char *v38; // [xsp+90h] [xbp+90h] BYREF
v1 = 0.0;
v3 = 0;
v4 = (float *)&unk_13FB520;
do
{
v5 = (float)(v4[1] + v4[2]) * 28.0;
if ( v5 <= v1 )
v5 = v1;
v7 = *v4;
v4 += 8;
v6 = v7;
v1 = v5;
if ( v3 < SLODWORD(v7) )
v3 = LODWORD(v6);
}
while ( v4 != (float *)&off_13FBAA0 );
v8 = v3 + 1;
v9 = *(void (__fastcall **)(VirtualKeyboardNode *, char **))(*(_QWORD *)this + 320LL);
v10 = (float)v8 * 28.0;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v38, v5, v10);
v9(this, &v38);
v11 = *(__int64 (__fastcall **)(VirtualKeyboardNode *, char **))(*(_QWORD *)this + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.5, 0.5);
v12 = (cocos2d::CCMenu *)v11(this, &v38);
v13 = cocos2d::CCMenu::create(v12);
*((_QWORD *)this + 41) = v13;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v13 + 184LL))(v13, &unk_155F6D0);
v14 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(VirtualKeyboardNode *, _QWORD))(*(_QWORD *)this + 456LL))(
this,
*((_QWORD *)this + 41));
v15 = cocos2d::CCDirector::sharedDirector(v14);
v16 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 160LL))(v15);
if ( (unsigned __int8)cocos2d::CCTouchDispatcher::isUsingForcePrio(v16) )
{
v34 = *((cocos2d::CCDirector ***)this + 41);
v35 = *((void (__fastcall **)(cocos2d::CCDirector **, _QWORD))*v34 + 128);
v36 = cocos2d::CCDirector::sharedDirector(*v34);
v37 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 160LL))(v36);
v35(v34, (unsigned int)(*(_DWORD *)(v37 + 128) - 1));
}
v18 = (char *)&unk_13FB510;
for ( i = 0; i != 44; ++i )
{
while ( 1 )
{
v20 = *((float *)v18 + 6);
v21 = ButtonSprite::create(
*((ButtonSprite **)v18 + 1),
(const char *)(unsigned int)(int)(float)((float)(v20 * 28.0) + -3.0),
(int)(float)((float)(v20 * 28.0) + -3.0),
1,
0.55,
"bigFont.fnt",
"GJ_button_04.png",
v17,
26.0);
v22 = CCMenuItemSpriteExtra::create(v21, 0, (__int64)this, (__int64)VirtualKeyboardNode::onKey, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v22 + 72LL))(v22, i);
v23 = *(void (__fastcall **)(__int64, char **))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v38,
(float)(*((float *)v18 + 5) + (float)(v20 * 0.5)) * 28.0,
v10 - (float)((float)((float)*((int *)v18 + 4) + 0.5) * 28.0));
v23(v22, &v38);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 41) + 456LL))(*((_QWORD *)this + 41), v22);
if ( v18[28] )
break;
++i;
v18 += 32;
if ( i == 44 )
goto LABEL_25;
}
v24 = *((_QWORD *)this + 44);
if ( !v24 )
{
v38 = (char *)this + 352;
v30 = (__int64 **)((char *)this + 352);
goto LABEL_21;
}
v25 = *(float *)v18;
v26 = *(_DWORD *)(v24 + 32);
v27 = v26 < *(_DWORD *)v18;
if ( v26 > *(_DWORD *)v18 )
{
LABEL_14:
v28 = *(_QWORD *)v24;
if ( !*(_QWORD *)v24 )
{
v38 = (char *)v24;
v30 = (__int64 **)v24;
goto LABEL_21;
}
goto LABEL_15;
}
while ( 1 )
{
if ( !v27 )
goto LABEL_24;
v28 = *(_QWORD *)(v24 + 8);
if ( !v28 )
break;
LABEL_15:
v24 = v28;
v29 = *(_DWORD *)(v28 + 32);
v27 = v29 < SLODWORD(v25);
if ( v29 > SLODWORD(v25) )
goto LABEL_14;
}
v38 = (char *)v24;
v30 = (__int64 **)(v24 + 8);
LABEL_21:
v24 = operator new(0x30u);
v31 = (__int64 *)v24;
*(_DWORD *)(v24 + 32) = *(_DWORD *)v18;
*(_QWORD *)(v24 + 40) = 0;
*(_QWORD *)(v24 + 16) = v38;
*(_QWORD *)v24 = 0;
*(_QWORD *)(v24 + 8) = 0;
*v30 = (__int64 *)v24;
v32 = **((_QWORD **)this + 43);
if ( v32 )
{
*((_QWORD *)this + 43) = v32;
v31 = *v30;
}
std::__tree_balance_after_insert *>(*((__int64 **)this + 44), v31);
++*((_QWORD *)this + 45);
LABEL_24:
*(_QWORD *)(v24 + 40) = v21;
v18 += 32;
}
LABEL_25:
VirtualKeyboardNode::refreshModifierVisuals(this);
return _stack_chk_guard;
}