//
// KeybindingsLayer::addKeyPair from 0x10060a740 to 0x10060a9fc (700 bytes)
//
// 49 xrefs:
// > KeybindingsLayer::init @ 0x10060a0cf
// > KeybindingsLayer::init @ 0x10060a0fb
// > KeybindingsLayer::init @ 0x10060a111
// > KeybindingsLayer::init @ 0x10060a127
// > KeybindingsLayer::init @ 0x10060a13d
// > KeybindingsLayer::init @ 0x10060a159
// > KeybindingsLayer::init @ 0x10060a17e
// > KeybindingsLayer::init @ 0x10060a194
// > KeybindingsLayer::init @ 0x10060a1aa
// > KeybindingsLayer::init @ 0x10060a1c0
// > KeybindingsLayer::init @ 0x10060a1d6
// > KeybindingsLayer::init @ 0x10060a1ec
// > KeybindingsLayer::init @ 0x10060a202
// > KeybindingsLayer::init @ 0x10060a218
// > KeybindingsLayer::init @ 0x10060a22e
// > KeybindingsLayer::init @ 0x10060a244
// > KeybindingsLayer::init @ 0x10060a25a
// > KeybindingsLayer::init @ 0x10060a270
// > KeybindingsLayer::init @ 0x10060a286
// > KeybindingsLayer::init @ 0x10060a29c
// > KeybindingsLayer::init @ 0x10060a2b2
// > KeybindingsLayer::init @ 0x10060a2c8
// > KeybindingsLayer::init @ 0x10060a2de
// > KeybindingsLayer::init @ 0x10060a2f4
// > KeybindingsLayer::init @ 0x10060a30a
// > KeybindingsLayer::init @ 0x10060a320
// > KeybindingsLayer::init @ 0x10060a336
// > KeybindingsLayer::init @ 0x10060a34c
// > KeybindingsLayer::init @ 0x10060a362
// > KeybindingsLayer::init @ 0x10060a378
// > KeybindingsLayer::init @ 0x10060a38e
// > KeybindingsLayer::init @ 0x10060a3a4
// > KeybindingsLayer::init @ 0x10060a3ba
// > KeybindingsLayer::init @ 0x10060a3d0
// > KeybindingsLayer::init @ 0x10060a3e6
// > KeybindingsLayer::init @ 0x10060a3fc
// > KeybindingsLayer::init @ 0x10060a412
// > KeybindingsLayer::init @ 0x10060a42e
// > KeybindingsLayer::init @ 0x10060a43c
// > KeybindingsLayer::init @ 0x10060a452
// > KeybindingsLayer::init @ 0x10060a468
// > KeybindingsLayer::init @ 0x10060a47e
// > KeybindingsLayer::init @ 0x10060a494
// > KeybindingsLayer::init @ 0x10060a4aa
// > KeybindingsLayer::init @ 0x10060a4c0
// > KeybindingsLayer::init @ 0x10060a4d6
// > KeybindingsLayer::init @ 0x10060a4ec
// > KeybindingsLayer::init @ 0x10060a502
// > KeybindingsLayer::init @ 0x10060a518
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
cocos2d::CCLabelBMFont *__fastcall KeybindingsLayer::addKeyPair(KeybindingsLayer *a1, const char *a2, const char *a3)
{
int m_keyCount; // eax
int v4; // ebx
int m_maxPage; // eax
cocos2d::CCLayer *v6; // r12
int v7; // eax
int v8; // ecx
cocos2d::CCLayerColor *v9; // r13
cocos2d::CCLabelBMFont *v10; // r15
cocos2d::CCLabelBMFont *v11; // r13
unsigned __int64 v14; // [rsp+1Ch] [rbp-44h] BYREF
unsigned __int64 v15; // [rsp+24h] [rbp-3Ch] BYREF
int v16; // [rsp+2Ch] [rbp-34h]
double v17[6]; // [rsp+30h] [rbp-30h] BYREF
m_keyCount = a1->m_keyCount;
a1->m_keyCount = m_keyCount + 1;
v4 = 0;
if ( m_keyCount >= 7 )
v4 = (int)(float)(m_keyCount / 7u);
m_maxPage = a1->m_maxPage;
if ( m_maxPage <= v4 )
m_maxPage = v4;
a1->m_maxPage = m_maxPage;
v16 = v4;
v6 = KeybindingsLayer::layerForPage(a1, v4);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v17);
sub_10028CBE0((float *)&v15, *(float *)v17 * 0.5, (float)(*((float *)v17 + 1) * 0.5) + 100.0);
v7 = KeybindingsLayer::countForPage(a1, v4);
*((float *)&v15 + 1) = *((float *)&v15 + 1) - (float)(30 * v7 + 30);
v8 = 1677721600;
if ( (a1->m_keyCount & 1) == 0 )
v8 = 838860800;
LODWORD(v17[0]) = v8;
v9 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)v17, 360.0, 30.0);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLayerColor *, __int64))v6->addChild_0)(v6, v9, 0xFFFFFFFFLL);
sub_10028CBE0((float *)&v14, -180.0, -15.0);
sub_10028CCE0(v17, &v15, &v14);
((void (__fastcall *)(cocos2d::CCLayerColor *, double *))v9->setPosition)(v9, v17);
v10 = cocos2d::CCLabelBMFont::create_3(a2, "bigFont.fnt");
sub_10028CBE0((float *)v17, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v10->setAnchorPoint)(v10, v17);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v6->addChild)(v6, v10);
sub_10028CBE0((float *)&v14, -170.0, 0.0);
sub_10028CCE0(v17, &v15, &v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v10->setPosition)(v10, v17);
cocos2d::CCLabelBMFont::limitLabelWidth(v10, 260.0, 0.5, 0.0);
v11 = cocos2d::CCLabelBMFont::create_3(a3, "goldFont.fnt");
sub_10028CBE0((float *)v17, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v11->setAnchorPoint)(v11, v17);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v6->addChild)(v6, v11);
sub_10028CBE0((float *)&v14, 170.0, 0.0);
sub_10028CCE0(v17, &v15, &v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))v11->setPosition)(v11, v17);
cocos2d::CCLabelBMFont::limitLabelWidth(v11, 100.0, 0.60000002, 0.0);
KeybindingsLayer::incrementCountForPage(a1, v16);
return v10;
}