//
// sub_1005320C8 from 0x1005320c8 to 0x100532294 (460 bytes)
//
// 1 xrefs:
// > sub_10053053C @ 0x100530a20
//
// 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 11:07:21 +0000
//
void __fastcall sub_1005320C8(__int64 a1, __int64 a2)
{
unsigned int v3; // w0
__int64 v4; // x8
__int64 v5; // x20
std::string *v6; // x0
__int128 v7; // q0
__int64 v8; // x8
__int64 v9; // x8
const std::string::value_type *v10; // x9
const std::string::value_type *v11; // t1
int v12; // w11
const std::string::value_type *v13; // x1
std::string::size_type v14; // x2
std::string *v15; // x0
__int128 v16; // q0
std::string *v17; // x0
void *v18; // x20
void *size; // x21
int v20; // w22
__int64 v21; // x0
void *__p[2]; // [xsp+0h] [xbp-90h] BYREF
_BYTE v23[7]; // [xsp+10h] [xbp-80h]
char v24; // [xsp+17h] [xbp-79h]
std::string v25; // [xsp+18h] [xbp-78h] BYREF
std::string v26; // [xsp+30h] [xbp-60h] BYREF
std::string v27; // [xsp+50h] [xbp-40h] BYREF
_DWORD v28[2]; // [xsp+68h] [xbp-28h]
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( (v3 & 0x80000000) != 0 )
return;
v4 = *(_QWORD *)(a1 + 848);
if ( (int)v3 >= (int)((unsigned __int64)(*(_QWORD *)(a1 + 856) - v4) >> 7) )
return;
*(_DWORD *)(a1 + 936) = v3;
v5 = v3;
std::operator+(&v25, "Delete the backup ", v4 + ((unsigned __int64)v3 << 7) + 48);
v6 = std::string::append(&v25, " from ");
v7 = *(_OWORD *)&v6->__r_.__value_.__l.__data_;
v26.__r_.__value_.__r.__words[2] = v6->__r_.__value_.__r.__words[2];
*(_OWORD *)&v26.__r_.__value_.__l.__data_ = v7;
v6->__r_.__value_.__l.__size_ = 0;
v6->__r_.__value_.__r.__words[2] = 0;
v6->__r_.__value_.__r.__words[0] = 0;
v8 = *(_QWORD *)(a1 + 848) + (v5 << 7);
v11 = *(const std::string::value_type **)(v8 + 72);
v9 = v8 + 72;
v10 = v11;
v12 = *(char *)(v9 + 23);
if ( v12 >= 0 )
v13 = (const std::string::value_type *)v9;
else
v13 = v10;
if ( v12 >= 0 )
v14 = *(unsigned __int8 *)(v9 + 23);
else
v14 = *(_QWORD *)(v9 + 8);
v15 = std::string::append(&v26, v13, v14);
v16 = *(_OWORD *)&v15->__r_.__value_.__l.__data_;
v27.__r_.__value_.__r.__words[2] = v15->__r_.__value_.__r.__words[2];
*(_OWORD *)&v27.__r_.__value_.__l.__data_ = v16;
v15->__r_.__value_.__l.__size_ = 0;
v15->__r_.__value_.__r.__words[2] = 0;
v15->__r_.__value_.__r.__words[0] = 0;
v17 = std::string::append(&v27, "?");
v18 = (void *)v17->__r_.__value_.__r.__words[0];
size = (void *)v17->__r_.__value_.__l.__size_;
v28[0] = v17->__r_.__value_.__r.__words[2];
*(_DWORD *)((char *)v28 + 3) = *(_DWORD *)((char *)&v17->__r_.__value_.__r.__words[2] + 3);
v20 = SHIBYTE(v17->__r_.__value_.__r.__words[2]);
v17->__r_.__value_.__l.__size_ = 0;
v17->__r_.__value_.__r.__words[2] = 0;
v17->__r_.__value_.__r.__words[0] = 0;
if ( SHIBYTE(v27.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v27.__r_.__value_.__l.__data_);
if ( SHIBYTE(v26.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v26.__r_.__value_.__l.__data_);
if ( SHIBYTE(v25.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v25.__r_.__value_.__l.__data_);
if ( (v20 & 0x80000000) == 0 )
goto LABEL_15;
LABEL_17:
sub_1000097D0(__p, v18, (unsigned __int64)size);
goto LABEL_18;
}
if ( v20 < 0 )
goto LABEL_17;
LABEL_15:
__p[0] = v18;
__p[1] = size;
*(_DWORD *)v23 = v28[0];
*(_DWORD *)&v23[3] = *(_DWORD *)((char *)v28 + 3);
v24 = v20;
LABEL_18:
v21 = sub_10034A8F8(a1 + 776, (__int64)"Delete Backup", (__int64)__p, (__int64)"Cancel", (__int64)"Delete");
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 1312LL))(v21);
if ( (v24 & 0x80000000) == 0 )
{
if ( (v20 & 0x80000000) == 0 )
return;
LABEL_22:
operator delete(v18);
return;
}
operator delete(__p[0]);
if ( v20 < 0 )
goto LABEL_22;
}