//
// GameLevelManager::setDiffVal from 0x10055a840 to 0x10055a93d (253 bytes)
//
// 2 xrefs:
// > LevelSearchLayer::toggleDifficulty @ 0x10062b1b3
// > LevelSearchLayer::toggleDifficultyNum @ 0x10062b6c2
//
// 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 __fastcall GameLevelManager::setDiffVal(GameLevelManager *a1, int a2, bool a3)
{
double v3; // xmm0_8
cocos2d::CCDictionary *m_searchFilters; // rbx
cocos2d::CCObject *v5; // r14
cocos2d::CCString *v6; // rax
const char *CString; // r12
size_t v8; // rax
size_t v9; // r15
char *v10; // r13
cocos2d::CCDictionary *v11; // r14
size_t v12; // rbx
char v13; // [rsp+0h] [rbp-50h]
char v14; // [rsp+0h] [rbp-50h]
cocos2d::CCObject *v15; // [rsp+8h] [rbp-48h]
_QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
m_searchFilters = a1->m_searchFilters;
v5 = (cocos2d::CCObject *)sub_1007AB580("%i", v13);
v6 = (cocos2d::CCString *)sub_1007AB580("Diff%i", v14);
CString = cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v9 = v8;
if ( v8 >= 0x17 )
{
v15 = v5;
v11 = m_searchFilters;
v12 = 26;
if ( (v8 | 7) != 0x17 )
v12 = (v8 | 7) + 1;
v10 = (char *)operator new(v12);
__p = v10;
__dst[0] = v12 + 1;
m_searchFilters = v11;
v5 = v15;
__dst[1] = v9;
goto LABEL_8;
}
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( v8 )
LABEL_8:
memmove(v10, CString, v9);
v10[v9] = 0;
cocos2d::CCDictionary::setObject_1((__int64)m_searchFilters, v5, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}