//
// GameToolbox::hsvFromString from 0x1004ec910 to 0x1004ecb05 (501 bytes)
//
// 6 xrefs:
// > EnterEffectObject::customObjectSetup @ 0x1001771b2
// > EffectGameObject::customObjectSetup @ 0x1001787c8
// > EffectGameObject::customObjectSetup @ 0x10017aaee
// > ColorAction::setupFromMap @ 0x1002c6aa2
// > GameObject::objectFromVector @ 0x100692bb8
// > GameObject::objectFromVector @ 0x100692cf6
//
// 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:31:22 +0000
//
__int64 __fastcall GameToolbox::hsvFromString(unsigned __int8 *a1, __int64 a2)
{
unsigned __int64 v2; // rbx
unsigned int v3; // eax
void **v4; // r14
void **v5; // r12
unsigned __int64 v6; // r15
void **v7; // rdi
double v8; // xmm0_8
bool v9; // zf
double v10; // xmm0_8
const char *v11; // rdi
double v12; // xmm0_8
__m128 v13; // xmm1
unsigned int v14; // xmm1_4
unsigned int v15; // xmm0_4
int v16; // eax
const char *v17; // rdi
__int64 v18; // r13
int v19; // eax
double v21; // [rsp+0h] [rbp-70h]
void *__p[2]; // [rsp+10h] [rbp-60h] BYREF
__int64 v23; // [rsp+20h] [rbp-50h]
__m128 inserted; // [rsp+30h] [rbp-40h]
unsigned int v25; // [rsp+44h] [rbp-2Ch]
v3 = *a1;
if ( (v3 & 1) != 0 )
{
if ( !*((_QWORD *)a1 + 1) )
return qword_100BE46F8;
}
else if ( !(v3 >> 1) )
{
return qword_100BE46F8;
}
*(_OWORD *)__p = 0;
v23 = 0;
sub_1004ECB20(a1, a2, __p);
v4 = (void **)__p[0];
v5 = (void **)__p[1];
v6 = 0xAAAAAAAAAAAAAAABLL * (((char *)__p[1] - (char *)__p[0]) >> 3);
if ( v6 >= 5 )
{
if ( (*(_BYTE *)__p[0] & 1) != 0 )
{
v12 = atof(*((const char **)__p[0] + 2));
v9 = ((_BYTE)v4[3] & 1) == 0;
*(double *)inserted.i64 = v12;
if ( !v9 )
{
LABEL_11:
v21 = atof((const char *)v4[5]);
if ( ((_BYTE)v4[6] & 1) != 0 )
goto LABEL_12;
goto LABEL_16;
}
}
else
{
v8 = atof((const char *)__p[0] + 1);
v9 = ((_BYTE)v4[3] & 1) == 0;
*(double *)inserted.i64 = v8;
if ( !v9 )
goto LABEL_11;
}
v21 = atof((const char *)v4 + 25);
if ( ((_BYTE)v4[6] & 1) != 0 )
{
LABEL_12:
v10 = atof((const char *)v4[8]);
if ( ((_BYTE)v4[9] & 1) != 0 )
{
LABEL_13:
v11 = (const char *)v4[11];
goto LABEL_18;
}
LABEL_17:
v11 = (char *)v4 + 73;
LABEL_18:
v13 = (__m128)inserted.u64[0];
v13.f32[0] = *(double *)inserted.i64;
inserted = v13;
*(float *)&v15 = v10;
v25 = v15;
v16 = atoi(v11);
if ( ((_BYTE)v4[12] & 1) != 0 )
v17 = (const char *)v4[14];
else
v17 = (char *)v4 + 97;
v18 = v16 != 0;
v19 = atoi(v17);
v2 = ((unsigned __int64)(v19 != 0) << 40) | (v18 << 32) | (unsigned int)_mm_cvtsi128_si32(_mm_cvtsi32_si128(v25));
*(float *)&v14 = v21;
inserted = _mm_insert_ps(inserted, (__m128)v14, 16);
v7 = v4;
if ( v5 == v4 )
goto LABEL_27;
goto LABEL_24;
}
LABEL_16:
v10 = atof((const char *)v4 + 49);
if ( ((_BYTE)v4[9] & 1) != 0 )
goto LABEL_13;
goto LABEL_17;
}
if ( !__p[0] )
return qword_100BE46F8;
inserted = 0;
v7 = (void **)__p[0];
if ( __p[1] == __p[0] )
goto LABEL_27;
do
{
LABEL_24:
if ( (*(_BYTE *)(v5 - 3) & 1) != 0 )
operator delete(*(v5 - 1));
v5 -= 3;
}
while ( v5 != v4 );
v7 = (void **)__p[0];
LABEL_27:
__p[1] = v4;
operator delete(v7);
if ( v6 <= 4 )
return qword_100BE46F8;
return v2;
}