//
// LevelSettingsObject::setupColorsFromLegacyMode from 0x1000ddeb0 to 0x1000de738 (2184 bytes)
//
// 1 xrefs:
// > LevelSettingsObject::objectFromDict @ 0x1000dccd6
//
// 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:21:01 +0000
//
__int64 __fastcall LevelSettingsObject::setupColorsFromLegacyMode(__int64 a1, __int64 a2)
{
__int64 v2; // r12
__int64 v3; // rax
__int64 v4; // rax
__int16 v5; // bx
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rbx
__int64 v11; // rax
unsigned __int8 v12; // r14
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int16 v17; // r15
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rax
int v25; // ebx
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
int v29; // r13d
int v30; // edx
int v31; // ecx
int v32; // eax
int v33; // r15d
int v34; // ebx
__int64 v35; // rax
int v36; // r14d
__int64 v37; // rax
int v38; // r15d
__int64 v39; // rax
int v40; // r13d
__int64 v41; // rax
__int64 v42; // rax
__int64 v43; // rax
__int64 v44; // rax
__int64 v45; // rax
__int64 ColorAction; // rax
__int64 v47; // rax
__int64 v48; // rax
__int64 v49; // rax
__int64 v50; // rax
__int64 v51; // rax
__int64 v52; // rax
__int64 result; // rax
unsigned __int8 v54; // [rsp+10h] [rbp-90h]
char v55; // [rsp+14h] [rbp-8Ch]
unsigned __int8 v56; // [rsp+18h] [rbp-88h]
__int16 v57; // [rsp+1Ch] [rbp-84h]
char v58; // [rsp+20h] [rbp-80h]
__int16 v59; // [rsp+24h] [rbp-7Ch]
unsigned __int8 v60; // [rsp+30h] [rbp-70h]
int v61; // [rsp+30h] [rbp-70h]
__int16 v62; // [rsp+34h] [rbp-6Ch]
int v63; // [rsp+34h] [rbp-6Ch]
int v64; // [rsp+38h] [rbp-68h]
int v65; // [rsp+38h] [rbp-68h]
unsigned __int8 v66; // [rsp+3Ch] [rbp-64h]
char v67; // [rsp+3Ch] [rbp-64h]
__int16 v68; // [rsp+40h] [rbp-60h]
unsigned __int8 v69; // [rsp+44h] [rbp-5Ch]
__int16 v70; // [rsp+48h] [rbp-58h]
__int16 v71; // [rsp+4Ch] [rbp-54h]
int v72; // [rsp+4Ch] [rbp-54h]
int v73; // [rsp+50h] [rbp-50h]
int v74; // [rsp+50h] [rbp-50h]
unsigned __int8 v75; // [rsp+54h] [rbp-4Ch]
int v76; // [rsp+54h] [rbp-4Ch]
int v77; // [rsp+54h] [rbp-4Ch]
int v78; // [rsp+58h] [rbp-48h]
int v79; // [rsp+58h] [rbp-48h]
char v80; // [rsp+5Fh] [rbp-41h]
char v81; // [rsp+60h] [rbp-40h] BYREF
char v82[15]; // [rsp+61h] [rbp-3Fh] BYREF
void *__p; // [rsp+70h] [rbp-30h]
v2 = a2;
v81 = 6;
strcpy(v82, "kS1");
v3 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v54 = cocos2d::CCString::intValue(v3);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS2");
v4 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v5 = cocos2d::CCString::intValue(v4);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS3");
v6 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v55 = cocos2d::CCString::intValue(v6);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS4");
v7 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v56 = cocos2d::CCString::intValue(v7);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS5");
v8 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v57 = cocos2d::CCString::intValue(v8);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS6");
v9 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v58 = cocos2d::CCString::intValue(v9);
v59 = v5;
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS7");
v10 = cocos2d::CCDictionary::objectForKey(a2, &v81);
if ( (v81 & 1) != 0 )
operator delete(__p);
if ( v10 )
{
v81 = 6;
strcpy(v82, "kS7");
v11 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v12 = cocos2d::CCString::intValue(v11);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS8");
v13 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v71 = cocos2d::CCString::intValue(v13);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kS9");
v14 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v73 = cocos2d::CCString::intValue(v14);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS10");
v15 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v75 = cocos2d::CCString::intValue(v15);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS11");
v16 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v17 = cocos2d::CCString::intValue(v16);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS12");
v18 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v78 = cocos2d::CCString::intValue(v18);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS13");
v19 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v60 = cocos2d::CCString::intValue(v19);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS14");
v20 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v62 = cocos2d::CCString::intValue(v20);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS15");
v21 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v64 = cocos2d::CCString::intValue(v21);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS21");
v22 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v66 = cocos2d::CCString::intValue(v22);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS22");
v23 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v68 = cocos2d::CCString::intValue(v23);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS23");
v24 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v25 = cocos2d::CCString::intValue(v24);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS24");
v26 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v69 = cocos2d::CCString::intValue(v26);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS25");
v27 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v70 = cocos2d::CCString::intValue(v27);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS26");
v28 = cocos2d::CCDictionary::valueForKey(a2, &v81);
v29 = cocos2d::CCString::intValue(v28);
v30 = (v78 << 16) | (unsigned __int16)(v17 << 8);
v31 = (v64 << 16) | (unsigned __int16)(v62 << 8);
v32 = (v25 << 16) | (unsigned __int16)(v68 << 8);
v33 = v75;
if ( (v81 & 1) != 0 )
{
v76 = v30;
operator delete(__p);
v30 = v76;
v31 = (v64 << 16) | (unsigned __int16)(v62 << 8);
v32 = (v25 << 16) | (unsigned __int16)(v68 << 8);
}
v79 = v12 | (v73 << 16) | (unsigned __int16)(v71 << 8);
v77 = v33 | v30;
v74 = v60 | v31;
v72 = v66 | v32;
v34 = (v29 << 16) | (unsigned __int16)(v70 << 8) | v69;
v2 = a2;
}
else
{
v34 = 0xFFFFFF;
v72 = 0xFFFFFF;
v74 = 0xFFFFFF;
v77 = 0xFFFFFF;
v79 = 0xFFFFFF;
}
v81 = 8;
strcpy(v82, "kS16");
v35 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v36 = cocos2d::CCString::intValue(v35);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS17");
v37 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v38 = cocos2d::CCString::intValue(v37);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS18");
v39 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v40 = cocos2d::CCString::intValue(v39);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS19");
v41 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v61 = cocos2d::CCString::intValue(v41);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS20");
v42 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v63 = cocos2d::CCString::intValue(v42);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kS28");
v43 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v65 = cocos2d::CCString::intValue(v43);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 6;
strcpy(v82, "kA5");
v44 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v67 = cocos2d::CCString::boolValue(v44);
if ( (v81 & 1) != 0 )
operator delete(__p);
v81 = 8;
strcpy(v82, "kA12");
v45 = cocos2d::CCDictionary::valueForKey(v2, &v81);
v80 = cocos2d::CCString::boolValue(v45);
if ( (v81 & 1) != 0 )
operator delete(__p);
ColorAction = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 1000);
*(_BYTE *)(ColorAction + 74) = v55;
*(_WORD *)(ColorAction + 72) = (v59 << 8) | v54;
*(_DWORD *)(ColorAction + 88) = v36;
v47 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 1001);
*(_BYTE *)(v47 + 74) = v58;
*(_WORD *)(v47 + 72) = (v57 << 8) | v56;
*(_DWORD *)(v47 + 88) = v38;
v48 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 1002);
*(_BYTE *)(v48 + 74) = BYTE2(v79);
*(_WORD *)(v48 + 72) = v79;
*(_DWORD *)(v48 + 88) = v40;
*(_BYTE *)(v48 + 84) = 1;
v49 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 1004);
*(_BYTE *)(v49 + 74) = BYTE2(v77);
*(_WORD *)(v49 + 72) = v77;
*(_DWORD *)(v49 + 88) = v61;
v50 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 1);
*(_BYTE *)(v50 + 74) = BYTE2(v74);
*(_WORD *)(v50 + 72) = v74;
*(_DWORD *)(v50 + 88) = v63;
*(_BYTE *)(v50 + 84) = v67;
v51 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 2);
*(_BYTE *)(v51 + 74) = BYTE2(v72);
*(_WORD *)(v51 + 72) = v72;
*(_DWORD *)(v51 + 88) = v65;
v52 = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 3);
*(_BYTE *)(v52 + 74) = BYTE2(v34);
*(_WORD *)(v52 + 72) = v34;
*(_BYTE *)(v52 + 84) = v80;
result = GJEffectManager::getColorAction(*(_QWORD *)(a1 + 320), 4);
*(_BYTE *)(result + 74) = -1;
*(_WORD *)(result + 72) = -1;
return result;
}