//
// GJGameLevel::saveNewScore from 0x85f6d8 to 0x85f87c (420 bytes)
//
// 6 xrefs:
// > PlayLayer::levelComplete @ 0x703e6c
// > PlayLayer::levelComplete @ 0x704068
// > PlayLayer::levelComplete @ 0x7040d8
// > GJGameLevel::handleStatsConflict @ 0x85fa60
// > GJGameLevel::handleStatsConflict @ 0x85fac8
// > ??> @ 0x9bfe0
//
// 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:55:35 +0000
//
__int64 __fastcall GJGameLevel::saveNewScore(
GJGameLevel *this,
int a2,
int a3,
int a4,
int a5,
int a6,
_QWORD *a7,
unsigned __int8 a8)
{
int v15; // w1
unsigned int v16; // w23
int v18; // w1
int v19; // w3
int v20; // w0
int v21; // w2
int v22; // w4
const void *v23; // x1
size_t v24; // x2
int v25; // w1
int v26; // w5
int v27; // w6
int v28; // w7
const void *v29; // x1
size_t v30; // x2
if ( a3 )
{
v16 = 0;
if ( a2 )
{
v18 = *((_DWORD *)this + 334);
if ( a8 | (v18 == 0) || a2 > v18 )
{
v19 = *((_DWORD *)this + 325);
v20 = *((_DWORD *)this + 324);
v21 = *((_DWORD *)this + 326);
v22 = *((_DWORD *)this + 327);
*((_DWORD *)this + 334) = a2;
*((_DWORD *)this + 335) = a4;
*((_DWORD *)this + 336) = a5;
*((_DWORD *)this + 337) = a6;
*((_DWORD *)this + 344) = generateBestHash(v20, a2, v21, v19, v22, a5, a4, a6);
if ( a7 != (_QWORD *)((char *)this + 1352) )
{
if ( (*(_BYTE *)a7 & 1) != 0 )
{
v23 = (const void *)a7[2];
v24 = a7[1];
}
else
{
v23 = (char *)a7 + 1;
v24 = *(_BYTE *)a7 >> 1;
}
std::string::assign((__int64 *)this + 169, v23, v24);
}
v16 = 1;
*((_BYTE *)this + 1433) = 1;
}
}
}
else if ( a2 <= 0 )
{
v16 = 0;
}
else
{
v15 = *((_DWORD *)this + 324);
if ( a8 | (v15 == 0) || (v16 = 0, a2 < v15) )
{
v25 = *((_DWORD *)this + 334);
v26 = *((_DWORD *)this + 336);
v27 = *((_DWORD *)this + 335);
v28 = *((_DWORD *)this + 337);
*((_DWORD *)this + 324) = a2;
*((_DWORD *)this + 325) = a4;
*((_DWORD *)this + 326) = a5;
*((_DWORD *)this + 327) = a6;
*((_DWORD *)this + 344) = generateBestHash(a2, v25, a5, a4, a6, v26, v27, v28);
if ( (_QWORD *)((char *)this + 1312) != a7 )
{
if ( (*(_BYTE *)a7 & 1) != 0 )
{
v29 = (const void *)a7[2];
v30 = a7[1];
}
else
{
v29 = (char *)a7 + 1;
v30 = *(_BYTE *)a7 >> 1;
}
std::string::assign((__int64 *)this + 164, v29, v30);
}
v16 = 1;
*((_BYTE *)this + 1432) = 1;
}
}
GJGameLevel::storeNewLocalScore(this, a2, a3);
return v16;
}