//
// GJGameLevel::handleStatsConflict from 0x85f87c to 0x86016c (2288 bytes)
//
// 6 xrefs:
// > GameLevelManager::dataLoaded @ 0x860254
// > GameLevelManager::dataLoaded @ 0x860354
// > GameLevelManager::dataLoaded @ 0x8604b0
// > GameLevelManager::dataLoaded @ 0x8605e4
// > LocalLevelManager::dataLoaded @ 0x914bf8
// > ??> @ 0x102da8
//
// 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:36 +0000
//
__int64 __fastcall GJGameLevel::handleStatsConflict(GJGameLevel *this, GJGameLevel *a2)
{
int v4; // w21
int v5; // w0
__int64 v6; // x0
int v7; // w0
int v8; // w1
float v9; // s0
int v10; // w21
int v11; // w0
int v12; // w1
float v13; // s0
int v14; // w21
int v15; // w1
int NormalPercent; // w21
int v17; // w1
int v18; // w21
int v19; // w0
int v20; // w24
int v21; // w1
int v22; // w24
float v23; // s0
int v24; // w25
int v25; // w21
int v26; // w3
int v27; // w4
int v28; // w5
__int64 v29; // x0
size_t v30; // x1
int v31; // w25
char v32; // w0
int v33; // w25
int v34; // w3
int v35; // w4
int v36; // w5
__int64 v37; // x0
size_t v38; // x1
int v39; // w25
int v40; // w0
int v41; // w2
int v42; // w1
int v43; // w0
int v44; // w0
int v45; // w1
__int64 *v46; // x0
__int64 *v47; // x0
__int64 *v48; // x0
__int64 *v49; // x0
__int64 *v50; // x0
__int64 *v51; // x0
__int64 *v52; // x0
__int64 v53; // x2
unsigned __int8 v54; // w2
__int64 v55; // x1
__int64 *v56; // x0
__int64 v57; // x2
unsigned __int8 v58; // w2
__int64 v59; // x1
__int64 *v60; // x0
__int64 v61; // x2
unsigned __int8 v62; // w2
__int64 v63; // x1
__int64 v64; // x1
unsigned __int8 v65; // w21
__int64 v66; // x0
int v68; // w25
char *v69; // x1
size_t v70; // x2
char *v71; // x1
size_t v72; // x2
float v73; // s0
int v74; // w21
float v75; // s0
int v76; // w21
int v77; // w0
float v78; // s8
__int64 v79; // x0
size_t v80; // x1
__int64 *v81; // x0
char *v82; // x1
size_t v83; // x2
int v84; // [xsp+68h] [xbp+68h]
int v85; // [xsp+68h] [xbp+68h]
int v86; // [xsp+70h] [xbp+70h]
int v87; // [xsp+70h] [xbp+70h]
int v88; // [xsp+78h] [xbp+78h]
int v89; // [xsp+78h] [xbp+78h]
__int64 v90; // [xsp+80h] [xbp+80h] BYREF
size_t v91; // [xsp+88h] [xbp+88h]
void *v92; // [xsp+90h] [xbp+90h]
__int64 v93; // [xsp+98h] [xbp+98h]
v4 = *((_DWORD *)a2 + 199) - *((_DWORD *)a2 + 200);
v5 = *((_DWORD *)this + 199) - *((_DWORD *)this + 200);
if ( v5 >= v4 )
v4 = v5;
v6 = _stack_chk_guard;
*((_DWORD *)this + 201) = v4;
v93 = v6;
v7 = rand();
v8 = *((_DWORD *)this + 202) - *((_DWORD *)this + 203);
v9 = (float)((float)v7 * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 200) = (int)v9;
*((_DWORD *)this + 199) = (int)v9 + v4;
v10 = *((_DWORD *)a2 + 202) - *((_DWORD *)a2 + 203);
if ( v8 >= v10 )
v10 = v8;
*((_DWORD *)this + 204) = v10;
v11 = rand();
v12 = *((_DWORD *)this + 205) - *((_DWORD *)this + 206);
v13 = (float)((float)v11 * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 203) = (int)v13;
*((_DWORD *)this + 202) = (int)v13 + v10;
v14 = *((_DWORD *)a2 + 205) - *((_DWORD *)a2 + 206);
if ( v12 >= v14 )
v14 = v12;
*((_DWORD *)this + 207) = v14;
v15 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
*((_DWORD *)this + 206) = v15;
*((_DWORD *)this + 205) = v15 + v14;
NormalPercent = GJGameLevel::getNormalPercent(this);
if ( NormalPercent >= (int)GJGameLevel::getNormalPercent(a2) )
v17 = GJGameLevel::getNormalPercent(this);
else
v17 = GJGameLevel::getNormalPercent(a2);
GJGameLevel::setNormalPercent(this, v17);
v18 = *((_DWORD *)this + 216) - *((_DWORD *)this + 217);
if ( v18 < *((_DWORD *)a2 + 216) - *((_DWORD *)a2 + 217) )
v18 = *((_DWORD *)a2 + 216) - *((_DWORD *)a2 + 217);
*((_DWORD *)this + 218) = v18;
v19 = rand();
v20 = *((_DWORD *)this + 219);
v21 = *((_DWORD *)this + 220);
v90 = 0;
v22 = v20 - v21;
v91 = 0;
v92 = nullptr;
v23 = (float)((float)v19 * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 217) = (int)v23;
*((_DWORD *)this + 216) = (int)v23 + v18;
v24 = *((_DWORD *)a2 + 324);
v25 = *((_DWORD *)a2 + 219) - *((_DWORD *)a2 + 220);
v26 = *((_DWORD *)a2 + 325);
v27 = *((_DWORD *)a2 + 326);
v28 = *((_DWORD *)a2 + 327);
if ( (*((_BYTE *)a2 + 1312) & 1) != 0 )
{
v84 = *((_DWORD *)a2 + 327);
v86 = *((_DWORD *)a2 + 326);
v88 = *((_DWORD *)a2 + 325);
std::string::__init(&v90, *((void **)a2 + 166), *((_QWORD *)a2 + 165));
v28 = v84;
v27 = v86;
v26 = v88;
}
else
{
v29 = *((_QWORD *)a2 + 164);
v30 = *((_QWORD *)a2 + 165);
v92 = *((void **)a2 + 166);
v90 = v29;
v91 = v30;
}
v31 = (unsigned __int8)GJGameLevel::saveNewScore(this, v24, 0, v26, v27, v28, &v90, 0);
if ( (v90 & 1) != 0 )
operator delete(v92);
if ( v31 )
*((_BYTE *)this + 1432) = *((_BYTE *)a2 + 1432);
v32 = *((_BYTE *)a2 + 1352);
v90 = 0;
v91 = 0;
v92 = nullptr;
v33 = *((_DWORD *)a2 + 334);
v34 = *((_DWORD *)a2 + 335);
v35 = *((_DWORD *)a2 + 336);
v36 = *((_DWORD *)a2 + 337);
if ( (v32 & 1) != 0 )
{
v85 = *((_DWORD *)a2 + 337);
v87 = *((_DWORD *)a2 + 336);
v89 = *((_DWORD *)a2 + 335);
std::string::__init(&v90, *((void **)a2 + 171), *((_QWORD *)a2 + 170));
v36 = v85;
v35 = v87;
v34 = v89;
}
else
{
v37 = *((_QWORD *)a2 + 169);
v38 = *((_QWORD *)a2 + 170);
v92 = *((void **)a2 + 171);
v90 = v37;
v91 = v38;
}
v39 = (unsigned __int8)GJGameLevel::saveNewScore(this, v33, 1, v34, v35, v36, &v90, 0);
if ( (v90 & 1) != 0 )
operator delete(v92);
if ( v39 )
*((_BYTE *)this + 1433) = *((_BYTE *)a2 + 1433);
if ( v22 < v25 )
{
*((_DWORD *)this + 221) = v25;
v73 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 220) = (int)v73;
*((_DWORD *)this + 219) = v25 + (int)v73;
v74 = *((_DWORD *)a2 + 205) - *((_DWORD *)a2 + 206);
*((_DWORD *)this + 207) = v74;
v75 = (float)((float)rand() * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 206) = (int)v75;
*((_DWORD *)this + 205) = v74 + (int)v75;
v76 = *((_DWORD *)a2 + 208) - *((_DWORD *)a2 + 209);
*((_DWORD *)this + 210) = v76;
v77 = rand();
v90 = 0;
v91 = 0;
v92 = nullptr;
v78 = (float)((float)v77 * 4.6566e-10) * 1000.0;
*((_DWORD *)this + 209) = (int)v78;
*((_DWORD *)this + 208) = v76 + (int)v78;
*((_DWORD *)this + 211) = *((_DWORD *)a2 + 211);
if ( (*((_BYTE *)a2 + 1208) & 1) != 0 )
{
std::string::__init(&v90, *((void **)a2 + 153), *((_QWORD *)a2 + 152));
}
else
{
v79 = *((_QWORD *)a2 + 151);
v80 = *((_QWORD *)a2 + 152);
v92 = *((void **)a2 + 153);
v90 = v79;
v91 = v80;
}
v81 = (__int64 *)((char *)this + 1208);
if ( (__int64 *)((char *)this + 1208) != &v90 )
{
if ( (v90 & 1) != 0 )
std::string::assign(v81, v92, v91);
else
std::string::assign(v81, (char *)&v90 + 1, (unsigned __int8)v90 >> 1);
}
if ( (v90 & 1) != 0 )
operator delete(v92);
*((_BYTE *)this + 848) = *((_BYTE *)a2 + 848);
}
v40 = *((_DWORD *)a2 + 222);
v41 = *((_DWORD *)this + 383);
v42 = *((_DWORD *)this + 158);
if ( v40 < *((_DWORD *)this + 222) )
v40 = *((_DWORD *)this + 222);
*((_DWORD *)this + 222) = v40;
v43 = *((_DWORD *)a2 + 383);
if ( v43 < v41 )
v43 = v41;
*((_DWORD *)this + 383) = v43;
v44 = *((_DWORD *)a2 + 158);
if ( v44 < v42 )
v44 = v42;
*((_DWORD *)this + 158) = v44;
if ( *((_BYTE *)a2 + 912) )
*((_BYTE *)this + 912) = 1;
v45 = *((_DWORD *)a2 + 384);
if ( v45 > 0 )
{
if ( *((_DWORD *)this + 384) )
{
if ( *((_DWORD *)a2 + 411) <= *((_DWORD *)this + 411) )
goto LABEL_53;
v46 = (__int64 *)((char *)this + 1544);
*((_DWORD *)this + 384) = v45;
if ( (char *)this + 1544 == (char *)a2 + 1544 )
goto LABEL_37;
}
else
{
v46 = (__int64 *)((char *)this + 1544);
*((_DWORD *)this + 384) = v45;
if ( (char *)this + 1544 == (char *)a2 + 1544 )
{
LABEL_37:
v47 = (__int64 *)((char *)this + 1568);
if ( (char *)this + 1568 != (char *)a2 + 1568 )
{
if ( (*((_BYTE *)a2 + 1568) & 1) != 0 )
std::string::assign(v47, *((const void **)a2 + 198), *((_QWORD *)a2 + 197));
else
std::string::assign(v47, (char *)a2 + 1569, *((_BYTE *)a2 + 1568) >> 1);
}
v48 = (__int64 *)((char *)this + 1592);
if ( (char *)this + 1592 != (char *)a2 + 1592 )
{
if ( (*((_BYTE *)a2 + 1592) & 1) != 0 )
std::string::assign(v48, *((const void **)a2 + 201), *((_QWORD *)a2 + 200));
else
std::string::assign(v48, (char *)a2 + 1593, *((_BYTE *)a2 + 1592) >> 1);
}
v49 = (__int64 *)((char *)this + 1616);
if ( (char *)this + 1616 != (char *)a2 + 1616 )
{
if ( (*((_BYTE *)a2 + 1616) & 1) != 0 )
std::string::assign(v49, *((const void **)a2 + 204), *((_QWORD *)a2 + 203));
else
std::string::assign(v49, (char *)a2 + 1617, *((_BYTE *)a2 + 1616) >> 1);
}
v50 = (__int64 *)((char *)this + 1664);
*((_DWORD *)this + 410) = *((_DWORD *)a2 + 410);
*((_DWORD *)this + 411) = *((_DWORD *)a2 + 411);
*((_DWORD *)this + 412) = *((_DWORD *)a2 + 412);
*((_DWORD *)this + 413) = *((_DWORD *)a2 + 413);
*((_DWORD *)this + 414) = *((_DWORD *)a2 + 414);
if ( (char *)this + 1664 != (char *)a2 + 1664 )
{
if ( (*((_BYTE *)a2 + 1664) & 1) != 0 )
std::string::assign(v50, *((const void **)a2 + 210), *((_QWORD *)a2 + 209));
else
std::string::assign(v50, (char *)a2 + 1665, *((_BYTE *)a2 + 1664) >> 1);
}
v51 = (__int64 *)((char *)this + 1688);
if ( (char *)this + 1688 != (char *)a2 + 1688 )
{
if ( (*((_BYTE *)a2 + 1688) & 1) != 0 )
std::string::assign(v51, *((const void **)a2 + 213), *((_QWORD *)a2 + 212));
else
std::string::assign(v51, (char *)a2 + 1689, *((_BYTE *)a2 + 1688) >> 1);
}
*((_BYTE *)this + 1712) = *((_BYTE *)a2 + 1712);
if ( *((_DWORD *)a2 + 197) == *((_DWORD *)this + 197)
&& (*((_DWORD *)this + 285) != 2 || sub_7FEA60((__int64)this + 392, (__int64)a2 + 392)) )
{
if ( (char *)this + 1720 != (char *)a2 + 1720 )
{
if ( (*((_BYTE *)a2 + 1720) & 1) != 0 )
{
v82 = *((char **)a2 + 217);
v83 = *((_QWORD *)a2 + 216);
}
else
{
v82 = (char *)a2 + 1721;
v83 = *((_BYTE *)a2 + 1720) >> 1;
}
std::string::assign((__int64 *)this + 215, v82, v83);
}
*((_BYTE *)this + 1744) = *((_BYTE *)a2 + 1744);
}
goto LABEL_53;
}
}
if ( (*((_BYTE *)a2 + 1544) & 1) != 0 )
std::string::assign(v46, *((const void **)a2 + 195), *((_QWORD *)a2 + 194));
else
std::string::assign(v46, (char *)a2 + 1545, *((_BYTE *)a2 + 1544) >> 1);
goto LABEL_37;
}
LABEL_53:
v52 = (__int64 *)((char *)this + 1760);
v53 = *((_BYTE *)this + 1760) >> 1;
if ( (*((_BYTE *)this + 1760) & 1) != 0 )
v53 = *((_QWORD *)this + 221);
if ( !v53 )
{
v54 = *((_BYTE *)a2 + 1760);
v55 = v54 >> 1;
if ( (v54 & 1) != 0 )
v55 = *((_QWORD *)a2 + 221);
if ( v55 )
{
if ( v52 != (__int64 *)((char *)a2 + 1760) )
{
if ( (*((_BYTE *)a2 + 1760) & 1) != 0 )
std::string::assign(v52, *((const void **)a2 + 222), *((_QWORD *)a2 + 221));
else
std::string::assign(v52, (char *)a2 + 1761, v54 >> 1);
}
*((_DWORD *)this + 438) = *((_DWORD *)a2 + 438);
*((_DWORD *)this + 439) = *((_DWORD *)a2 + 439);
}
}
v56 = (__int64 *)((char *)this + 1816);
v57 = *((_BYTE *)this + 1816) >> 1;
if ( (*((_BYTE *)this + 1816) & 1) != 0 )
v57 = *((_QWORD *)this + 228);
if ( !v57 )
{
v58 = *((_BYTE *)a2 + 1816);
v59 = v58 >> 1;
if ( (v58 & 1) != 0 )
v59 = *((_QWORD *)a2 + 228);
if ( v59 )
{
if ( v56 != (__int64 *)((char *)a2 + 1816) )
{
if ( (*((_BYTE *)a2 + 1816) & 1) != 0 )
std::string::assign(v56, *((const void **)a2 + 229), *((_QWORD *)a2 + 228));
else
std::string::assign(v56, (char *)a2 + 1817, v58 >> 1);
}
*((_DWORD *)this + 460) = *((_DWORD *)a2 + 460);
*((_BYTE *)this + 1844) = *((_BYTE *)a2 + 1844);
*((_DWORD *)this + 462) = *((_DWORD *)a2 + 462);
}
}
v60 = (__int64 *)((char *)this + 1784);
v61 = *((_BYTE *)this + 1784) >> 1;
if ( (*((_BYTE *)this + 1784) & 1) != 0 )
v61 = *((_QWORD *)this + 224);
if ( !v61 )
{
v62 = *((_BYTE *)a2 + 1784);
v63 = v62 >> 1;
if ( (v62 & 1) != 0 )
v63 = *((_QWORD *)a2 + 224);
if ( v63 )
{
if ( v60 != (__int64 *)((char *)a2 + 1784) )
{
if ( (*((_BYTE *)a2 + 1784) & 1) != 0 )
std::string::assign(v60, *((const void **)a2 + 225), *((_QWORD *)a2 + 224));
else
std::string::assign(v60, (char *)a2 + 1785, v62 >> 1);
}
*((_DWORD *)this + 452) = *((_DWORD *)a2 + 452);
}
}
v64 = *((_BYTE *)this + 1472) >> 1;
if ( (*((_BYTE *)this + 1472) & 1) != 0 )
v64 = *((_QWORD *)this + 185);
if ( !v64 )
{
v65 = *((_BYTE *)a2 + 1472);
v66 = v65 >> 1;
if ( (v65 & 1) != 0 )
v66 = *((_QWORD *)a2 + 185);
if ( v66 )
{
v68 = *((_DWORD *)a2 + 380);
if ( v68 == *((_DWORD *)this + 197)
&& (*((_DWORD *)this + 285) != 2 || sub_7FEA60((__int64)this + 392, (__int64)a2 + 392)) )
{
if ( (char *)this + 1472 != (char *)a2 + 1472 )
{
if ( (v65 & 1) != 0 )
{
v69 = *((char **)a2 + 186);
v70 = *((_QWORD *)a2 + 185);
}
else
{
v69 = (char *)a2 + 1473;
v70 = v65 >> 1;
}
std::string::assign((__int64 *)this + 184, v69, v70);
v68 = *((_DWORD *)a2 + 380);
}
*((_DWORD *)this + 380) = v68;
*((_DWORD *)this + 381) = *((_DWORD *)a2 + 381);
if ( (char *)this + 1496 != (char *)a2 + 1496 )
{
if ( (*((_BYTE *)a2 + 1496) & 1) != 0 )
{
v71 = *((char **)a2 + 189);
v72 = *((_QWORD *)a2 + 188);
}
else
{
v71 = (char *)a2 + 1497;
v72 = *((_BYTE *)a2 + 1496) >> 1;
}
std::string::assign((__int64 *)this + 187, v71, v72);
}
*((_BYTE *)this + 769) = *((_BYTE *)a2 + 769);
}
}
}
return _stack_chk_guard;
}