//
// HSVWidgetPopup::create from 0x10041c570 to 0x10041c791 (545 bytes)
//
// 4 xrefs:
// > CustomizeObjectLayer::onHSV @ 0x1001d9ca0
// > CustomizeObjectLayer::onHSV @ 0x1001d9ce4
// > sub_1003E0420 @ 0x1003e0461
// > sub_1004D3F30 @ 0x1004d3f71
//
// 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:30:13 +0000
//
char *__fastcall HSVWidgetPopup::create(__int64 a1, unsigned int a2, __int64 a3, __int128 *a4, double a5)
{
char *v7; // rbx
char v8; // r14
__int128 v10; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v7 = (char *)operator new(0x2A8u);
cocos2d::CCLayerColor::CCLayerColor(v7);
*(_QWORD *)v7 = off_100B4FB70;
*((_QWORD *)v7 + 40) = off_100B500C0;
*((_QWORD *)v7 + 41) = &off_100B50130;
*((_QWORD *)v7 + 42) = off_100B50148;
*((_QWORD *)v7 + 43) = off_100B50168;
*((_QWORD *)v7 + 44) = off_100B50190;
*((_QWORD *)v7 + 51) = off_100B501C0;
*((_QWORD *)v7 + 54) = off_100B50240;
*((_QWORD *)v7 + 68) = off_100B50260;
*(_OWORD *)(v7 + 552) = 0;
*(_OWORD *)(v7 + 561) = 0;
*(_OWORD *)(v7 + 584) = 0;
sub_1002782A0((_QWORD *)v7 + 75);
*((_OWORD *)v7 + 38) = 0;
*((_QWORD *)v7 + 78) = 0;
*((_DWORD *)v7 + 158) = -1;
*((_WORD *)v7 + 318) = 0;
*((_DWORD *)v7 + 160) = -1;
v7[644] = 0;
*((_QWORD *)v7 + 81) = 0;
v7[656] = 0;
*(_QWORD *)v7 = off_100B40300;
*((_QWORD *)v7 + 40) = off_100B40850;
*((_QWORD *)v7 + 41) = &off_100B408C0;
*((_QWORD *)v7 + 42) = off_100B408D8;
*((_QWORD *)v7 + 43) = off_100B408F8;
*((_QWORD *)v7 + 44) = off_100B40920;
*((_QWORD *)v7 + 51) = off_100B40950;
*((_QWORD *)v7 + 54) = off_100B409D0;
*((_QWORD *)v7 + 68) = off_100B409F0;
if ( (*(_BYTE *)a4 & 1) != 0 )
{
sub_10001AD30(&v10, *((const void **)a4 + 2), *((_QWORD *)a4 + 1));
}
else
{
__p = *((void **)a4 + 2);
v10 = *a4;
}
v8 = HSVWidgetPopup::init(v7, a1, a2, a3, &v10, a5);
if ( (v10 & 1) != 0 )
operator delete(__p);
if ( v8 )
{
cocos2d::CCObject::autorelease(v7);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v7 + 16LL))(v7);
return nullptr;
}
return v7;
}