//
// GJBaseGameLayer::getRecordString from 0x14023a2f0 to 0x14023acfe (2574 bytes)
//
// 3 xrefs:
// > PlayLayer::levelComplete @ 0x1403a80e9
// > PlayLayer::levelComplete @ 0x1403a8190
// > ??> @ 0x1406ce1f0
//
// 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
//
// Hidden C++ exception states: #wind=5
_OWORD *__fastcall GJBaseGameLayer::getRecordString(__int64 a1, __int64 a2)
{
_OWORD *v2; // rsi
char v4; // dl
int v5; // r12d
__int64 v6; // r14
__int64 v7; // r15
unsigned int v8; // ebx
unsigned int v9; // ebx
unsigned int v10; // ebx
unsigned int v11; // ebx
unsigned int v12; // ebx
unsigned int v13; // ebx
unsigned int v14; // ebx
__int64 v15; // rax
__int64 v16; // rbx
__int64 v17; // rdx
__int64 v18; // rcx
int v19; // eax
_QWORD *v20; // rax
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rax
__int64 v34; // rax
__int64 v35; // rax
__int64 v36; // rax
__int64 v37; // rax
__int64 v38; // rax
_QWORD *v39; // rax
__int64 v40; // rax
__int64 v41; // rax
__int64 v42; // rax
__int64 v43; // rax
__int64 v44; // rax
__int64 v45; // rax
_BYTE *v46; // rax
size_t v47; // rbx
size_t v48; // r8
const char *v49; // rax
const char *v50; // rdx
const char *v51; // rcx
cocos2d::CCString *v52; // rax
const char *CString; // rax
void **v54; // rdx
void *v55; // rcx
void *v56; // rcx
__int128 v58; // [rsp+40h] [rbp-C0h] BYREF
__int128 v59; // [rsp+50h] [rbp-B0h] BYREF
__int128 v60; // [rsp+60h] [rbp-A0h] BYREF
__int128 v61; // [rsp+70h] [rbp-90h] BYREF
_OWORD *v62; // [rsp+88h] [rbp-78h]
const char *v63; // [rsp+90h] [rbp-70h]
__int64 v64; // [rsp+98h] [rbp-68h]
const char *v65; // [rsp+A0h] [rbp-60h]
__int64 v66; // [rsp+A8h] [rbp-58h]
__int16 *v67; // [rsp+B0h] [rbp-50h]
__int64 v68; // [rsp+B8h] [rbp-48h]
const char *v69; // [rsp+C0h] [rbp-40h]
__int64 v70; // [rsp+C8h] [rbp-38h]
const char *v71; // [rsp+D0h] [rbp-30h]
__int64 v72; // [rsp+D8h] [rbp-28h]
__int16 *v73; // [rsp+E0h] [rbp-20h]
__int64 v74; // [rsp+E8h] [rbp-18h]
const char *v75; // [rsp+F0h] [rbp-10h]
__int64 v76; // [rsp+F8h] [rbp-8h]
const char *v77; // [rsp+100h] [rbp+0h]
__int64 v78; // [rsp+108h] [rbp+8h]
__int16 *v79; // [rsp+110h] [rbp+10h]
__int64 v80; // [rsp+118h] [rbp+18h]
const char *v81; // [rsp+120h] [rbp+20h]
__int64 v82; // [rsp+128h] [rbp+28h]
const char *v83; // [rsp+130h] [rbp+30h]
__int64 v84; // [rsp+138h] [rbp+38h]
__int16 *v85; // [rsp+140h] [rbp+40h]
__int64 v86; // [rsp+148h] [rbp+48h]
const char *v87; // [rsp+150h] [rbp+50h]
__int64 v88; // [rsp+158h] [rbp+58h]
const char *v89; // [rsp+160h] [rbp+60h]
__int64 v90; // [rsp+168h] [rbp+68h]
__int16 *v91; // [rsp+170h] [rbp+70h]
__int64 v92; // [rsp+178h] [rbp+78h]
const char *v93; // [rsp+180h] [rbp+80h]
__int64 v94; // [rsp+188h] [rbp+88h]
const char *v95; // [rsp+190h] [rbp+90h]
__int64 v96; // [rsp+198h] [rbp+98h]
const char *v97; // [rsp+1A0h] [rbp+A0h]
__int64 v98; // [rsp+1A8h] [rbp+A8h]
const char *v99; // [rsp+1B0h] [rbp+B0h]
__int64 v100; // [rsp+1B8h] [rbp+B8h]
const char *v101; // [rsp+1C0h] [rbp+C0h]
__int64 v102; // [rsp+1C8h] [rbp+C8h]
__int16 *v103; // [rsp+1D0h] [rbp+D0h]
__int64 v104; // [rsp+1D8h] [rbp+D8h]
const char *v105; // [rsp+1E0h] [rbp+E0h]
__int64 v106; // [rsp+1E8h] [rbp+E8h]
const char *v107; // [rsp+1F0h] [rbp+F0h]
__int64 v108; // [rsp+1F8h] [rbp+F8h]
const char *v109; // [rsp+200h] [rbp+100h]
__int64 v110; // [rsp+208h] [rbp+108h]
__int16 *v111; // [rsp+210h] [rbp+110h]
__int64 v112; // [rsp+218h] [rbp+118h]
const char *v113; // [rsp+220h] [rbp+120h]
__int64 v114; // [rsp+228h] [rbp+128h]
const char *v115; // [rsp+230h] [rbp+130h]
__int64 v116; // [rsp+238h] [rbp+138h]
const char *v117; // [rsp+240h] [rbp+140h]
__int64 v118; // [rsp+248h] [rbp+148h]
char v119[16]; // [rsp+250h] [rbp+150h] BYREF
char v120[16]; // [rsp+260h] [rbp+160h] BYREF
void *Src[2]; // [rsp+270h] [rbp+170h] BYREF
__int128 v122; // [rsp+280h] [rbp+180h]
void *Block[2]; // [rsp+290h] [rbp+190h] BYREF
size_t Size[2]; // [rsp+2A0h] [rbp+1A0h]
_QWORD v125[4]; // [rsp+2B0h] [rbp+1B0h] BYREF
_BYTE v126[528]; // [rsp+2D0h] [rbp+1D0h] BYREF
v2 = (_OWORD *)a2;
v62 = (_OWORD *)a2;
v63 = (const char *)a2;
if ( !*(_BYTE *)(a1 + 12968) )
{
*(_OWORD *)a2 = 0;
*(_QWORD *)(a2 + 16) = 0;
*(_QWORD *)(a2 + 24) = 15;
*(_BYTE *)a2 = 0;
return v2;
}
fmt::BasicWriter::BasicWriter(v126);
v4 = 1;
v5 = 0;
v6 = *(_QWORD *)(a1 + 13080);
if ( (*(_QWORD *)(a1 + 13088) - v6) >> 4 )
{
v7 = 0;
while ( 1 )
{
if ( !v4 )
{
v63 = ";";
v64 = 0;
v61 = (unsigned __int64)";";
fmt::BasicWriter::operator<<(v126, &v61);
}
if ( !*(_BYTE *)(v7 + v6 + 4) )
{
v111 = &word_140533640;
v112 = 0;
v61 = (unsigned __int64)&word_140533640;
fmt::BasicWriter::operator<<(v126, &v61);
}
fmt::BasicWriter::operator<<(v126, *(unsigned int *)(v7 + v6 + 8));
v8 = *(_DWORD *)(v7 + v6);
if ( v8 - 98 > 1 )
{
if ( *(_BYTE *)(v7 + v6 + 5) )
{
v12 = v8 - 2;
if ( v12 )
{
v13 = v12 - 1;
if ( v13 )
{
v14 = v13 - 1;
if ( v14 )
{
if ( v14 == 1 )
v8 = 10;
else
v8 = 6;
}
else
{
v8 = 9;
}
}
else
{
v8 = 8;
}
}
else
{
v8 = 7;
}
}
else
{
v9 = v8 - 2;
if ( v9 )
{
v10 = v9 - 1;
if ( v10 )
{
v11 = v10 - 1;
if ( v11 )
{
if ( v11 != 1 )
goto LABEL_39;
v8 = 5;
}
else
{
v8 = 4;
}
}
else
{
v8 = 3;
}
}
else
{
v8 = 2;
}
}
}
v113 = ",";
v114 = 0;
v61 = (unsigned __int64)",";
fmt::BasicWriter::operator<<(v126, &v61);
fmt::BasicWriter::operator<<(v126, v8);
if ( v8 - 98 <= 1 )
{
v15 = *(_QWORD *)(a1 + 13128);
v16 = *(_QWORD *)(v15
+ 16
* ((0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 15)
^ (0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 14)
^ (0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 13)
^ (0x100000001B3LL * (*(unsigned __int8 *)(v7 + v6 + 12) ^ 0xCBF29CE484222325uLL))))))))
& *(_QWORD *)(a1 + 13152))
+ 8);
v17 = *(_QWORD *)(a1 + 13112);
if ( v16 == v17 )
goto LABEL_34;
v18 = *(_QWORD *)(v15
+ 16
* ((0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 15)
^ (0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 14)
^ (0x100000001B3LL
* (*(unsigned __int8 *)(v7 + v6 + 13)
^ (0x100000001B3LL * (*(unsigned __int8 *)(v7 + v6 + 12) ^ 0xCBF29CE484222325uLL))))))))
& *(_QWORD *)(a1 + 13152)));
v19 = *(_DWORD *)(v7 + v6 + 12);
if ( v19 != *(_DWORD *)(v16 + 16) )
{
while ( v16 != v18 )
{
v16 = *(_QWORD *)(v16 + 8);
if ( v19 == *(_DWORD *)(v16 + 16) )
goto LABEL_35;
}
LABEL_34:
v16 = 0;
}
LABEL_35:
if ( !v16 )
v16 = *(_QWORD *)(a1 + 13112);
if ( v16 != v17 )
{
v115 = ":";
v116 = 0;
v61 = (unsigned __int64)":";
fmt::BasicWriter::operator<<(v126, &v61);
v117 = ",";
v118 = 0;
v60 = (unsigned __int64)",";
v20 = sub_140204230(v125, *(_QWORD *)(v16 + 32));
v59 = *(_OWORD *)fmt::BasicStringRef::BasicStringRef(v119, v20);
v65 = ",";
v66 = 0;
v58 = (unsigned __int64)",";
v67 = &word_140531EA4;
v68 = 0;
v61 = (unsigned __int64)&word_140531EA4;
fmt::BasicWriter::operator<<(v126, &v61);
fmt::BasicWriter::operator<<(v21, &v58);
fmt::BasicWriter::operator<<(v22, &v59);
fmt::BasicWriter::operator<<(v23, &v60);
sub_14003A830((__int64)v125);
v69 = ",";
v70 = 0;
v58 = (unsigned __int64)",";
v71 = ",";
v72 = 0;
v59 = (unsigned __int64)",";
v73 = &word_140531EA0;
v74 = 0;
v60 = (unsigned __int64)&word_140531EA0;
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v24, &v59);
fmt::BasicWriter::operator<<(v25, *(unsigned int *)(v16 + 24));
fmt::BasicWriter::operator<<(v26, &v58);
v75 = ",";
v76 = 0;
v58 = (unsigned __int64)",";
v77 = ",";
v78 = 0;
v59 = (unsigned __int64)",";
v79 = &word_140531E9C;
v80 = 0;
v60 = (unsigned __int64)&word_140531E9C;
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v27, &v59);
fmt::BasicWriter::operator<<(v28, *(unsigned int *)(v16 + 40));
fmt::BasicWriter::operator<<(v29, &v58);
v81 = ",";
v82 = 0;
v58 = (unsigned __int64)",";
v83 = ",";
v84 = 0;
v59 = (unsigned __int64)",";
v85 = &word_140531E94;
v86 = 0;
v60 = (unsigned __int64)&word_140531E94;
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v30, &v59);
fmt::BasicWriter::operator<<(v31, *(unsigned int *)(v16 + 44));
fmt::BasicWriter::operator<<(v32, &v58);
v87 = ",";
v88 = 0;
v58 = (unsigned __int64)",";
v89 = ",";
v90 = 0;
v59 = (unsigned __int64)",";
v91 = &word_140531E90;
v92 = 0;
v60 = (unsigned __int64)&word_140531E90;
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v33, &v59);
fmt::BasicWriter::operator<<(v34, *(unsigned int *)(v16 + 56));
fmt::BasicWriter::operator<<(v35, &v58);
v93 = ",";
v94 = 0;
v58 = (unsigned __int64)",";
v95 = ",";
v96 = 0;
v59 = (unsigned __int64)",";
v97 = "6";
v98 = 0;
v60 = (unsigned __int64)"6";
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v36, &v59);
fmt::BasicWriter::operator<<(v37, *(unsigned int *)(v16 + 60));
fmt::BasicWriter::operator<<(v38, &v58);
v99 = ",";
v100 = 0;
v61 = (unsigned __int64)",";
v39 = sub_140204230(v125, *(_QWORD *)(v16 + 48));
v58 = *(_OWORD *)fmt::BasicStringRef::BasicStringRef(v120, v39);
v101 = ",";
v102 = 0;
v59 = (unsigned __int64)",";
v103 = &word_140531E88;
v104 = 0;
v60 = (unsigned __int64)&word_140531E88;
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v40, &v59);
fmt::BasicWriter::operator<<(v41, &v58);
fmt::BasicWriter::operator<<(v42, &v61);
sub_14003A830((__int64)v125);
v105 = ",";
v106 = 0;
v61 = (unsigned __int64)",";
v58 = *(_OWORD *)fmt::BasicStringRef::BasicStringRef(Block, v16 + 64);
v107 = ",";
v108 = 0;
v59 = (unsigned __int64)",";
v109 = "8";
v110 = 0;
v60 = (unsigned __int64)"8";
fmt::BasicWriter::operator<<(v126, &v60);
fmt::BasicWriter::operator<<(v43, &v59);
fmt::BasicWriter::operator<<(v44, &v58);
fmt::BasicWriter::operator<<(v45, &v61);
}
}
LABEL_39:
v4 = 0;
++v5;
v7 += 16;
v6 = *(_QWORD *)(a1 + 13080);
if ( v5 >= (unsigned __int64)((*(_QWORD *)(a1 + 13088) - v6) >> 4) )
{
v2 = v62;
break;
}
}
}
v46 = (_BYTE *)fmt::BasicWriter::c_str(v126);
*(_OWORD *)Src = 0;
v122 = 0u;
v47 = -1;
v48 = -1;
do
++v48;
while ( v46[v48] );
sub_14003A930(Src, v46, v48);
v49 = (const char *)sub_140204230(v125, *(_QWORD *)(a1 + 13032));
v50 = v49;
v51 = (const char *)(a1 + 13352);
if ( *(_QWORD *)(a1 + 13376) > 0xFu )
v51 = *(const char **)v51;
if ( *((_QWORD *)v49 + 3) > 0xFu )
v50 = *(const char **)v49;
v52 = cocos2d::CCString::createWithFormat(
"#%s,%i,%i,%i,%i,%s",
v50,
*(_DWORD *)(a1 + 13384),
22,
47,
*(_DWORD *)(*(_QWORD *)(a1 + 2168) + 744LL),
v51);
CString = cocos2d::CCString::getCString(v52);
*(_OWORD *)Block = 0;
*(_OWORD *)Size = 0;
do
++v47;
while ( CString[v47] );
sub_14003A930(Block, CString, v47);
sub_14003A830((__int64)v125);
v54 = Block;
if ( Size[1] > 0xF )
v54 = (void **)Block[0];
sub_140041270(Src, v54, Size[0]);
if ( Size[1] > 0xF )
{
v55 = Block[0];
if ( Size[1] + 1 >= 0x1000 )
{
v55 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v55 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v55);
}
if ( (_QWORD)v122 )
{
cocos2d::ZipUtils::compressString(Block, Src, 0, 11);
*v2 = *(_OWORD *)Block;
v2[1] = *(_OWORD *)Size;
*(__m128i *)Size = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( *((_QWORD *)&v122 + 1) > 0xFu )
{
v56 = Src[0];
if ( (unsigned __int64)(*((_QWORD *)&v122 + 1) + 1LL) >= 0x1000 )
{
v56 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v56 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v56);
}
}
else
{
*v2 = *(_OWORD *)Src;
v2[1] = v122;
}
LOBYTE(Src[0]) = 0;
*((_QWORD *)&v122 + 1) = 15;
*(_QWORD *)&v122 = 0;
fmt::BasicWriter::~BasicWriter(v126);
return v2;
}