//
// AutoBackupPopup::init from 0xc5d13c to 0xc5d728 (1516 bytes)
//
// 2 xrefs:
// > AutoBackupPopup::create @ 0xc5d9e0
// > ??> @ 0xb3e90
//
// 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:05:20 +0000
//
__int64 __fastcall AutoBackupPopup::init(AutoBackupPopup *this, int a2)
{
char *v3; // x20
__int64 v4; // x4
__int64 v5; // x5
unsigned int inited; // w20
long double v8; // q0
__int64 v9; // x22
void (__fastcall *v10)(__int64, _BYTE *); // x24
float v11; // s9
__int64 v12; // x22
void (__fastcall *v13)(__int64, _BYTE *); // x24
float v14; // s8
__int64 v15; // x22
void (__fastcall *v16)(__int64, _BYTE *); // x24
void (__fastcall *v17)(__int64, _BYTE *); // x2
void (__fastcall *v18)(__int64, _BYTE *); // x24
const char *v19; // x4
__int64 v20; // x0
__int64 v21; // x22
void (__fastcall *v22)(__int64, _BYTE *); // x24
const char *v23; // x1
__int64 v24; // x22
__int64 v25; // x0
__int64 v26; // x22
void (__fastcall *v27)(__int64, _BYTE *); // x24
const char *v28; // x1
__int64 v29; // x22
float v30; // s8
void (__fastcall *v31)(__int64, _BYTE *); // x24
__int64 v32; // x22
void (__fastcall *v33)(__int64, _BYTE *); // x24
__int64 v34; // x22
__int64 v35; // x22
void (__fastcall *v36)(__int64, _BYTE *); // x24
__int64 v37; // x22
GJSelectionStrip *v38; // x0
__int64 v39; // [xsp+80h] [xbp+80h]
int v40; // [xsp+98h] [xbp+98h]
_BYTE v41[16]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v42; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v43; // [xsp+B8h] [xbp+B8h]
void *v44; // [xsp+C0h] [xbp+C0h]
v3 = (char *)this + 800;
*((_DWORD *)this + 198) = a2;
AutoBackupPopup::backupDirectory(&v42);
if ( (*((_BYTE *)this + 800) & 1) != 0 )
{
**((_BYTE **)v3 + 2) = 0;
*((_QWORD *)v3 + 1) = 0;
}
else
{
*((_BYTE *)this + 801) = 0;
*((_BYTE *)this + 800) = 0;
}
std::string::reserve((__int64 *)v3, 0);
v4 = v42;
v5 = v43;
*((_QWORD *)v3 + 2) = v44;
*(_QWORD *)v3 = v4;
*((_QWORD *)v3 + 1) = v5;
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, &byte_11E1A70, 1u);
inited = (unsigned __int8)PagedListPopup::initPaged(
(__int64)this,
(cocos2d::CCLabelBMFont *)"Auto-Backups",
(unsigned __int8 *)&v42,
400.0,
280.0);
if ( (v42 & 1) != 0 )
{
operator delete(v44);
if ( !inited )
return inited;
}
else if ( !inited )
{
return inited;
}
PagedListPopup::createScrollArea(this, 52.0, 44.0);
LODWORD(v8) = 1109393408;
ScrollableContentLayer::setSectionHeight(*((ScrollableContentLayer **)this + 86), v8);
PagedListPopup::updatePageArrows(this, 0, 0);
v9 = *((_QWORD *)this + 93);
v10 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 296LL);
v11 = (float)(*((float *)this + 166) + (float)(*((float *)this + 168) * 0.5)) - 35.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, 1.0, 0.5);
v10(v9, v41);
v12 = *((_QWORD *)this + 93);
v13 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v41,
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) - 16.0,
v11);
v13(v12, v41);
v14 = (float)(*((float *)this + 165) - (float)(*((float *)this + 167) * 0.5)) + 32.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v41, 0.0, 0.0, 40.0, 40.0);
v15 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v41);
v16 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v41, 180.0, 22.0);
v16(v15, v41);
v17 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 960LL);
qmemcpy(v41, "]4", 2);
v41[2] = 31;
v17(v15, v41);
v18 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, v14 + 90.0, v11);
v18(v15, v41);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(*((_QWORD *)this + 73), v15, 1);
v20 = CCTextInputNode::create(
(CCTextInputNode *)"Search backups...",
170.0,
22.0,
"Thonburi",
(const char *)&dword_14,
"bigFont.fnt",
v19);
*((_QWORD *)this + 115) = v20;
LOWORD(v40) = -26986;
BYTE2(v40) = -106;
CCTextInputNode::setLabelPlaceholderColor(v20, v40);
CCTextInputNode::setLabelPlaceholderScale(*((CCTextInputNode **)this + 115), 0.45);
CCTextInputNode::setMaxLabelScale(*((CCTextInputNode **)this + 115), 0.45);
CCTextInputNode::setMaxLabelWidth(*((CCTextInputNode **)this + 115), 160.0);
*(_QWORD *)(*((_QWORD *)this + 115) + 584LL) = (char *)this + 544;
*(_DWORD *)(*((_QWORD *)this + 115) + 592LL) = 60;
v21 = *((_QWORD *)this + 115);
v22 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v21 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, v14 + 90.0, v11 + 1.0);
v22(v21, v41);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 115),
5);
v24 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_longBtn07_001.png", v23);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v24 + 160LL))(v24, 0.45);
v25 = CCMenuItemSpriteExtra::create(v24, 0, (__int64)this, (__int64)AutoBackupPopup::onClearSearch, 0);
*((_QWORD *)this + 116) = v25;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v25);
CCMenuItemSpriteExtra::applyLargeMobileTouch(*((CCMenuItemSpriteExtra **)this + 116));
v26 = *((_QWORD *)this + 116);
v27 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v26 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, (float)(v14 + 180.0) + 14.0, v11);
v27(v26, v41);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 116) + 344LL))(*((_QWORD *)this + 116), 0);
v29 = *((_QWORD *)this + 94);
v30 = (float)(*((float *)this + 166) - (float)(*((float *)this + 168) * 0.5)) + 24.0;
if ( v29 )
{
v31 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v29 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, 1.0, 0.5);
v31(v29, v41);
v32 = *((_QWORD *)this + 94);
v33 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v32 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v41,
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) - 16.0,
v30);
v33(v32, v41);
}
v34 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsBtn_001.png", v28);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v34 + 160LL))(v34, 0.54);
v35 = CCMenuItemSpriteExtra::create(v34, 0, (__int64)this, (__int64)AutoBackupPopup::onSettings, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v35);
v36 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v35 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v41,
(float)(*((float *)this + 165) + (float)(*((float *)this + 167) * 0.5)) - 4.0,
(float)(*((float *)this + 166) + (float)(*((float *)this + 168) * 0.5)) - 8.0);
v36(v35, v41);
v37 = *((_QWORD *)this + 69);
v39 = *((_QWORD *)this + 73);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v41,
(float)(*((float *)this + 165) - (float)(*((float *)this + 167) * 0.5)) + 26.0,
v30);
v38 = (GJSelectionStrip *)GJSelectionStrip::create(
v37,
v39,
(const cocos2d::CCPoint *)v41,
(__int64)this,
(__int64)AutoBackupPopup::onSelectAll,
0,
0.715);
*((_QWORD *)this + 124) = v38;
GJSelectionStrip::addCountLabel(v38, 27.0, 5u);
GJSelectionStrip::addAction(
*((_QWORD *)this + 124),
(cocos2d::CCSprite *)"threadBtn_delete_001.png",
(__int64)AutoBackupPopup::onDeleteSelected,
0,
53.0,
1.2);
AutoBackupPopup::reloadFiles(this);
AutoBackupPopup::buildRows(this);
return inited;
}