//
// KeybindingsSettingsPopup::onImport from 0x7975d0 to 0x797804 (564 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall KeybindingsSettingsPopup::onImport(KeybindingsSettingsPopup *this, cocos2d::CCObject *a2)
{
GJKeybindManager *v3; // r0
int v4; // r0
int *v5; // r4
int *v6; // r0
char *v7; // r1
size_t v8; // r4
int v9; // r3
unsigned int v10; // r2
char *v11; // r3
int v12; // r3
char *v13; // r1
size_t v14; // r2
char *v15; // r5
char *v16; // r1
size_t v17; // r2
int *v18; // r5
int v20; // [sp+10h] [bp-Ch] BYREF
int v21; // [sp+14h] [bp-8h] BYREF
int v22; // [sp+18h] [bp-4h] BYREF
int v23; // [sp+1Ch] [bp+0h] BYREF
size_t v24; // [sp+20h] [bp+4h]
void *v25; // [sp+24h] [bp+8h]
int v26[3]; // [sp+28h] [bp+Ch] BYREF
int v27; // [sp+34h] [bp+18h] BYREF
size_t v28; // [sp+38h] [bp+1Ch]
const void *v29; // [sp+3Ch] [bp+20h]
unsigned __int8 v30; // [sp+40h] [bp+24h] BYREF
char v31; // [sp+41h] [bp+25h] BYREF
size_t v32; // [sp+44h] [bp+28h]
char *v33; // [sp+48h] [bp+2Ch]
unsigned __int8 v34; // [sp+4Ch] [bp+30h] BYREF
char v35; // [sp+4Dh] [bp+31h] BYREF
size_t v36; // [sp+50h] [bp+34h]
char *v37; // [sp+54h] [bp+38h]
int v38; // [sp+58h] [bp+3Ch] BYREF
size_t v39; // [sp+5Ch] [bp+40h]
const void *v40; // [sp+60h] [bp+44h]
v23 = 0;
v24 = 0;
v25 = nullptr;
v20 = 0;
v21 = 0;
v22 = 0;
v3 = (GJKeybindManager *)GJKeybindManager::sharedState(this);
v4 = GJKeybindManager::parseImportFile(v3, (unsigned __int8 *)&v23, &v20, &v21, &v22);
if ( v4 >= 0 )
{
if ( !v4 )
{
v5 = v26;
memset(v26, 0, sizeof(v26));
std::string::__init(v26, "File is invalid, empty, or from a newer version.", 0x30u);
v6 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Import Failed",
(int)v26,
(ButtonSprite *)"OK",
nullptr,
380.0);
(*(void (__fastcall **)(int *))(*v6 + 656))(v6);
LABEL_29:
std::string::~string((int)v5);
return std::string::~string((int)&v23);
}
*((_DWORD *)this + 135) = 2;
if ( (int *)((char *)this + 544) != &v23 )
{
if ( (v23 & 1) != 0 )
{
v7 = (char *)v25;
v8 = v24;
}
else
{
v8 = (int)(unsigned __int8)v23 >> 1;
v7 = (char *)&v23 + 1;
}
v9 = *((unsigned __int8 *)this + 544);
if ( (v9 & 1) != 0 )
{
v10 = (*((_DWORD *)this + 136) & 0xFFFFFFFE) - 1;
if ( v10 >= v8 )
{
v11 = *((char **)this + 138);
LABEL_12:
if ( v8 )
v11 = (char *)memmove(v11, v7, v8);
v11[v8] = 0;
if ( (*((_BYTE *)this + 544) & 1) != 0 )
*((_DWORD *)this + 137) = v8;
else
*((_BYTE *)this + 544) = 2 * v8;
goto LABEL_19;
}
v12 = *((_DWORD *)this + 137);
}
else
{
if ( v8 <= 0xA )
{
v11 = (char *)this + 545;
goto LABEL_12;
}
v12 = v9 >> 1;
v10 = 10;
}
std::string::__grow_by_and_replace((int)this + 544, v10, v8 - v10, v12, 0, v12, v8, v7);
}
LABEL_19:
v5 = &v27;
*((_DWORD *)this + 139) = v22;
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, "Replace current keybinds with ", 0x22u);
std::to_string((int)&v30);
if ( (v30 & 1) != 0 )
{
v13 = v33;
v14 = v32;
}
else
{
v14 = (int)v30 >> 1;
v13 = &v31;
}
std::string::append(&v27, v13, v14);
std::string::~string((int)&v30);
std::string::append(&v27, " actions from file?");
if ( v21 > 0 )
{
std::string::append(&v27, " (");
std::to_string((int)&v34);
if ( (v34 & 1) != 0 )
{
v16 = v37;
v17 = v36;
}
else
{
v17 = (int)v34 >> 1;
v16 = &v35;
}
std::string::append(&v27, v16, v17);
std::string::~string((int)&v34);
std::string::append(&v27, " unknown skipped)");
}
v38 = 0;
v39 = 0;
v15 = (char *)this + 520;
v40 = nullptr;
if ( (v27 & 1) != 0 )
{
std::string::__init(&v38, v29, v28);
}
else
{
v38 = v27;
v39 = v28;
v40 = v29;
}
v18 = FLAlertLayer::create(
(int)v15,
(cocos2d::CCLabelBMFont *)"Import Keybinds",
(int)&v38,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Replace",
380.0);
std::string::~string((int)&v38);
(*(void (__fastcall **)(int *))(*v18 + 656))(v18);
goto LABEL_29;
}
return std::string::~string((int)&v23);
}