//
// LeaderboardsLayer::loadLeaderboardFailed from 0x94eb28 to 0x94ed54 (556 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'LeaderboardsLayer::loadLeaderboardFailed @ 0x94ed58
// > ??> @ 0xfd2a0
// > ??> @ 0x146a510
//
// 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 12:57:21 +0000
//
__int64 __fastcall LeaderboardsLayer::loadLeaderboardFailed(LeaderboardsLayer *this, const char *a2)
{
size_t v3; // x0
size_t v4; // x19
const char *v5; // x1
unsigned __int64 v6; // x0
__int64 v7; // x22
char *v8; // x0
char *v9; // x3
_BOOL4 isCorrect; // w19
PlatformToolbox *v12; // x0
int v13; // w0
__int64 *v14; // x19
__int64 *v15; // x19
__int64 *v16; // x19
__int64 v18; // [xsp+50h] [xbp+50h] BYREF
size_t v19; // [xsp+58h] [xbp+58h]
void *v20; // [xsp+60h] [xbp+60h]
v18 = 0;
v19 = 0;
v20 = nullptr;
v3 = strlen(a2);
v4 = v3;
v5 = a2;
if ( v3 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D21C();
if ( v3 > 0x16 )
{
v6 = (v3 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v7 = v6 | 1;
v8 = (char *)operator new(v6);
v18 = v7;
v5 = a2;
v9 = v8;
v20 = v8;
v19 = v4;
LABEL_4:
v9 = (char *)memcpy(v9, v5, v4);
goto LABEL_5;
}
LOBYTE(v18) = 2 * v3;
v9 = (char *)&v18 + 1;
if ( v3 )
goto LABEL_4;
LABEL_5:
v9[v4] = 0;
isCorrect = LeaderboardsLayer::isCorrect((__int64)this, (char *)&v18);
if ( (v18 & 1) != 0 )
{
operator delete(v20);
if ( !isCorrect )
return _stack_chk_guard;
}
else if ( !isCorrect )
{
return _stack_chk_guard;
}
v12 = (PlatformToolbox *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 60) + 344LL))(
*((_QWORD *)this + 60),
0);
if ( PlatformToolbox::isNetworkAvailable(v12) )
{
v13 = *((_DWORD *)this + 110);
if ( v13 == 4 )
{
v16 = *((__int64 **)this + 61);
v18 = 0;
v19 = 0;
v20 = nullptr;
std::string::__init(&v18, "Create an account to\ncompare scores\nwith Friends!", 0x41u);
TextArea::setString(v16, (char *)&v18);
}
else
{
if ( v13 != 2 )
return _stack_chk_guard;
v14 = *((__int64 **)this + 61);
v18 = 0;
v19 = 0;
v20 = nullptr;
std::string::__init(&v18, "Create an account to\ncompare scores\n Online!", 0x3Cu);
TextArea::setString(v14, (char *)&v18);
}
}
else
{
v15 = *((__int64 **)this + 61);
v18 = 0;
v19 = 0;
v20 = nullptr;
std::string::__init(&v18, "No Internet connection!", 0x1Fu);
TextArea::setString(v15, (char *)&v18);
}
if ( (v18 & 1) != 0 )
operator delete(v20);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 61) + 344LL))(*((_QWORD *)this + 61), 1);
return _stack_chk_guard;
}