//
// KeybindingsSettingsPopup::init from 0x79715c to 0x797402 (678 bytes)
//
// 1 xrefs:
// > KeybindingsSettingsPopup::create @ 0x797596
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:46 +0000
//
GameManager *__fastcall KeybindingsSettingsPopup::init(int a1, int a2, char **a3)
{
GameManager *v6; // r7
cocos2d::CCDirector *v7; // r0
float v8; // s16
int v9; // r9
void (__fastcall *v10)(int, _BYTE *); // r8
void (__fastcall *v11)(int, _BYTE *); // r8
const char *v12; // r2
int v13; // r8
float v14; // s16
void (__fastcall *v15)(int, _BYTE *); // r9
cocos2d::CCMenu *v16; // r0
int v17; // r0
int v18; // r8
void (__fastcall *v19)(int, _BYTE *); // r9
int v20; // r0
unsigned int v21; // r8
const char *v22; // r1
int v23; // r2
ButtonSprite *v24; // r0
int v25; // r11
unsigned int v26; // s15
int v27; // r0
int v28; // r8
void (__fastcall *v29)(int, _BYTE *); // r4
float v31; // [sp+10h] [bp-3Ch]
void (__fastcall *v32)(int, _BYTE *); // [sp+14h] [bp-38h]
float v33; // [sp+1Ch] [bp-30h] BYREF
float v34; // [sp+20h] [bp-2Ch]
int (__fastcall *v35)(KeybindingsSettingsPopup *, cocos2d::CCObject *); // [sp+24h] [bp-28h]
int v36; // [sp+28h] [bp-24h]
int (__fastcall *v37)(KeybindingsSettingsPopup *, cocos2d::CCObject *); // [sp+2Ch] [bp-20h]
int v38; // [sp+30h] [bp-1Ch]
_BYTE v39[16]; // [sp+34h] [bp-18h] BYREF
v6 = FLAlertLayer::init((FLAlertLayer *)a1, 150);
if ( v6 )
{
v7 = (cocos2d::CCDirector *)(a1 + 528);
*(_DWORD *)(a1 + 524) = a2;
if ( (char **)(a1 + 528) != a3 )
v7 = (cocos2d::CCDirector *)std::vector::assign(v7, *a3, a3[1]);
*(_BYTE *)(a1 + 468) = 1;
cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v33);
v8 = (float)((float)(unsigned int)(-1431655765 * ((*(_DWORD *)(a1 + 532) - *(_DWORD *)(a1 + 528)) >> 3)) * 38.0)
+ 66.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v39, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v39);
v10 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v39, 260.0, v8);
v10(v9, v39);
v11 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v33 * 0.5, v34 * 0.5);
v11(v9, v39);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v9, -2);
v13 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Keybind Settings", "goldFont.fnt", v12);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 80))(v13, 1060320051);
v14 = v8 * 0.5;
v15 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v33 * 0.5, (float)(v14 + (float)(v34 * 0.5)) - 20.0);
v15(v13, v39);
v16 = (cocos2d::CCMenu *)(*(int (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(
*(_DWORD *)(a1 + 460),
v13);
v17 = cocos2d::CCMenu::create(v16);
*(_DWORD *)(a1 + 444) = v17;
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v17, 10);
v18 = *(_DWORD *)(a1 + 444);
v19 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v33 * 0.5, v34 * 0.5);
v20 = v18;
v21 = 0;
v19(v20, v39);
while ( 1 )
{
v23 = *(_DWORD *)(a1 + 528);
if ( v21 >= -1431655765 * ((*(_DWORD *)(a1 + 532) - v23) >> 3) )
break;
v24 = ButtonSprite::create(
*(ButtonSprite **)(v23 + 24 * v21),
(const char *)&dword_80 + 2,
0,
0.7,
1,
"bigFont.fnt",
*(char **)(v23 + 24 * v21 + 4),
(const char *)0x41E00000,
v31);
v35 = KeybindingsSettingsPopup::onEntry;
v36 = 0;
v25 = CCMenuItemSpriteExtra::create((int)v24, 0, a1, (int)KeybindingsSettingsPopup::onEntry, 0);
(*(void (__fastcall **)(int, unsigned int))(*(_DWORD *)v25 + 36))(v25, v21);
v26 = v21++;
v32 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v25 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, 0.0, (float)(v14 - 62.0) - (float)((float)v26 * 38.0));
v32(v25, v39);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v25);
}
v27 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v22);
v37 = KeybindingsSettingsPopup::onClose;
v38 = 0;
v28 = CCMenuItemSpriteExtra::create(v27, 0, a1, (int)KeybindingsSettingsPopup::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v28, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v28);
v29 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v28 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, -120.0, v14 - 10.0);
v29(v28, v39);
}
return v6;
}