//
// SetupGradientPopup::onBlending from 0x1006c5be0 to 0x1006c5cfe (286 bytes)
//
// 2 xrefs:
// > sub_1006C4830 @ 0x1006c557c
// > sub_1006C4830 @ 0x1006c5661
//
// 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:35:33 +0000
//
__int64 __fastcall SetupGradientPopup::onBlending(__int64 a1, __int64 a2)
{
int v2; // eax
int v3; // ecx
int v4; // eax
__int64 v5; // rcx
unsigned int v6; // r14d
int v7; // eax
const char *v8; // rsi
v2 = *(_DWORD *)(a1 + 1024) + 2 * ((*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 1) - 1;
v3 = 0;
if ( v2 > 0 )
v3 = v2;
v4 = 3;
if ( v3 < 3 )
v4 = v3;
*(_DWORD *)(a1 + 1024) = v4;
v5 = *(_QWORD *)(a1 + 680);
if ( v5 )
{
*(_DWORD *)(v5 + 1844) = v4;
}
else if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 688)) )
{
v6 = 0;
do
*(_DWORD *)(sub_1007FEFE0(*(_QWORD *)(a1 + 688), v6++) + 1844) = *(_DWORD *)(a1 + 1024);
while ( v6 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 688)) );
}
v7 = *(_DWORD *)(a1 + 1024);
if ( v7 > 1 )
{
if ( v7 == 2 )
{
v8 = "Multiply";
goto LABEL_20;
}
if ( v7 == 3 )
{
v8 = "Invert";
goto LABEL_20;
}
LABEL_17:
v8 = "Normal";
goto LABEL_20;
}
if ( v7 == -99999 )
{
v8 = "Mixed";
goto LABEL_20;
}
if ( v7 != 1 )
goto LABEL_17;
v8 = "Additive";
LABEL_20:
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 1016) + 928LL))(*(_QWORD *)(a1 + 1016), v8);
return cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 1016), 150.0, (__m128)0x3F333333u, (__m128)0LL);
}