//
// sub_1005C7210 from 0x1005c7210 to 0x1005c73b0 (416 bytes)
//
// 2 xrefs:
// > PlayerCheckpoint::processState @ 0x1005db700
// > sub_1005F67C0 @ 0x1005f67f6
//
// 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_1005C7210(__int64 *a1, _QWORD *a2)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rcx
int v5; // r14d
char *v6; // rdi
const char *v7; // rdi
void **v8; // rbx
void **v9; // r14
void *v10; // rdi
__int64 v11; // rcx
char *v12; // rdi
int v13; // eax
__int64 v14; // rax
std::string v15; // [rsp+0h] [rbp-50h] BYREF
void *__p; // [rsp+18h] [rbp-38h] BYREF
void **v17; // [rsp+20h] [rbp-30h]
signed int v18; // [rsp+30h] [rbp-20h]
__int64 v19; // [rsp+38h] [rbp-18h]
memset(&v15, 0, sizeof(v15));
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=(&v15, (const std::string *)(v3 + 24 * v2));
}
sub_1005C67B0((__int64)&__p, (unsigned __int8 *)&v15, "|", a1[4]);
v4 = v18;
v5 = 0;
if ( v18 < (int)(-1431655765 * ((unsigned __int64)((char *)v17 - (_BYTE *)__p) >> 3)) )
{
++v18;
v6 = (char *)__p + 24 * v4;
if ( (*v6 & 1) != 0 )
v7 = *((const char **)v6 + 2);
else
v7 = v6 + 1;
v5 = atoi(v7);
}
sub_1007FF190(*a2);
if ( v5 > 0 )
{
do
{
v11 = v18;
if ( v18 < (int)(-1431655765 * ((unsigned __int64)((char *)v17 - (_BYTE *)__p) >> 3)) )
{
++v18;
v12 = (char *)__p + 24 * v11;
if ( (*v12 & 1) != 0 )
{
v13 = atoi(*((const char **)v12 + 2));
if ( v13 )
{
LABEL_18:
if ( v19 )
{
v14 = sub_1001446A0(v19, v13);
if ( v14 )
sub_1007FEBF0(*a2, v14);
}
}
}
else
{
v13 = atoi(v12 + 1);
if ( v13 )
goto LABEL_18;
}
}
--v5;
}
while ( v5 );
}
v8 = (void **)__p;
if ( __p )
{
v9 = v17;
v10 = __p;
if ( v17 != __p )
{
do
{
if ( (*(_BYTE *)(v9 - 3) & 1) != 0 )
operator delete(*(v9 - 1));
v9 -= 3;
}
while ( v9 != v8 );
v10 = __p;
}
v17 = v8;
operator delete(v10);
}
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v15.__r_.__value_.__l.__data_);
}