//
// sub_1005CC930 from 0x1005cc930 to 0x1005ccdf8 (1224 bytes)
//
// 1 xrefs:
// > processGJGameStateFields @ 0x1005e2550
//
// This function is hookable on this platform (idp: pc, 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:32:50 +0000
//
void __fastcall sub_1005CC930(__int64 *a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rcx
int v5; // r15d
char *v6; // rdi
const char *v7; // rdi
void **v8; // r12
signed int v9; // r14d
void **v10; // r13
__int64 v11; // rax
signed int v12; // r15d
int v13; // ebx
char *v14; // rdi
const char *v15; // rdi
int v16; // r12d
__int64 v17; // r13
signed int v18; // edx
char *v19; // rdi
const char *v20; // rdi
__int64 v21; // r15
__int64 v22; // rax
_QWORD *v23; // r14
int v24; // eax
int v25; // eax
_QWORD *v26; // rbx
__int64 v27; // rax
void **v28; // r13
signed int v29; // r15d
signed int v30; // r14d
char *v31; // rdi
int v32; // eax
__int64 v33; // rax
void **v34; // r13
signed int v35; // r14d
signed int v36; // r13d
signed int v37; // r15d
char *v38; // rdi
const char *v39; // rdi
char *v40; // rdi
char *v41; // rdi
const char *v42; // rdi
int v43; // r15d
void **v44; // rbx
void *v45; // rdi
std::string v46; // [rsp+10h] [rbp-90h] BYREF
__int64 v47; // [rsp+28h] [rbp-78h]
char *v48; // [rsp+30h] [rbp-70h]
signed int v49; // [rsp+3Ch] [rbp-64h]
void *__p; // [rsp+40h] [rbp-60h] BYREF
void **v51; // [rsp+48h] [rbp-58h]
signed int v52; // [rsp+58h] [rbp-48h]
__int64 v53; // [rsp+60h] [rbp-40h]
void **v54; // [rsp+68h] [rbp-38h]
int v55; // [rsp+74h] [rbp-2Ch]
memset(&v46, 0, sizeof(v46));
v2 = *((int *)a1 + 6);
v3 = *a1;
if ( (int)v2 < (int)(-1431655765 * ((unsigned __int64)(a1[1] - *a1) >> 3)) )
{
*((_DWORD *)a1 + 6) = v2 + 1;
std::string::operator=(&v46, (const std::string *)(v3 + 24 * v2));
}
sub_1005C67B0((__int64)&__p, (unsigned __int8 *)&v46, "|", a1[4]);
v4 = v52;
v5 = 0;
if ( v52 < (int)(-1431655765 * ((unsigned __int64)((char *)v51 - (_BYTE *)__p) >> 3)) )
{
++v52;
v6 = (char *)__p + 24 * v4;
if ( (*v6 & 1) != 0 )
v7 = *((const char **)v6 + 2);
else
v7 = v6 + 1;
v5 = atoi(v7);
}
sub_10001ADF0(a2, *(_QWORD **)(a2 + 8));
*(_QWORD *)a2 = a2 + 8;
*(_OWORD *)(a2 + 8) = 0;
v8 = (void **)__p;
if ( v5 > 0 )
{
v9 = v52;
v10 = v51;
v11 = 0;
v55 = v5;
while ( 1 )
{
v47 = v11;
v12 = -1431655765 * ((unsigned __int64)((char *)v10 - (char *)v8) >> 3);
v48 = (char *)v8;
v54 = v10;
if ( v9 >= v12 )
break;
v13 = v9 + 1;
v52 = v9 + 1;
v14 = (char *)&v8[3 * v9];
if ( (*v14 & 1) != 0 )
v15 = *((const char **)v14 + 2);
else
v15 = v14 + 1;
v16 = atoi(v15);
v17 = 0;
v49 = v12;
if ( v13 >= v12 )
goto LABEL_15;
v52 = v9 + 2;
v19 = &v48[24 * v13];
if ( (*v19 & 1) != 0 )
v20 = *((const char **)v19 + 2);
else
v20 = v19 + 1;
v17 = (unsigned int)atoi(v20);
v18 = v9 + 2;
LABEL_22:
v21 = a2 + 8;
LABEL_23:
while ( 1 )
{
v22 = *(_QWORD *)v21;
v23 = (_QWORD *)v21;
if ( !*(_QWORD *)v21 )
break;
while ( 1 )
{
v21 = v22;
v24 = *(_DWORD *)(v22 + 32);
if ( v16 < v24 )
break;
if ( v16 <= v24 )
{
v25 = *(_DWORD *)(v21 + 36);
if ( (int)v17 < v25 )
goto LABEL_23;
if ( (int)v17 <= v25 )
{
v26 = (_QWORD *)v21;
v8 = (void **)v48;
v28 = v54;
v29 = v49;
if ( v18 < v49 )
goto LABEL_33;
goto LABEL_43;
}
}
v22 = *(_QWORD *)(v21 + 8);
if ( !v22 )
{
v23 = (_QWORD *)(v21 + 8);
goto LABEL_30;
}
}
}
LABEL_30:
v26 = operator new(0x40u);
v26[4] = (v17 << 32) | (unsigned int)v16;
v26[5] = 0;
*((_DWORD *)v26 + 12) = 0;
v26[7] = 0;
*(_OWORD *)v26 = 0;
v26[2] = v21;
*v23 = v26;
v27 = **(_QWORD **)a2;
if ( v27 )
*(_QWORD *)a2 = v27;
sub_10001B680(*(__int64 **)(a2 + 8), v26);
++*(_QWORD *)(a2 + 16);
v18 = v52;
v8 = (void **)__p;
v28 = v51;
v29 = -1431655765 * ((unsigned __int64)((char *)v51 - (_BYTE *)__p) >> 3);
if ( v52 >= v29 )
{
LABEL_43:
v26[7] = 0;
v54 = v28;
if ( v18 >= v29 )
goto LABEL_39;
LABEL_44:
v35 = v18 + 1;
v52 = v18 + 1;
v38 = (char *)&v8[3 * v18];
if ( (*v38 & 1) != 0 )
v39 = *((const char **)v38 + 2);
else
v39 = v38 + 1;
*((_DWORD *)v26 + 10) = atoi(v39);
v36 = v29;
if ( v35 >= v29 )
goto LABEL_40;
LABEL_48:
v37 = v35 + 1;
v52 = v35 + 1;
v40 = (char *)&v8[3 * v35];
if ( (*v40 & 1) != 0 )
{
*((_DWORD *)v26 + 11) = atoi(*((const char **)v40 + 2));
if ( v37 >= v36 )
goto LABEL_10;
goto LABEL_52;
}
*((_DWORD *)v26 + 11) = atoi(v40 + 1);
if ( v37 < v36 )
goto LABEL_52;
LABEL_10:
v9 = v37;
v10 = v54;
v11 = (unsigned int)(v47 + 1);
if ( (_DWORD)v11 == v55 )
goto LABEL_59;
}
else
{
LABEL_33:
v30 = v18 + 1;
v52 = v18 + 1;
v31 = (char *)&v8[3 * v18];
if ( (*v31 & 1) != 0 )
{
v32 = atoi(*((const char **)v31 + 2));
if ( !v32 )
goto LABEL_42;
}
else
{
v32 = atoi(v31 + 1);
if ( !v32 )
goto LABEL_42;
}
if ( !v53 )
{
LABEL_42:
v18 = v30;
goto LABEL_43;
}
v33 = sub_1001446A0(v53, v32);
v18 = v52;
v8 = (void **)__p;
v34 = v51;
v29 = -1431655765 * ((unsigned __int64)((char *)v51 - (_BYTE *)__p) >> 3);
v26[7] = v33;
v54 = v34;
if ( v18 < v29 )
goto LABEL_44;
LABEL_39:
v35 = v18;
v36 = v29;
if ( v18 < v29 )
goto LABEL_48;
LABEL_40:
v37 = v35;
if ( v35 >= v36 )
goto LABEL_10;
LABEL_52:
v9 = v37 + 1;
v52 = v37 + 1;
v41 = (char *)&v8[3 * v37];
v10 = v54;
if ( (*v41 & 1) != 0 )
v42 = *((const char **)v41 + 2);
else
v42 = v41 + 1;
v43 = v55;
*((_DWORD *)v26 + 12) = atoi(v42);
v11 = (unsigned int)(v47 + 1);
if ( (_DWORD)v11 == v43 )
goto LABEL_59;
}
}
v13 = v9;
v16 = 0;
v17 = 0;
v49 = v12;
LABEL_15:
v18 = v13;
goto LABEL_22;
}
LABEL_59:
if ( v8 )
{
v44 = v51;
v45 = v8;
if ( v51 != v8 )
{
do
{
if ( (*(_BYTE *)(v44 - 3) & 1) != 0 )
operator delete(*(v44 - 1));
v44 -= 3;
}
while ( v44 != v8 );
v45 = __p;
}
v51 = v8;
operator delete(v45);
}
if ( (*(_BYTE *)&v46.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v46.__r_.__value_.__l.__data_);
}