//
// KeybindingsSettingsPopup::init from 0xcf00f0 to 0xcf04b0 (960 bytes)
//
// 2 xrefs:
// > KeybindingsSettingsPopup::create @ 0xcf0640
// > ??> @ 0xf9238
//
// 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:45 +0000
//
__int64 __fastcall KeybindingsSettingsPopup::init(__int64 a1, __int64 a2, char **a3)
{
unsigned __int8 v5; // w0
unsigned int v6; // w25
cocos2d::CCDirector *v7; // x0
float v8; // s8
__int64 v9; // x19
void (__fastcall *v10)(__int64, _BYTE *); // x22
void (__fastcall *v11)(__int64, _BYTE *); // x22
const char *v12; // x2
__int64 v13; // x19
float v14; // s8
void (__fastcall *v15)(__int64, _BYTE *); // x22
cocos2d::CCMenu *v16; // x0
__int64 v17; // x0
__int64 v18; // x19
void (__fastcall *v19)(__int64, _BYTE *); // x22
const char *v20; // x1
const char *v21; // x6
__int64 v22; // x27
__int64 v23; // x28
unsigned __int64 v24; // x19
ButtonSprite *v25; // x0
const char *v26; // x5
__int64 v27; // x0
__int64 v28; // x27
float v29; // s1
void (__fastcall *v30)(__int64, _BYTE *); // x24
__int64 v31; // x0
__int64 v32; // x19
void (__fastcall *v33)(__int64, _BYTE *); // x21
__int64 v36; // [xsp+90h] [xbp+90h] BYREF
_BYTE v37[16]; // [xsp+98h] [xbp+98h] BYREF
v5 = FLAlertLayer::init((FLAlertLayer *)a1, 150);
v6 = v5;
if ( v5 )
{
*(_QWORD *)(a1 + 672) = a2;
if ( a3 != (char **)(a1 + 680) )
std::vector::assign((unsigned __int64 *)(a1 + 680), *a3, a3[1]);
*(_BYTE *)(a1 + 596) = (unsigned __int8)&dword_0 + 1;
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)((char *)&dword_0 + 1));
cocos2d::CCDirector::getWinSize(&v36, v7);
v8 = (float)((float)(0xAAAAAAAAAAAAAAABLL * ((__int64)(*(_QWORD *)(a1 + 688) - *(_QWORD *)(a1 + 680)) >> 4)) * 38.0)
+ 66.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v37, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v37);
v10 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v37, 260.0, v8);
v10(v9, v37);
v11 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, *(float *)&v36 * 0.5, *((float *)&v36 + 1) * 0.5);
v11(v9, v37);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v9,
4294967294LL);
v13 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Keybind Settings", "goldFont.fnt", v12);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v13 + 160LL))(v13, 0.7);
v14 = v8 * 0.5;
v15 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v13 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v37,
*(float *)&v36 * 0.5,
(float)(v14 + (float)(*((float *)&v36 + 1) * 0.5)) - 20.0);
v15(v13, v37);
v16 = (cocos2d::CCMenu *)(*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v13);
v17 = cocos2d::CCMenu::create(v16);
*(_QWORD *)(a1 + 552) = v17;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v17, 10);
v18 = *(_QWORD *)(a1 + 552);
v19 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v18 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, *(float *)&v36 * 0.5, *((float *)&v36 + 1) * 0.5);
v19(v18, v37);
v22 = *(_QWORD *)(a1 + 680);
if ( 0xAAAAAAAAAAAAAAABLL * ((*(_QWORD *)(a1 + 688) - v22) >> 4) )
{
v23 = 0;
v24 = 0;
do
{
v25 = *(ButtonSprite **)(v22 + v23);
v26 = *(const char **)(v22 + v23 + 8);
v23 += 48;
v27 = ButtonSprite::create(v25, (const char *)&qword_80 + 2, 0, 1, 0.7, "bigFont.fnt", v26, v21, 28.0);
v28 = CCMenuItemSpriteExtra::create(v27, 0, a1, (__int64)KeybindingsSettingsPopup::onEntry, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v28 + 72LL))(v28, (unsigned int)v24);
v29 = (float)v24++;
v30 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v28 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, 0.0, (float)(v14 - 62.0) - (float)(v29 * 38.0));
v30(v28, v37);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v28);
v22 = *(_QWORD *)(a1 + 680);
}
while ( v24 < 0xAAAAAAAAAAAAAAABLL * ((*(_QWORD *)(a1 + 688) - v22) >> 4) );
}
v31 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v20);
v32 = CCMenuItemSpriteExtra::create(v31, 0, a1, (__int64)KeybindingsSettingsPopup::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v32, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v32);
v33 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v32 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, -120.0, v14 - 10.0);
v33(v32, v37);
}
return v6;
}