//
// SetupAreaTintTriggerPopup::onHSV from 0xa091d8 to 0xa092e8 (272 bytes)
//
// 4 xrefs:
// > ??> @ 0xa0f80
// > SetupAreaTintTriggerPopup::init @ 0xa0f094
// > SetupAreaAnimTriggerPopup::init @ 0xa1191c
// > ??> @ 0x122d870
//
// 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 SetupAreaTintTriggerPopup::onHSV(SetupAreaTintTriggerPopup *a1, cocos2d::CCObject *a2)
{
__int64 v3; // x20
void *v4; // x0
unsigned int *v5; // x2
int v6; // w1
__int64 v7; // [xsp+40h] [xbp+40h] BYREF
sub_D153B8((int)&v7, "Set HSV");
v3 = HSVWidgetPopup::create(
*(_QWORD *)&a1->m_hsvValue.h,
*(_QWORD *)&a1->m_hsvValue.v,
(__int64)&a1->HSVWidgetDelegate);
v4 = (void *)(v7 - 24);
if ( (__int64 *)(v7 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v7 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v7 - 8);
*(_DWORD *)(v7 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 1288LL))(v3);
}