//
// GJAccountManager::onUpdateAccountSettingsCompleted from 0x847ef4 to 0x84804c (344 bytes)
//
// 2 xrefs:
// > GJAccountManager::handleIt @ 0x8494f4
// > ??> @ 0xb2ed8
//
// 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
//
__int64 __fastcall GJAccountManager::onUpdateAccountSettingsCompleted(GJAccountManager *a1, const void **a2)
{
_DWORD *v4; // x22
unsigned __int64 v5; // x24
unsigned __int64 v6; // x20
size_t v7; // x2
int v8; // w19
__int64 v9; // x20
__int64 *v10; // x0
GJAccountSettingsDelegate *m_accountSettingsDelegate; // x0
unsigned int *v13; // x22
int v14; // w1
void *v15; // [xsp+50h] [xbp+50h] BYREF
GJAccountManager::removeDLFromActive(a1, "acc_sett");
sub_D153B8((int)&v15, "-1");
v4 = v15;
v5 = *((_QWORD *)v15 - 3);
v6 = *((_QWORD *)*a2 - 3);
if ( v5 > v6 )
v7 = *((_QWORD *)*a2 - 3);
else
v7 = *((_QWORD *)v15 - 3);
v8 = memcmp(*a2, v15, v7);
if ( v8 || (v8 = 0x7FFFFFFF, v9 = v6 - v5, v9 > 0x7FFFFFFF) )
{
v10 = (__int64 *)(v4 - 6);
if ( v4 - 6 == (_DWORD *)&qword_124B6B0 )
goto LABEL_7;
}
else
{
v10 = (__int64 *)(v4 - 6);
if ( v9 >= (__int64)0xFFFFFFFF80000000LL )
v8 = v9;
else
v8 = 0x80000000;
if ( v10 == &qword_124B6B0 )
goto LABEL_7;
}
if ( &pthread_create )
{
v13 = v4 - 2;
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *(v4 - 2);
*(v4 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v10);
LABEL_7:
m_accountSettingsDelegate = a1->m_accountSettingsDelegate;
if ( v8 )
{
if ( m_accountSettingsDelegate )
m_accountSettingsDelegate->updateSettingsFinished(m_accountSettingsDelegate);
}
else if ( m_accountSettingsDelegate )
{
m_accountSettingsDelegate->updateSettingsFailed(m_accountSettingsDelegate);
}
return _stack_chk_guard;
}