//
// sub_1005C1B70 from 0x1005c1b70 to 0x1005c1cb7 (327 bytes)
//
// 2 xrefs:
// > processGJGameStateFields @ 0x1005de907
// > processGJGameStateFields @ 0x1005de916
//
// 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:46 +0000
//
__int64 __fastcall sub_1005C1B70(__int64 a1, _QWORD *a2)
{
int v2; // r13d
__int64 v3; // r13
__int64 v4; // r12
void *v6[3]; // [rsp+8h] [rbp-278h] BYREF
_BYTE v7[12]; // [rsp+24h] [rbp-25Ch] BYREF
__int64 v8; // [rsp+30h] [rbp-250h]
void *v9; // [rsp+38h] [rbp-248h]
_BYTE v10[504]; // [rsp+40h] [rbp-240h] BYREF
__int16 v11; // [rsp+238h] [rbp-48h]
char v12; // [rsp+23Ah] [rbp-46h]
void *v13; // [rsp+248h] [rbp-38h]
*(_QWORD *)&v7[4] = 0;
v8 = 500;
v9 = v10;
v11 = 31746;
v12 = 0;
v2 = -1431655765 * ((__int64)(a2[1] - *a2) >> 5);
*(_QWORD *)v7 = (unsigned int)v2;
sub_1005BE520((__int64)&v7[4], (int *)v7);
if ( v2 > 0 )
{
v3 = v2 & 0x7FFFFFFF;
v4 = 0;
do
{
sub_1005C1D20(&v7[4], v4 + *a2);
v4 += 96;
--v3;
}
while ( v3 );
}
sub_1005BED90(v6, (__int64)&v7[4]);
sub_1005BEEA0(a1, (unsigned __int8 *)v6);
if ( ((__int64)v6[0] & 1) != 0 )
operator delete(v6[2]);
if ( (v11 & 1) != 0 )
operator delete(v13);
if ( v9 != v10 && v9 != nullptr )
operator delete[](v9);
return __stack_chk_guard;
}