//
// sub_1005FC1E0 from 0x1005fc1e0 to 0x1005fc38e (430 bytes)
//
// 3 xrefs:
// > sub_1005CD690 @ 0x1005cdcc3
// > sub_1005CD690 @ 0x1005cdcd4
// > sub_1005CD690 @ 0x1005cdce8
//
// 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:34:28 +0000
//
void __fastcall sub_1005FC1E0(__int64 *a1, __int64 a2)
{
int v3; // eax
__int64 v4; // r15
int v5; // r12d
__int64 v6; // rdi
const char *v7; // rdi
__int64 v8; // rdi
const char *v9; // rdi
int v10; // r13d
__int64 v11; // rdi
const char *v12; // rdi
int v13; // ebx
__int64 v14; // rdi
const char *v15; // rdi
float v16; // xmm0_4
float v17; // xmm0_4
__int64 v18; // rax
__int64 v19; // rcx
_BYTE *v20; // rax
bool v21; // al
__int64 v22; // [rsp+0h] [rbp-30h]
v3 = *((_DWORD *)a1 + 6);
v4 = *a1;
v5 = -1431655765 * ((unsigned __int64)(a1[1] - *a1) >> 3);
if ( v3 >= v5
|| ((*((_DWORD *)a1 + 6) = v3 + 1, v6 = v4 + 24LL * v3, (*(_BYTE *)v6 & 1) != 0)
? (v7 = *(const char **)(v6 + 16))
: (v7 = (const char *)(v6 + 1)),
*(double *)a2 = strtod(v7, nullptr),
v3 = *((_DWORD *)a1 + 6),
v4 = *a1,
v5 = -1431655765 * ((unsigned __int64)(a1[1] - *a1) >> 3),
v3 >= v5) )
{
if ( v3 < v5 )
goto LABEL_10;
LABEL_14:
v10 = v3;
v22 = a2;
if ( v3 >= v5 )
goto LABEL_19;
goto LABEL_15;
}
*((_DWORD *)a1 + 6) = v3 + 1;
v8 = v4 + 24LL * v3;
if ( (*(_BYTE *)v8 & 1) != 0 )
v9 = *(const char **)(v8 + 16);
else
v9 = (const char *)(v8 + 1);
*(double *)(a2 + 8) = strtod(v9, nullptr);
v3 = *((_DWORD *)a1 + 6);
v4 = *a1;
v5 = -1431655765 * ((unsigned __int64)(a1[1] - *a1) >> 3);
if ( v3 >= v5 )
goto LABEL_14;
LABEL_10:
v10 = v3 + 1;
*((_DWORD *)a1 + 6) = v3 + 1;
v11 = v4 + 24LL * v3;
if ( (*(_BYTE *)v11 & 1) != 0 )
v12 = *(const char **)(v11 + 16);
else
v12 = (const char *)(v11 + 1);
v16 = atof(v12);
*(float *)(a2 + 16) = v16;
v22 = a2;
if ( v10 >= v5 )
{
LABEL_19:
v13 = v10;
if ( v10 >= v5 )
return;
LABEL_23:
*((_DWORD *)a1 + 6) = v13 + 1;
v18 = v4 + 24LL * v13;
if ( (*(_BYTE *)v18 & 1) != 0 )
{
v19 = v22;
if ( *(_QWORD *)(v18 + 8) == 1 )
{
v20 = *(_BYTE **)(v18 + 16);
goto LABEL_28;
}
}
else
{
v19 = v22;
if ( *(_BYTE *)v18 == 2 )
{
v20 = (_BYTE *)(v18 + 1);
LABEL_28:
v21 = *v20 == 49;
LABEL_30:
*(_BYTE *)(v19 + 24) = v21;
return;
}
}
v21 = 0;
goto LABEL_30;
}
LABEL_15:
v13 = v10 + 1;
*((_DWORD *)a1 + 6) = v10 + 1;
v14 = v4 + 24LL * v10;
if ( (*(_BYTE *)v14 & 1) != 0 )
v15 = *(const char **)(v14 + 16);
else
v15 = (const char *)(v14 + 1);
v17 = atof(v15);
*(float *)(v22 + 20) = v17;
if ( v13 < v5 )
goto LABEL_23;
}