//
// sub_10001C120 from 0x10001c120 to 0x10001c2b9 (409 bytes)
//
// 119 xrefs:
// > EditorUI::dynamicGroupUpdate @ 0x100015d4a
// > LevelEditorLayer::removeSpecial @ 0x1000b1d9f
// > DrawGridLayer::removeAudioLineObject @ 0x1000bd44c
// > GJGameState::tweenValue @ 0x1000ea103
// > GJGameState::stopTweenAction @ 0x1000ea186
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x1000f63fd
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x1000f640c
// > GJBaseGameLayer::toggleFlipped @ 0x100102084
// > GJBaseGameLayer::animateInDualGroundNew @ 0x1001028c0
// > GJBaseGameLayer::animateInDualGroundNew @ 0x100102978
// > GJBaseGameLayer::animateOutGroundNew @ 0x100102aa3
// > GJBaseGameLayer::animateOutGroundNew @ 0x100102ab6
// > GJBaseGameLayer::animateOutGroundNew @ 0x100102b36
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102d19
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102db9
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102e64
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102ef7
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102f6a
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100102f96
// > GJBaseGameLayer::resetStaticCamera @ 0x100102fe9
// > GJBaseGameLayer::resetStaticCamera @ 0x100102ffc
// > GJBaseGameLayer::resetStaticCamera @ 0x10010304d
// > GJBaseGameLayer::resetStaticCamera @ 0x100103060
// > GJBaseGameLayer::addToGroupParents @ 0x10011b7de
// > GJBaseGameLayer::reAddToStickyGroup @ 0x10011c783
// > GJBaseGameLayer::processAreaEffects @ 0x10011ef7f
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c3ac
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c3bf
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c477
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c48a
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c4cf
// > GJBaseGameLayer::loadStartPosObject @ 0x10012c4e2
// > GJBaseGameLayer::updateZoom @ 0x10012ca31
// > GJBaseGameLayer::updateZoom @ 0x10012cab3
// > GJBaseGameLayer::updateScreenRotation @ 0x10012cba6
// > GJBaseGameLayer::updateScreenRotation @ 0x10012cd39
// > GJBaseGameLayer::updateCameraOffsetX @ 0x10012cdc3
// > GJBaseGameLayer::updateCameraOffsetX @ 0x10012ce35
// > GJBaseGameLayer::updateCameraOffsetY @ 0x10012cec3
// > GJBaseGameLayer::updateCameraOffsetY @ 0x10012cf35
// > GJBaseGameLayer::updateMGOffsetY @ 0x10012d16b
// > GJBaseGameLayer::updateMGOffsetY @ 0x10012d1dd
// > GJBaseGameLayer::updateCamera @ 0x1001333c9
// > GJBaseGameLayer::updateCamera @ 0x10013349f
// > GJBaseGameLayer::updateCamera @ 0x10013352b
// > GJBaseGameLayer::updateCamera @ 0x100133733
// > GJBaseGameLayer::resetLevelVariables @ 0x100138c3f
// > GJBaseGameLayer::resetLevelVariables @ 0x100138dc4
// > GJBaseGameLayer::removeTemporaryParticles @ 0x10013924a
// > GJBaseGameLayer::resetCamera @ 0x1001393c2
// > GJBaseGameLayer::resetCamera @ 0x100139429
// > GJBaseGameLayer::resetCamera @ 0x100139456
// > GJBaseGameLayer::resetCamera @ 0x1001394a5
// > GJBaseGameLayer::resetCamera @ 0x1001394d2
// > GJBaseGameLayer::resetCamera @ 0x100139556
// > GJBaseGameLayer::resetCamera @ 0x100139569
// > GJBaseGameLayer::resetCamera @ 0x1001395ae
// > GJBaseGameLayer::resetCamera @ 0x1001395c1
// > GJBaseGameLayer::moveCameraToPos @ 0x10013b0ce
// > GJBaseGameLayer::moveCameraToPos @ 0x10013b181
// > GJBaseGameLayer::cameraMoveX @ 0x10013b22b
// > GJBaseGameLayer::cameraMoveY @ 0x10013b305
// > GJBaseGameLayer::updateInternalCamOffsetX @ 0x10013b3c8
// > GJBaseGameLayer::updateInternalCamOffsetX @ 0x10013b43d
// > GJBaseGameLayer::updateInternalCamOffsetY @ 0x10013b4b8
// > GJBaseGameLayer::updateInternalCamOffsetY @ 0x10013b52d
// > GJBaseGameLayer::animatePortalY @ 0x10013b5aa
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b71e
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b789
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b83d
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b894
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013b94d
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10013ba25
// > GJBaseGameLayer::exitStaticCamera @ 0x10013bc72
// > GJBaseGameLayer::exitStaticCamera @ 0x10013be05
// > GJBaseGameLayer::updateParticles @ 0x10013db9e
// > GJEffectManager::resetEffects @ 0x1002c8636
// > GJEffectManager::transferPersistentItems @ 0x1002caa8f
// > GJEffectManager::handleObjectCollision @ 0x1002cafa5
// > GJEffectManager::toggleGroup @ 0x1002cb377
// > GJEffectManager::runOpacityActionOnGroup @ 0x1002d2ba9
// > GJEffectManager::updateOpacityAction @ 0x1002d2dcd
// > GJEffectManager::playerButton @ 0x1002d462b
// > GJEffectManager::updateCountForItem @ 0x1002d4e7d
// > GJEffectManager::updateCountForItem @ 0x1002d54b9
// > sub_1002D6D20 @ 0x1002d6de0
// > GJEffectManager::toggleItemPersistent @ 0x1002d7047
// > GJEffectManager::toggleTimerPersistent @ 0x1002d722c
// > GJEffectManager::setFollowing @ 0x1002d8aa4
// > GJEffectManager::loadFromState @ 0x1002da170
// > GJShaderState::tweenValue @ 0x1003b2f44
// > GJShaderState::stopTweenAction @ 0x1003b300f
// > ShaderLayer::tweenValueAuto @ 0x1003b7158
// > ShaderLayer::tweenValueAuto @ 0x1003b75cd
// > ShaderLayer::tweenValue @ 0x1003bb3f0
// > FMODAudioEngine::playEffectAdvanced @ 0x1003cfb58
// > FMODAudioEngine::playEffectAdvanced @ 0x1003cfb68
// > FMODAudioEngine::unregisterChannel @ 0x1003d2471
// > FMODAudioEngine::unregisterChannel @ 0x1003d2480
// > FMODAudioEngine::unregisterChannel @ 0x1003d2626
// > FMODAudioEngine::unregisterChannel @ 0x1003d2636
// > PlayerObject::unrotateGameplayObject @ 0x1003f876d
// > GameLevelManager::deleteLevel @ 0x10053edf4
// > GameLevelManager::deleteLevel @ 0x10053ee12
// > sub_10053F020 @ 0x10053f03f
// > sub_10053F020 @ 0x10053f060
// > sub_1005533D0 @ 0x100553a27
// > sub_100554850 @ 0x10055487f
// > sub_100554850 @ 0x10055489d
// > sub_100650690 @ 0x1006506ae
// > sub_100650820 @ 0x10065083f
// > sub_1006509B0 @ 0x1006509ce
// > sub_1006546E0 @ 0x100654932
// > EditorSFXManager::deserializeAll @ 0x1008e1cdb
// > EditorSFXManager::removeSoundAt @ 0x1008e37f5
// > EditorSFXManager::removeSoundAt @ 0x1008e3801
// > EditorSFXManager::removeSoundAt @ 0x1008e384b
// > sub_1008E3A60 @ 0x1008e3aa8
// > sub_1008E3AC0 @ 0x1008e3ad3
//
// 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:18:56 +0000
//
__int64 __fastcall sub_10001C120(__int64 *a1, int *a2)
{
unsigned __int64 v2; // r11
unsigned __int64 v4; // rcx
unsigned __int64 v5; // rsi
__int64 v6; // rdi
__int64 *v8; // rax
__int64 v9; // r9
unsigned __int64 v10; // r11
__int64 v11; // rax
unsigned __int64 v12; // rax
void *v13; // rdi
void *v14; // [rsp-20h] [rbp-20h] BYREF
v2 = a1[1];
if ( !v2 )
return 0;
v4 = *a2;
v5 = (0x101010101010101LL
* ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v5 > 1 )
{
v6 = v4;
if ( v2 <= v4 )
{
if ( (v2 | v4) >> 32 )
v6 = v4 % v2;
else
v6 = (unsigned int)v4 % (unsigned int)v2;
}
}
else
{
v6 = v4 & (v2 - 1);
}
v8 = *(__int64 **)(*a1 + 8 * v6);
if ( !v8 )
return 0;
v9 = *v8;
if ( !*v8 )
return 0;
if ( (unsigned int)v5 < 2 )
{
v10 = v2 - 1;
while ( 1 )
{
v11 = *(_QWORD *)(v9 + 8);
if ( v11 == v4 )
{
if ( *(_DWORD *)(v9 + 16) == (_DWORD)v4 )
goto LABEL_30;
}
else if ( (v10 & v11) != v6 )
{
return 0;
}
v9 = *(_QWORD *)v9;
if ( !v9 )
return 0;
}
}
while ( 1 )
{
v12 = *(_QWORD *)(v9 + 8);
if ( v12 == v4 )
break;
if ( v12 < v2 )
goto LABEL_26;
if ( (v2 | v12) >> 32 )
{
v12 %= v2;
LABEL_26:
if ( v12 != v6 )
return 0;
goto LABEL_21;
}
if ( (unsigned int)v12 % (unsigned int)v2 != v6 )
return 0;
LABEL_21:
v9 = *(_QWORD *)v9;
if ( !v9 )
return 0;
}
if ( *(_DWORD *)(v9 + 16) != (_DWORD)v4 )
goto LABEL_21;
LABEL_30:
sub_10001AE30((__int64)&v14, a1, (__int64 *)v9);
v13 = v14;
v14 = nullptr;
if ( v13 )
operator delete(v13);
return 1;
}