//
// sub_1001454C0 from 0x1001454c0 to 0x100145834 (884 bytes)
//
// 51 xrefs:
// > GJGameState::processStateTriggers @ 0x1000ea751
// > GJBaseGameLayer::stopSFXTrigger @ 0x10011438e
// > GJBaseGameLayer::addProximityVolumeEffect @ 0x10013e03a
// > sub_10014E590 @ 0x10014e64b
// > GJEffectManager::removeTriggeredID @ 0x1002d41e6
// > cocos2d::CCSpriteFrameCache::removeSpriteFramesFromFile @ 0x100308b4f
// > cocos2d::extension::CCControl::removeHandleOfControlEvent @ 0x10033e016
// > GameManager::unloadIcon @ 0x10036bdc0
// > GameManager::unloadIcon @ 0x10036bef6
// > GameManager::unloadIcons @ 0x10036c2c6
// > FMODAudioEngine::updateChannelTweens @ 0x1003ccd2d
// > FMODAudioEngine::loadMusic @ 0x1003ce936
// > FMODAudioEngine::loadMusic @ 0x1003ce9e6
// > FMODAudioEngine::stopChannelTween @ 0x1003d065b
// > FMODAudioEngine::updateChannel @ 0x1003d36ac
// > FMODAudioEngine::startMusic @ 0x1003d4ce9
// > FMODAudioEngine::startMusic @ 0x1003d4d99
// > cocos2d::extension::CCScrollView::dCCScrollView @ 0x1003e42e1
// > cocos2d::extension::CCScrollView::dCCScrollView @ 0x1003e4341
// > cocos2d::extension::CCScrollView::unregisterScriptHandler @ 0x1003e4406
// > cocos2d::extension::CCScrollView::registerScriptHandler @ 0x1003e65a8
// > cocos2d::extension::CCTableView::_moveCellOutOfSight @ 0x100419abe
// > cocos2d::extension::CCTableView::removeCellAtIndex @ 0x100419f68
// > cocos2d::CCFileUtils::removeFullPath @ 0x10042a1bf
// > SFXBrowser::onExitFolder @ 0x10042e1cd
// > sub_10042E9B0 @ 0x10042ec34
// > sub_100432B50 @ 0x100432bdb
// > GameLevelManager::onUploadLevelListCompleted @ 0x10052fac7
// > GameLevelManager::onDeleteServerLevelListCompleted @ 0x10052fcb7
// > sub_10052FD80 @ 0x10052fdf7
// > sub_100530800 @ 0x100530887
// > sub_100530A80 @ 0x100530b0b
// > SelectEventLayer::onCustomToggleTriggerValue @ 0x1005a7806
// > GJKeybindManager::unbindChord @ 0x100617006
// > GJKeybindManager::unbindChord @ 0x10061726f
// > EnterEffectInstance::animateValue @ 0x1006a548e
// > EnterEffectInstance::updateTransitions @ 0x1006a573b
// > CustomSongWidget::loadSongInfoFinished @ 0x1006fcc06
// > CustomSongWidget::loadSongInfoFailed @ 0x1006fce49
// > sub_1008970C0 @ 0x1008974c3
// > sub_1008970C0 @ 0x100897799
// > sub_1008977C0 @ 0x100897a30
// > cocos2d::CCSet::removeObject @ 0x100898d9e
// > KeybindSet::unbindChord @ 0x1009255b1
// > KeybindSet::unbindChord @ 0x100925617
// > NewsPopup::onBlockClicked @ 0x10095aa3e
// > NewsPopup::newsImageDownloaded @ 0x10095b1e7
// > sub_10096DA80 @ 0x10096db4d
// > sub_1009739B0 @ 0x100973b26
// > sub_100981080 @ 0x100981289
// > sub_1009A21E0 @ 0x1009a234f
//
// 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:24:57 +0000
//
__int64 *__fastcall sub_1001454C0(__int64 *a1, __int64 *a2)
{
__int64 v2; // rcx
__int64 *v3; // rdx
__int64 *v4; // rax
__int64 **v5; // r9
char v6; // r8
__int64 *result; // rax
char v8; // r9
_QWORD *v9; // r10
__int64 v10; // r10
__int64 v11; // r10
__int64 **v12; // rcx
__int64 *v13; // rdx
char v14; // si
__int64 *v15; // rdx
__int64 v16; // rsi
__int64 ***v17; // rsi
_QWORD *v18; // rcx
__int64 *v19; // rdx
__int64 *v20; // rsi
__int64 ***v21; // rsi
__int64 *v22; // rcx
_QWORD *v23; // rdx
char v24; // cl
__int64 *v25; // rcx
__int64 v26; // rdx
__int64 **v27; // rdx
__int64 *v28; // rcx
__int64 v29; // rdx
__int64 **v30; // rdx
__int64 v31; // rdx
__int64 **v32; // rdx
__int64 *v33; // rcx
__int64 v34; // rdx
__int64 **v35; // rdx
v2 = *a2;
v3 = a2;
if ( *a2 )
{
v4 = (__int64 *)a2[1];
v3 = a2;
if ( !v4 )
goto LABEL_5;
do
{
v3 = v4;
v4 = (__int64 *)*v4;
}
while ( v4 );
}
v2 = v3[1];
if ( v2 )
{
LABEL_5:
v5 = (__int64 **)v3[2];
*(_QWORD *)(v2 + 16) = v5;
v6 = 0;
result = *v5;
if ( *v5 != v3 )
goto LABEL_6;
goto LABEL_10;
}
v5 = (__int64 **)v3[2];
v6 = 1;
v2 = 0;
result = *v5;
if ( *v5 != v3 )
{
LABEL_6:
v5[1] = (__int64 *)v2;
v8 = *((_BYTE *)v3 + 24);
if ( v3 == a2 )
goto LABEL_7;
LABEL_14:
v9 = (_QWORD *)a2[2];
v3[2] = (__int64)v9;
v9[*v9 != (_QWORD)a2] = v3;
v10 = *a2;
*v3 = *a2;
*(_QWORD *)(v10 + 16) = v3;
v11 = a2[1];
v3[1] = v11;
if ( v11 )
*(_QWORD *)(v11 + 16) = v3;
*((_BYTE *)v3 + 24) = *((_BYTE *)a2 + 24);
if ( a1 == a2 )
a1 = v3;
if ( !a1 )
return result;
goto LABEL_19;
}
LABEL_10:
*v5 = (__int64 *)v2;
if ( v3 == a1 )
{
result = nullptr;
a1 = (__int64 *)v2;
v8 = *((_BYTE *)v3 + 24);
if ( v3 != a2 )
goto LABEL_14;
}
else
{
result = v5[1];
v8 = *((_BYTE *)v3 + 24);
if ( v3 != a2 )
goto LABEL_14;
}
LABEL_7:
if ( !a1 )
return result;
LABEL_19:
if ( !v8 )
return result;
if ( !v6 )
{
*(_BYTE *)(v2 + 24) = 1;
return result;
}
while ( 1 )
{
v12 = (__int64 **)result[2];
v13 = *v12;
v14 = *((_BYTE *)result + 24);
if ( *v12 == result )
break;
if ( !v14 )
{
*((_BYTE *)result + 24) = 1;
*((_BYTE *)v12 + 24) = 0;
v15 = v12[1];
v16 = *v15;
v12[1] = (__int64 *)*v15;
if ( v16 )
*(_QWORD *)(v16 + 16) = v12;
v17 = v12[2];
v15[2] = (__int64)v17;
v17[*v17 != (_QWORD)v12] = v15;
*v15 = (__int64)v12;
v12[2] = v15;
if ( a1 == (__int64 *)*result )
a1 = result;
result = *(__int64 **)(*result + 8);
}
v18 = (_QWORD *)*result;
if ( *result && *((_BYTE *)v18 + 24) != 1 )
{
v19 = (__int64 *)result[1];
if ( !v19 )
goto LABEL_52;
LABEL_51:
if ( *((_BYTE *)v19 + 24) == 1 )
{
LABEL_52:
*((_BYTE *)v18 + 24) = 1;
*((_BYTE *)result + 24) = 0;
v26 = v18[1];
*result = v26;
if ( v26 )
*(_QWORD *)(v26 + 16) = result;
v27 = (__int64 **)result[2];
v18[2] = v27;
v27[*v27 != result] = v18;
v18[1] = result;
result[2] = (__int64)v18;
v19 = result;
}
else
{
v18 = result;
}
result = (__int64 *)v18[2];
*((_BYTE *)v18 + 24) = *((_BYTE *)result + 24);
*((_BYTE *)result + 24) = 1;
*((_BYTE *)v19 + 24) = 1;
v28 = (__int64 *)result[1];
v29 = *v28;
result[1] = *v28;
if ( v29 )
*(_QWORD *)(v29 + 16) = result;
v30 = (__int64 **)result[2];
v28[2] = (__int64)v30;
v30[*v30 != result] = v28;
*v28 = (__int64)result;
result[2] = (__int64)v28;
return result;
}
v19 = (__int64 *)result[1];
if ( v19 && *((_BYTE *)v19 + 24) != 1 )
goto LABEL_51;
*((_BYTE *)result + 24) = 0;
result = (__int64 *)result[2];
if ( result == a1 || !*((_BYTE *)result + 24) )
goto LABEL_49;
LABEL_22:
result = *(__int64 **)(result[2] + 8LL * (*(_QWORD *)result[2] == (_QWORD)result));
}
if ( !v14 )
{
*((_BYTE *)result + 24) = 1;
*((_BYTE *)v12 + 24) = 0;
v20 = v13[1];
*v12 = (__int64 *)v20;
if ( v20 )
*(_QWORD *)(v20 + 16) = v12;
v21 = v12[2];
v13[2] = (__int64)v21;
v21[*v21 != (_QWORD)v12] = v13;
v13[1] = (__int64)v12;
v12[2] = v13;
v22 = (__int64 *)result[1];
if ( a1 == v22 )
a1 = result;
result = (__int64 *)*v22;
}
v23 = (_QWORD *)*result;
if ( *result )
{
v24 = *((_BYTE *)v23 + 24);
if ( v24 != 1 )
goto LABEL_61;
}
v25 = (__int64 *)result[1];
if ( !v25 || *((_BYTE *)v25 + 24) == 1 )
{
*((_BYTE *)result + 24) = 0;
result = (__int64 *)result[2];
if ( *((_BYTE *)result + 24) != 1 || result == a1 )
{
LABEL_49:
*((_BYTE *)result + 24) = 1;
return result;
}
goto LABEL_22;
}
if ( !v23 )
goto LABEL_63;
v24 = *((_BYTE *)v23 + 24);
LABEL_61:
if ( (v24 & 1) != 0 )
{
v25 = (__int64 *)result[1];
LABEL_63:
*((_BYTE *)v25 + 24) = 1;
*((_BYTE *)result + 24) = 0;
v31 = *v25;
result[1] = *v25;
if ( v31 )
*(_QWORD *)(v31 + 16) = result;
v32 = (__int64 **)result[2];
v25[2] = (__int64)v32;
v32[*v32 != result] = v25;
*v25 = (__int64)result;
result[2] = (__int64)v25;
v23 = result;
}
else
{
v25 = result;
}
result = (__int64 *)v25[2];
*((_BYTE *)v25 + 24) = *((_BYTE *)result + 24);
*((_BYTE *)result + 24) = 1;
*((_BYTE *)v23 + 24) = 1;
v33 = (__int64 *)*result;
v34 = *(_QWORD *)(*result + 8);
*result = v34;
if ( v34 )
*(_QWORD *)(v34 + 16) = result;
v35 = (__int64 **)result[2];
v33[2] = (__int64)v35;
v35[*v35 != result] = v33;
v33[1] = (__int64)result;
result[2] = (__int64)v33;
return result;
}