//
// GJBaseGameLayer::getRecordString from 0x5be560 to 0x5beacc (1388 bytes)
//
// 3 xrefs:
// > PlayLayer::writePersistentSave @ 0x4078c4
// > PlayLayer::levelComplete @ 0x407e44
// > PlayLayer::levelComplete @ 0x407f06
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:53:46 +0000
//
GJBaseGameLayer *__fastcall GJBaseGameLayer::getRecordString(GJBaseGameLayer *this, int a2, int a3)
{
size_t v4; // r2
int i; // r2
int v6; // r5
int v7; // r4
size_t v8; // r2
int PlayerButtonID; // r5
unsigned int v10; // r9
unsigned int v11; // r4
unsigned int v12; // r8
int v13; // r11
unsigned __int8 **v14; // r3
unsigned __int8 *j; // r7
unsigned int v16; // r0
int v17; // r1
unsigned int *v18; // r0
unsigned int *v19; // r8
const char *v20; // r1
cocos2d::CCString *v21; // r0
const char *CString; // r11
size_t v23; // r0
unsigned int *v24; // r0
unsigned int *v25; // r0
unsigned int *v26; // r0
unsigned int *v27; // r0
unsigned int *v28; // r0
unsigned int *v29; // r0
unsigned int *v30; // r0
unsigned int *v31; // r0
unsigned int *v32; // r0
unsigned int *v33; // r0
unsigned int *v34; // r0
unsigned int *v35; // r0
unsigned int *v36; // r0
unsigned int *v37; // r0
unsigned int *v38; // r0
unsigned int *v39; // r0
unsigned int *v40; // r0
unsigned int *v41; // r4
const char *v42; // r1
cocos2d::CCString *v43; // r0
size_t v44; // r0
unsigned int *v45; // r0
unsigned int *v46; // r0
unsigned int *v47; // r5
unsigned int *v48; // r0
const char *v49; // r5
size_t v50; // r0
char *v51; // r1
size_t v52; // r8
int v53; // r5
unsigned int v54; // r3
char *v55; // r9
size_t v56; // r5
int v57; // r3
size_t v58; // r1
char *v59; // r2
int v60; // r1
char *v61; // r2
unsigned int v64; // [sp+18h] [bp-284h]
const char *v66; // [sp+3Ch] [bp-260h]
const char *v67; // [sp+54h] [bp-248h] BYREF
size_t v68; // [sp+58h] [bp-244h]
const char *v69; // [sp+5Ch] [bp-240h]
size_t v70; // [sp+60h] [bp-23Ch]
int v71[3]; // [sp+64h] [bp-238h] BYREF
int v72[3]; // [sp+70h] [bp-22Ch] BYREF
int v73; // [sp+7Ch] [bp-220h] BYREF
int v74; // [sp+80h] [bp-21Ch]
char *v75; // [sp+84h] [bp-218h]
int v76; // [sp+88h] [bp-214h] BYREF
size_t v77; // [sp+8Ch] [bp-210h]
char *v78; // [sp+90h] [bp-20Ch]
unsigned int v79[3]; // [sp+94h] [bp-208h] BYREF
char v80; // [sp+A0h] [bp-1FCh] BYREF
v4 = *(unsigned __int8 *)(a2 + 10936);
if ( *(_BYTE *)(a2 + 10936) )
{
v64 = 0;
v79[0] = 0;
v79[1] = 500;
v79[2] = (unsigned int)&v80;
for ( i = 1; ; i = 0 )
{
v6 = *(_DWORD *)(a2 + 11012);
if ( v64 >= (*(_DWORD *)(a2 + 11016) - v6) >> 4 )
break;
v7 = v6 + 16 * v64;
if ( !i )
{
v69 = ";";
v70 = 0;
fmt::BasicWriter::operator<<(v79, ";", 0);
}
v8 = *(unsigned __int8 *)(v7 + 4);
if ( !*(_BYTE *)(v7 + 4) )
{
v69 = "-";
v70 = v8;
fmt::BasicWriter::operator<<(v79, "-", v8);
}
fmt::BasicWriter::operator<<(v79, *(_DWORD *)(v7 + 8));
PlayerButtonID = GJBaseGameLayer::getPlayerButtonID(
(GJBaseGameLayer *)a2,
*(_DWORD *)(v6 + 16 * v64),
*(unsigned __int8 *)(v7 + 5));
if ( PlayerButtonID != 1 )
{
v69 = ",";
v70 = 0;
fmt::BasicWriter::operator<<(v79, ",", 0);
fmt::BasicWriter::operator<<(v79, PlayerButtonID);
}
if ( (unsigned int)(PlayerButtonID - 98) <= 1 )
{
v10 = *(_DWORD *)(v7 + 12);
v11 = *(_DWORD *)(a2 + 11028);
if ( v11 )
{
v12 = v11 - 1;
v13 = ((v11 - 1) & v11) != 0 ? v10 % v11 : v10 & v12;
v14 = *(unsigned __int8 ***)(*(_DWORD *)(a2 + 11024) + 4 * v13);
if ( v14 )
{
for ( j = *v14; j; j = *(unsigned __int8 **)j )
{
v16 = *((_DWORD *)j + 1);
v17 = ((v11 - 1) & v11) != 0 ? v16 % v11 : v12 & v16;
if ( v17 != v13 )
break;
if ( *((_DWORD *)j + 2) == v10 )
{
v70 = 0;
v69 = ":";
fmt::BasicWriter::operator<<(v79, ":", 0);
v18 = fmt::BasicWriter::operator<<(v79, (const char *)a1i2r3e45s789g, 0);
v19 = fmt::BasicWriter::operator<<(v18, ",", 0);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%llu",
v20,
*((_DWORD *)j + 6),
*((_DWORD *)j + 7));
CString = (const char *)cocos2d::CCString::getCString(v21);
memset(v71, 0, sizeof(v71));
v23 = strlen(CString);
std::string::__init(v71, CString, v23);
fmt::BasicStringRef::BasicStringRef((unsigned __int8 **)&v67, (unsigned __int8 *)v71);
v24 = fmt::BasicWriter::operator<<(v19, v67, v68);
v69 = ",";
v70 = 0;
fmt::BasicWriter::operator<<(v24, ",", 0);
std::string::~string((int)v71);
v25 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[2], 0);
v67 = ",";
v68 = 0;
v26 = fmt::BasicWriter::operator<<(v25, ",", 0);
v27 = fmt::BasicWriter::operator<<(v26, *((_DWORD *)j + 4));
v70 = 0;
v69 = ",";
fmt::BasicWriter::operator<<(v27, ",", 0);
v28 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[4], 0);
v68 = 0;
v67 = ",";
v29 = fmt::BasicWriter::operator<<(v28, ",", 0);
v30 = fmt::BasicWriter::operator<<(v29, *((_DWORD *)j + 8));
v70 = 0;
v69 = ",";
fmt::BasicWriter::operator<<(v30, ",", 0);
v31 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[6], 0);
v68 = 0;
v67 = ",";
v32 = fmt::BasicWriter::operator<<(v31, ",", 0);
v33 = fmt::BasicWriter::operator<<(v32, *((_DWORD *)j + 9));
v70 = 0;
v69 = ",";
fmt::BasicWriter::operator<<(v33, ",", 0);
v34 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[7], 0);
v68 = 0;
v67 = ",";
v35 = fmt::BasicWriter::operator<<(v34, ",", 0);
v36 = fmt::BasicWriter::operator<<(v35, *((_DWORD *)j + 12));
v70 = 0;
v69 = ",";
fmt::BasicWriter::operator<<(v36, ",", 0);
v37 = fmt::BasicWriter::operator<<(v79, "6", 0);
v67 = ",";
v68 = 0;
v38 = fmt::BasicWriter::operator<<(v37, ",", 0);
v39 = fmt::BasicWriter::operator<<(v38, *((_DWORD *)j + 13));
v69 = ",";
v70 = 0;
fmt::BasicWriter::operator<<(v39, ",", 0);
v40 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[9], 0);
v41 = fmt::BasicWriter::operator<<(v40, ",", 0);
v43 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%llu",
v42,
*((_DWORD *)j + 10),
*((_DWORD *)j + 11));
v66 = (const char *)cocos2d::CCString::getCString(v43);
memset(v72, 0, sizeof(v72));
v44 = strlen(v66);
std::string::__init(v72, v66, v44);
fmt::BasicStringRef::BasicStringRef((unsigned __int8 **)&v67, (unsigned __int8 *)v72);
v45 = fmt::BasicWriter::operator<<(v41, v67, v68);
v69 = ",";
v70 = 0;
fmt::BasicWriter::operator<<(v45, ",", 0);
std::string::~string((int)v72);
v46 = fmt::BasicWriter::operator<<(v79, (const char *)&a1i2r3e45s789g[10], 0);
v47 = fmt::BasicWriter::operator<<(v46, ",", 0);
fmt::BasicStringRef::BasicStringRef((unsigned __int8 **)&v67, j + 56);
v48 = fmt::BasicWriter::operator<<(v47, v67, v68);
v70 = 0;
v69 = ",";
fmt::BasicWriter::operator<<(v48, ",", 0);
break;
}
}
}
}
}
++v64;
}
v49 = (const char *)fmt::BasicWriter::c_str((int *)v79);
v73 = 0;
v74 = 0;
v75 = nullptr;
v50 = strlen(v49);
std::string::__init(&v73, v49, v50);
GJBaseGameLayer::getRecordExtra((GJBaseGameLayer *)&v76, a2);
if ( (v76 & 1) != 0 )
{
v51 = v78;
v52 = v77;
}
else
{
v52 = (int)(unsigned __int8)v76 >> 1;
v51 = (char *)&v76 + 1;
}
if ( (v73 & 1) != 0 )
{
v53 = v74;
v54 = (v73 & 0xFFFFFFFE) - 1;
}
else
{
v53 = (int)(unsigned __int8)v73 >> 1;
v54 = 10;
}
if ( v54 - v53 < v52 )
{
std::string::__grow_by_and_replace((int)&v73, v54, v53 + v52 - v54, v53, v53, 0, v52, v51);
}
else if ( v52 )
{
if ( (v73 & 1) != 0 )
v55 = v75;
else
v55 = (char *)&v73 + 1;
std::char_traits::copy(&v55[v53], v51, v52);
v56 = v53 + v52;
if ( (v73 & 1) != 0 )
v74 = v56;
else
LOBYTE(v73) = 2 * v56;
v55[v56] = 0;
}
std::string::~string((int)&v76);
if ( a3 && ((v73 & 1) != 0 ? (v57 = v74) : (v57 = (int)(unsigned __int8)v73 >> 1), v57) )
{
cocos2d::ZipUtils::compressString(&v76, &v73, 0, -1, 11);
v58 = v77;
v59 = v78;
*(_DWORD *)this = v76;
*((_DWORD *)this + 1) = v58;
*((_DWORD *)this + 2) = v59;
v76 = 0;
v77 = 0;
v78 = nullptr;
std::string::~string((int)&v76);
}
else
{
v60 = v74;
v61 = v75;
*(_DWORD *)this = v73;
*((_DWORD *)this + 1) = v60;
*((_DWORD *)this + 2) = v61;
v73 = 0;
v74 = 0;
v75 = nullptr;
}
std::string::~string((int)&v73);
fmt::internal::Array::free((int)v79);
}
else
{
*(_DWORD *)this = v4;
*((_DWORD *)this + 1) = v4;
*((_DWORD *)this + 2) = v4;
std::string::__init((int *)this, &unk_B6B226, v4);
}
return this;
}