//
// sub_1005C7810 from 0x1005c7810 to 0x1005c79c5 (437 bytes)
//
// 13 xrefs:
// > sub_1005C8510 @ 0x1005c8693
// > sub_1005C9BC0 @ 0x1005ca03d
// > sub_1005CA870 @ 0x1005cac13
// > sub_1005D1890 @ 0x1005d1e43
// > sub_1005D25F0 @ 0x1005d2a43
// > sub_1005D2AF0 @ 0x1005d2e7a
// > sub_1005D2F30 @ 0x1005d320a
// > sub_1005D32C0 @ 0x1005d36f3
// > sub_1005D37A0 @ 0x1005d54d0
// > sub_1005D63D0 @ 0x1005d6959
// > sub_1005D6A60 @ 0x1005d6fe3
// > processGJGameStateFields @ 0x1005e2350
// > processGJGameStateFields @ 0x1005e235f
//
// 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:48 +0000
//
void __fastcall sub_1005C7810(__int64 *a1, __int64 *a2)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rax
void **v5; // r15
int v6; // r14d
char *v7; // rdi
const char *v8; // rdi
unsigned __int64 v9; // rdx
signed int v10; // r12d
__int64 v11; // rbx
__int64 i; // r13
const char *v13; // rdi
__int64 v14; // rax
char *v15; // rdi
void **v16; // rbx
void *v17; // rdi
std::string v18; // [rsp+0h] [rbp-70h] BYREF
void *__p; // [rsp+18h] [rbp-58h] BYREF
void **v20; // [rsp+20h] [rbp-50h]
signed int v21; // [rsp+30h] [rbp-40h]
int v22[11]; // [rsp+44h] [rbp-2Ch] BYREF
memset(&v18, 0, sizeof(v18));
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=(&v18, (const std::string *)(v3 + 24 * v2));
}
sub_1005C67B0((__int64)&__p, (unsigned __int8 *)&v18, "|", a1[4]);
v4 = v21;
v5 = (void **)__p;
v6 = 0;
if ( v21 < (int)(-1431655765 * ((unsigned __int64)((char *)v20 - (_BYTE *)__p) >> 3)) )
{
++v21;
v7 = (char *)__p + 24 * v4;
if ( (*v7 & 1) != 0 )
v8 = *((const char **)v7 + 2);
else
v8 = v7 + 1;
v6 = atoi(v8);
}
v22[0] = 0;
v9 = (a2[1] - *a2) >> 2;
if ( v6 <= v9 )
{
if ( v6 < v9 )
a2[1] = *a2 + 4LL * v6;
}
else
{
sub_1005FA900(a2, v6 - v9, v22);
v5 = (void **)__p;
}
if ( v6 > 0 )
{
v10 = -1431655765 * ((unsigned __int64)((char *)v20 - (char *)v5) >> 3);
if ( v21 < v10 )
{
v11 = *a2;
for ( i = 0; i != v6; ++i )
{
v14 = v21;
if ( v21 < v10 )
{
++v21;
v15 = (char *)&v5[3 * v14];
if ( (*v15 & 1) != 0 )
v13 = *((const char **)v15 + 2);
else
v13 = v15 + 1;
*(_DWORD *)(v11 + 4 * i) = atoi(v13);
}
}
}
}
if ( v5 )
{
v16 = v20;
v17 = v5;
if ( v20 != v5 )
{
do
{
if ( (*(_BYTE *)(v16 - 3) & 1) != 0 )
operator delete(*(v16 - 1));
v16 -= 3;
}
while ( v16 != v5 );
v17 = __p;
}
v20 = v5;
operator delete(v17);
}
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}