//
// GJAccountManager::onGetAccountBackupURLCompleted from 0x1000d16c0 to 0x1000d1887 (455 bytes)
//
// 1 xrefs:
// > GJAccountManager::handleIt @ 0x1000cf7c0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJAccountManager::onGetAccountBackupURLCompleted(GJAccountManager *a1, unsigned __int8 *a2, double a3)
{
const void *v3; // r15
unsigned __int64 v4; // rcx
char *v5; // r14
size_t v6; // rdx
GJAccountBackupDelegate *m_backupDelegate; // rdi
cocos2d::CCString *v8; // rax
const char *CString; // r12
size_t v10; // rax
size_t v11; // r15
char v12; // r15
size_t v13; // r13
char v14; // r14
GJAccountBackupDelegate *v15; // rdi
__int128 v16; // [rsp+0h] [rbp-60h] BYREF
void *__p; // [rsp+10h] [rbp-50h]
__int128 __s2; // [rsp+20h] [rbp-40h] BYREF
void *v19; // [rsp+30h] [rbp-30h]
GJAccountManager::removeDLFromActive(a1, "burl_account");
*(_WORD *)((char *)&__s2 + 1) = 12589;
BYTE3(__s2) = 0;
v3 = a2 + 1;
v4 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
v3 = *((const void **)a2 + 2);
v5 = (char *)&__s2 + 1;
if ( (*a2 & 1) != 0 )
v4 = *((_QWORD *)a2 + 1);
v6 = 2;
if ( v4 < 2 )
v6 = v4;
if ( !((v4 != 2) | (memcmp(v3, (char *)&__s2 + 1, v6) != 0)) )
{
m_backupDelegate = a1->m_backupDelegate;
if ( m_backupDelegate )
((void (__fastcall *)(GJAccountBackupDelegate *, __int64, _QWORD))m_backupDelegate->backupAccountFailed)(
m_backupDelegate,
0xFFFFFFFFLL,
0);
return;
}
v8 = (cocos2d::CCString *)sub_1007AB580("%s/database/accounts/backupGJAccountNew.php", v16);
CString = cocos2d::CCString::getCString(v8);
v10 = strlen(CString);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a3);
v11 = v10;
if ( v10 >= 0x17 )
{
v13 = 26;
if ( (v10 | 7) != 0x17 )
v13 = (v10 | 7) + 1;
v5 = (char *)operator new(v13);
v19 = v5;
*(_QWORD *)&__s2 = v13 + 1;
*((_QWORD *)&__s2 + 1) = v11;
LABEL_18:
memmove(v5, CString, v11);
v5[v11] = 0;
v12 = __s2;
if ( (__s2 & 1) == 0 )
goto LABEL_14;
LABEL_19:
sub_100006B70(&v16, v19, *((unsigned __int64 *)&__s2 + 1), a3);
goto LABEL_20;
}
LOBYTE(__s2) = 2 * v10;
if ( v10 )
goto LABEL_18;
BYTE1(__s2) = 0;
v12 = __s2;
if ( (__s2 & 1) != 0 )
goto LABEL_19;
LABEL_14:
__p = v19;
v16 = __s2;
LABEL_20:
v14 = GJAccountManager::backupAccount(a1, &v16);
if ( (v16 & 1) != 0 )
operator delete(__p);
if ( !v14 )
{
v15 = a1->m_backupDelegate;
if ( v15 )
((void (__fastcall *)(GJAccountBackupDelegate *, __int64, _QWORD))v15->backupAccountFailed)(v15, 0xFFFFFFFFLL, 0);
}
if ( (v12 & 1) != 0 )
operator delete(v19);
}