//
// ConfigureHSVWidget::updateLabels from 0x100430c20 to 0x10043113b (1307 bytes)
//
// 6 xrefs:
// > ConfigureHSVWidget::init @ 0x100430587
// > ConfigureHSVWidget::init @ 0x1004305fb
// > ConfigureHSVWidget::sliderChanged @ 0x100430a89
// > ConfigureHSVWidget::onToggleSConst @ 0x100430b03
// > ConfigureHSVWidget::onToggleVConst @ 0x100430b73
// > ConfigureHSVWidget::onResetHSV @ 0x100430bf6
//
// 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
//
void __fastcall ConfigureHSVWidget::updateLabels(ConfigureHSVWidget *a1)
{
CCTextInputNode *v2; // r14
__m128 h_low; // xmm0
cocos2d::CCString *v4; // rax
const char *v5; // r12
size_t v6; // rax
size_t v7; // r15
char *v8; // r13
cocos2d::CCString *v9; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *m_hueLabel; // rdi
std::string::pointer data; // rsi
size_t v13; // r14
CCTextInputNode *v14; // r14
cocos2d::CCString *v15; // rax
const char *v16; // r12
size_t v17; // rax
size_t v18; // r15
char *v19; // r13
size_t v20; // r14
CCTextInputNode *v21; // r14
cocos2d::CCString *v22; // rax
const char *v23; // r12
size_t v24; // rax
size_t v25; // r15
char *v26; // r13
const std::string::value_type *v27; // rsi
double s; // xmm0_8
cocos2d::CCString *v29; // rax
const char *v30; // rax
std::string::pointer v31; // rsi
size_t v32; // r14
const std::string::value_type *v33; // rsi
double v; // xmm0_8
cocos2d::CCString *v35; // rax
const char *v36; // rax
std::string::pointer v37; // rsi
_QWORD __dst[2]; // [rsp+0h] [rbp-C0h] BYREF
void *__p; // [rsp+10h] [rbp-B0h]
_QWORD v40[2]; // [rsp+18h] [rbp-A8h] BYREF
void *v41; // [rsp+28h] [rbp-98h]
_QWORD v42[2]; // [rsp+30h] [rbp-90h] BYREF
void *v43; // [rsp+40h] [rbp-80h]
std::string v44; // [rsp+48h] [rbp-78h] BYREF
std::string v45; // [rsp+60h] [rbp-60h] BYREF
std::string v46; // [rsp+78h] [rbp-48h] BYREF
CCTextInputNode *v47; // [rsp+90h] [rbp-30h]
if ( !a1->m_addInputs )
{
strcpy((char *)&v44, "\nHue: ");
if ( a1->m_hsv.h > 0.0 )
std::string::append(&v44, "+");
v9 = (cocos2d::CCString *)sub_1007AB580("%i", __dst[0]);
CString = cocos2d::CCString::getCString(v9);
std::string::append(&v44, CString);
m_hueLabel = a1->m_hueLabel;
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) != 0 )
data = v44.__r_.__value_.__l.__data_;
else
data = v44.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_hueLabel->setString)(m_hueLabel, data);
v45.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)24;
strcpy(v45.__r_.__value_.__s.__data_, "Saturation: ");
if ( a1->m_hsv.absoluteSaturation )
{
if ( a1->m_hsv.s <= 0.0 )
goto LABEL_36;
v27 = "+";
}
else
{
v27 = "x";
}
std::string::append(&v45, v27);
LABEL_36:
s = a1->m_hsv.s;
v29 = (cocos2d::CCString *)sub_1007AB580("%.02f", __dst[0]);
v30 = cocos2d::CCString::getCString(v29);
std::string::append(&v45, v30);
if ( (*(_BYTE *)&v45.__r_.__value_.__s.0 & 1) != 0 )
v31 = v45.__r_.__value_.__l.__data_;
else
v31 = v45.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer, double))a1->m_saturationLabel->setString)(
a1->m_saturationLabel,
v31,
s);
v46.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)24;
strcpy(v46.__r_.__value_.__s.__data_, "Brightness: ");
if ( a1->m_hsv.absoluteBrightness )
{
if ( a1->m_hsv.v <= 0.0 )
goto LABEL_51;
v33 = "+";
}
else
{
v33 = "x";
}
std::string::append(&v46, v33);
LABEL_51:
v = a1->m_hsv.v;
v35 = (cocos2d::CCString *)sub_1007AB580("%.02f", __dst[0]);
v36 = cocos2d::CCString::getCString(v35);
std::string::append(&v46, v36);
if ( (*(_BYTE *)&v46.__r_.__value_.__s.0 & 1) != 0 )
v37 = v46.__r_.__value_.__l.__data_;
else
v37 = v46.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer, double))a1->m_brightnessLabel->setString)(
a1->m_brightnessLabel,
v37,
v);
if ( (*(_BYTE *)&v46.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(v46.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v45.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_56:
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_58;
LABEL_57:
operator delete(v44.__r_.__value_.__l.__data_);
goto LABEL_58;
}
}
else if ( (*(_BYTE *)&v45.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_56;
}
operator delete(v45.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v44.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_58;
goto LABEL_57;
}
a1->m_updating = 1;
v2 = (CCTextInputNode *)cocos2d::CCDictionary::objectForKey(a1->m_inputs, 1);
h_low = (__m128)LODWORD(a1->m_hsv.h);
*(double *)h_low.i64 = h_low.f32[0];
v4 = (cocos2d::CCString *)sub_1007AB580("%.0f", __dst[0]);
v5 = cocos2d::CCString::getCString(v4);
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_62;
v7 = v6;
if ( v6 >= 0x17 )
{
v47 = v2;
v13 = 26;
if ( (v6 | 7) != 0x17 )
v13 = (v6 | 7) + 1;
v8 = (char *)operator new(v13);
__p = v8;
__dst[0] = v13 + 1;
v2 = v47;
__dst[1] = v7;
goto LABEL_13;
}
LOBYTE(__dst[0]) = 2 * v6;
v8 = (char *)__dst + 1;
if ( v6 )
LABEL_13:
memmove(v8, v5, v7);
v8[v7] = 0;
CCTextInputNode::setString(v2, (__int64)__dst, h_low);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
v14 = (CCTextInputNode *)cocos2d::CCDictionary::objectForKey(a1->m_inputs, 2);
h_low = (__m128)LODWORD(a1->m_hsv.s);
*(double *)h_low.i64 = h_low.f32[0];
v15 = (cocos2d::CCString *)sub_1007AB580("%.2f", __dst[0]);
v16 = cocos2d::CCString::getCString(v15);
v17 = strlen(v16);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_62:
sub_100006BF0(*(double *)h_low.i64);
v18 = v17;
if ( v17 >= 0x17 )
{
v47 = v14;
v20 = 26;
if ( (v17 | 7) != 0x17 )
v20 = (v17 | 7) + 1;
v19 = (char *)operator new(v20);
v41 = v19;
v40[0] = v20 + 1;
v14 = v47;
v40[1] = v18;
goto LABEL_23;
}
LOBYTE(v40[0]) = 2 * v17;
v19 = (char *)v40 + 1;
if ( v17 )
LABEL_23:
memmove(v19, v16, v18);
v19[v18] = 0;
CCTextInputNode::setString(v14, (__int64)v40, h_low);
if ( (v40[0] & 1) != 0 )
operator delete(v41);
v21 = (CCTextInputNode *)cocos2d::CCDictionary::objectForKey(a1->m_inputs, 3);
h_low = (__m128)LODWORD(a1->m_hsv.v);
*(double *)h_low.i64 = h_low.f32[0];
v22 = (cocos2d::CCString *)sub_1007AB580("%.2f", __dst[0]);
v23 = cocos2d::CCString::getCString(v22);
v24 = strlen(v23);
if ( v24 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_62;
v25 = v24;
if ( v24 >= 0x17 )
{
v47 = v21;
v32 = 26;
if ( (v24 | 7) != 0x17 )
v32 = (v24 | 7) + 1;
v26 = (char *)operator new(v32);
v43 = v26;
v42[0] = v32 + 1;
v21 = v47;
v42[1] = v25;
}
else
{
LOBYTE(v42[0]) = 2 * v24;
v26 = (char *)v42 + 1;
if ( !v24 )
goto LABEL_42;
}
memmove(v26, v23, v25);
LABEL_42:
v26[v25] = 0;
CCTextInputNode::setString(v21, (__int64)v42, h_low);
if ( (v42[0] & 1) != 0 )
operator delete(v43);
a1->m_updating = 0;
LABEL_58:
a1->m_mixed = 0;
}