//
// SetupShaderEffectPopup::setupInvertColor from 0x1405e8730 to 0x1405e8d8a (1626 bytes)
//
// 2 xrefs:
// > SetupShaderEffectPopup::init @ 0x1405dfb3d
// > ??> @ 0x14092eeb0
//
// 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 11:35:03 +0000
//
// Hidden C++ exception states: #wind=3
double __fastcall SetupShaderEffectPopup::setupInvertColor(__int64 a1)
{
_QWORD *v2; // r9
_QWORD *v3; // rcx
const char *v4; // rdx
__int64 v5; // r8
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
int v17; // r8d
int v18; // r9d
__int128 *v20; // [rsp+48h] [rbp-49h] BYREF
__int128 *v21; // [rsp+50h] [rbp-41h] BYREF
__int128 v22; // [rsp+58h] [rbp-39h] BYREF
__int64 v23; // [rsp+68h] [rbp-29h]
__int64 v24; // [rsp+70h] [rbp-21h]
__int128 v25; // [rsp+78h] [rbp-19h] BYREF
__int64 v26; // [rsp+88h] [rbp-9h]
__int64 v27; // [rsp+90h] [rbp-1h]
char v28; // [rsp+100h] [rbp+6Fh] BYREF
float v29; // [rsp+108h] [rbp+77h] BYREF
float v30; // [rsp+10Ch] [rbp+7Bh]
__int128 *v31; // [rsp+110h] [rbp+7Fh] BYREF
v22 = 0;
*(_QWORD *)&v22 = sub_14003D460(0x20u);
v23 = 18;
v24 = 31;
strcpy((char *)v22, "Setup Invert Color");
SetupTriggerPopup::addTitle(a1, &v22);
v31 = &v22;
v22 = 0;
v23 = 0;
v24 = 0;
v2 = sub_14003D460(0x1B0u);
*(_QWORD *)&v22 = v2;
v23 = 429;
v24 = 431;
v3 = v2;
v4 = "Inverts colors on the screen.\n"
"Target is how much of the filter to apply.\n"
"FadeTime is time until final state is reached.\n"
"R, G, and B let you customize the filter color.\n"
"EditRGB allows editing the above values.\n"
"TweenRGB makes transitions smoother.\n"
"ClampRGB limits these values to 1.\n"
"Tip: Use ClampRGB and set an R, G or B value\n"
"over 1 to avoid the middle grey effect.";
v5 = 3;
do
{
*(_OWORD *)v3 = *(_OWORD *)v4;
*((_OWORD *)v3 + 1) = *((_OWORD *)v4 + 1);
*((_OWORD *)v3 + 2) = *((_OWORD *)v4 + 2);
*((_OWORD *)v3 + 3) = *((_OWORD *)v4 + 3);
*((_OWORD *)v3 + 4) = *((_OWORD *)v4 + 4);
*((_OWORD *)v3 + 5) = *((_OWORD *)v4 + 5);
*((_OWORD *)v3 + 6) = *((_OWORD *)v4 + 6);
v3 += 16;
*((_OWORD *)v3 - 1) = *((_OWORD *)v4 + 7);
v4 += 128;
--v5;
}
while ( v5 );
*(_OWORD *)v3 = *(_OWORD *)v4;
*((_OWORD *)v3 + 1) = *((_OWORD *)v4 + 1);
v3[4] = *((_QWORD *)v4 + 4);
*((_DWORD *)v3 + 10) = *((_DWORD *)v4 + 10);
*((_BYTE *)v3 + 44) = v4[44];
*((_BYTE *)v2 + 429) = 0;
v25 = 0;
v26 = 4;
v27 = 15;
strcpy((char *)&v25, "Help");
SetupTriggerPopup::addHelpButton(a1, &v25, &v22);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v29);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, v29 * 0.5, (float)(v30 * 0.5) + 90.0);
v20 = &v22;
v23 = 7;
v24 = 15;
v22 = 0x3A746567726154uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, -100.0, 0.0);
cocos2d::CCPoint::operator+(&v28, &v31, v8);
SetupTriggerPopup::createValueControl(a1, 176, (unsigned int)&v22, (unsigned int)&v31, 1060320051, 0, 0);
v21 = &v22;
*((_QWORD *)&v22 + 1) = 58;
v23 = 9;
v24 = 15;
*(_QWORD *)&v22 = 0x656D695465646146LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 100.0, 0.0);
cocos2d::CCPoint::operator+(&v28, &v31, v9);
SetupTriggerPopup::createValueControl(a1, 10, (unsigned int)&v22, (unsigned int)&v31, 1060320051, 0, 0);
v21 = &v25;
v25 = 0;
v26 = 2;
v27 = 15;
strcpy((char *)&v25, "R:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -130.0, -50.0);
cocos2d::CCPoint::operator+(&v28, &v31, v10);
SetupTriggerPopup::createValueControl(a1, 179, (unsigned int)&v25, (unsigned int)&v31, 1058642330, 0, 0);
v21 = &v25;
v25 = 0;
v26 = 2;
v27 = 15;
strcpy((char *)&v25, "G:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v28, &v31, v11);
SetupTriggerPopup::createValueControl(a1, 180, (unsigned int)&v25, (unsigned int)&v31, 1058642330, 0, 0);
v21 = &v25;
v25 = 0;
v26 = 2;
v27 = 15;
strcpy((char *)&v25, "B:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 130.0, -50.0);
cocos2d::CCPoint::operator+(&v28, &v31, v12);
SetupTriggerPopup::createValueControl(a1, 189, (unsigned int)&v25, (unsigned int)&v31, 1058642330, 0, 0);
v21 = &v22;
v23 = 7;
v24 = 15;
v22 = 0x42475274696445uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -130.0, -105.0);
cocos2d::CCPoint::operator+(&v28, &v31, v13);
SetupTriggerPopup::createToggleValueControl(a1, 188, (unsigned int)&v22, (unsigned int)&v31, 0, 0, 0, 1065353216);
v21 = &v25;
v26 = 8;
v27 = 15;
v25 = 0x4247526E65657754uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -30.0, -105.0);
cocos2d::CCPoint::operator+(&v28, &v31, v14);
SetupTriggerPopup::createToggleValueControl(a1, 190, (unsigned int)&v25, (unsigned int)&v31, 0, 0, 0, 1065353216);
v21 = &v25;
v26 = 8;
v27 = 15;
v25 = 0x424752706D616C43uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 70.0, -105.0);
cocos2d::CCPoint::operator+(&v28, &v31, v15);
SetupTriggerPopup::createToggleValueControl(a1, 194, (unsigned int)&v25, (unsigned int)&v31, 0, 0, 0, 1065353216);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, 0.0, -140.0);
cocos2d::CCPoint::operator+(&v28, &v31, v16);
return SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v31, v17, v18, 0);
}