//
// GameToolbox::hsvFromString from 0x5835dc to 0x583854 (632 bytes)
//
// 7 xrefs:
// > GameObject::objectFromVector @ 0x655754
// > GameObject::objectFromVector @ 0x65581c
// > EffectGameObject::customObjectSetup @ 0x74cd00
// > EffectGameObject::customObjectSetup @ 0x74d208
// > EnterEffectObject::customObjectSetup @ 0x74fdf4
// > ColorAction::setupFromMap @ 0x8b3c84
// > ??> @ 0x68820
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall GameToolbox::hsvFromString(_QWORD *a1, char *a2)
{
unsigned __int64 v2; // x23
__int64 *v4; // x19
__int64 *v5; // x22
double v6; // d9
double v7; // d8
__int64 *v8; // x19
__int64 *v9; // x24
float v10; // s0
float v11; // w2
unsigned int v12; // s0
__int64 v13; // x1
__int64 *v14; // x0
unsigned int *v15; // x1
int v16; // w2
void *v17; // x0
__int64 v18; // x1
__int64 *v19; // x0
unsigned int *v20; // x1
int v21; // w2
void *p; // [xsp+80h] [xbp+80h] BYREF
void *v23; // [xsp+88h] [xbp+88h]
__int64 v24; // [xsp+90h] [xbp+90h]
if ( !*(_QWORD *)(*a1 - 24LL) )
return qword_1241820;
p = nullptr;
v23 = nullptr;
v24 = 0;
sub_583398(a1, a2, (__int64)&p);
v4 = (__int64 *)p;
v5 = (__int64 *)v23;
if ( (unsigned __int64)((_BYTE *)v23 - (_BYTE *)p) <= 0x27 )
{
v17 = p;
if ( p != v23 )
{
do
{
v18 = *v4;
v19 = (__int64 *)(*v4 - 24);
if ( v19 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v20 = (unsigned int *)(v18 - 8);
do
v21 = __ldaxr(v20);
while ( __stlxr(v21 - 1, v20) );
}
else
{
v21 = *(_DWORD *)(v18 - 8);
*(_DWORD *)(v18 - 8) = v21 - 1;
}
if ( v21 <= 0 )
operator delete(v19);
}
++v4;
}
while ( v5 != v4 );
v17 = p;
}
if ( v17 )
operator delete(v17);
return qword_1241820;
}
v6 = atof(*(const char **)p);
v7 = atof(*(const char **)&byte_8[(_QWORD)p]);
atof(*(const char **)((char *)&word_10 + (_QWORD)p));
v8 = (__int64 *)p;
atoi(*(const char **)((char *)&off_18 + (_QWORD)p));
atoi(*(const char **)((char *)&qword_20 + (_QWORD)v8));
v9 = (__int64 *)v23;
v10 = v6;
v11 = v10;
*(float *)&v12 = v7;
v2 = LODWORD(v11) | ((unsigned __int64)v12 << 32);
if ( v8 == v23 )
goto LABEL_27;
do
{
v13 = *v8;
v14 = (__int64 *)(*v8 - 24);
if ( v14 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v13 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v13 - 8);
*(_DWORD *)(v13 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v14);
}
++v8;
}
while ( v9 != v8 );
v9 = (__int64 *)p;
if ( p )
LABEL_27:
operator delete(v9);
return v2;
}