//
// ConfigureHSVWidget::setBaseColor from 0x5e4d74 to 0x5e4ed4 (352 bytes)
//
// 2 xrefs:
// > HSVWidgetPopup::init @ 0x5e6022
// > HSVLiveOverlay::createHSVWidget @ 0x69c42c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:19 +0000
//
int __fastcall ConfigureHSVWidget::setBaseColor(int a1, unsigned int a2)
{
int v3; // r2
const char *v4; // r1
int v5; // r2
int v6; // r0
float v7; // s16
float v8; // s16
int v9; // r8
void (__fastcall *v10)(int, _BYTE *); // r9
const char *v11; // r1
int v12; // r0
int v13; // r7
void (__fastcall *v14)(int, _BYTE *); // r9
int v15; // r10
int v16; // r0
char v17; // r3
int v18; // r0
_BYTE v20[8]; // [sp+14h] [bp-14h] BYREF
_BYTE v21[8]; // [sp+1Ch] [bp-Ch] BYREF
int v22; // [sp+24h] [bp-4h]
v3 = _stack_chk_guard;
*(_WORD *)(a1 + 324) = a2;
v4 = (const char *)HIWORD(a2);
v22 = v3;
*(_BYTE *)(a1 + 336) = 1;
v5 = *(_DWORD *)(a1 + 332);
*(_BYTE *)(a1 + 326) = (_BYTE)v4;
if ( !v5 )
{
v6 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v4);
*(_DWORD *)(a1 + 332) = v6;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 80))(v6, 1060320051);
v7 = *(float *)((*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 332) + 164))(*(_DWORD *)(a1 + 332)) + 4);
v8 = v7 * COERCE_FLOAT((*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 332) + 84))(*(_DWORD *)(a1 + 332)));
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)a1 + 228))(a1, *(_DWORD *)(a1 + 332));
v9 = *(_DWORD *)(a1 + 332);
v10 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, 155.0, (float)((float)(v8 * 1.5) - 80.0) + 4.0);
v10(v9, v21);
v12 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v11);
*(_DWORD *)(a1 + 328) = v12;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v12 + 80))(v12, 1060320051);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)a1 + 228))(a1, *(_DWORD *)(a1 + 328));
v13 = *(_DWORD *)(a1 + 328);
v14 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 92);
v15 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 332) + 96))(*(_DWORD *)(a1 + 332));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, 0.0, -v8);
cocos2d::CCPoint::operator+(v21, v15, v20);
v14(v13, v21);
}
v16 = GameToolbox::transformColor(
(unsigned __int8 *)(a1 + 324),
*(float *)(a1 + 292),
*(float *)(a1 + 296),
*(float *)(a1 + 300),
*(_DWORD *)(a1 + 304));
v17 = BYTE1(v16);
v21[0] = v16;
v21[2] = BYTE2(v16);
v18 = *(_DWORD *)(a1 + 328);
v21[1] = v17;
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 480))(v18, v21);
return (*(int (__fastcall **)(_DWORD, _BYTE *))(**(_DWORD **)(a1 + 332) + 480))(*(_DWORD *)(a1 + 332), v21);
}