//
// sub_1000569A0 from 0x1000569a0 to 0x100056b39 (409 bytes)
//
// 98 xrefs:
// > EditorUI::dynamicGroupUpdate @ 0x100044c7a
// > LevelEditorLayer::removeSpecial @ 0x1000e259f
// > DrawGridLayer::removeAudioLineObject @ 0x1000ea94c
// > GJGameState::tweenValue @ 0x10010e083
// > GJGameState::stopTweenAction @ 0x10010e106
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x10011a23d
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x10011a24c
// > GJBaseGameLayer::animateInDualGroundNew @ 0x100124e50
// > GJBaseGameLayer::animateInDualGroundNew @ 0x100124f08
// > GJBaseGameLayer::animateOutGroundNew @ 0x100125033
// > GJBaseGameLayer::animateOutGroundNew @ 0x100125046
// > GJBaseGameLayer::animateOutGroundNew @ 0x1001250c6
// > GJBaseGameLayer::updateStaticCameraPos @ 0x1001252a9
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100125349
// > GJBaseGameLayer::updateStaticCameraPos @ 0x1001253f4
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100125487
// > GJBaseGameLayer::updateStaticCameraPos @ 0x1001254fa
// > GJBaseGameLayer::updateStaticCameraPos @ 0x100125526
// > GJBaseGameLayer::resetStaticCamera @ 0x100125579
// > GJBaseGameLayer::resetStaticCamera @ 0x10012558c
// > GJBaseGameLayer::resetStaticCamera @ 0x1001255dd
// > GJBaseGameLayer::resetStaticCamera @ 0x1001255f0
// > GJBaseGameLayer::toggleFlipped @ 0x1001280c4
// > GJBaseGameLayer::reAddToStickyGroup @ 0x10013e3f3
// > GJBaseGameLayer::processAreaEffects @ 0x10014098f
// > GJBaseGameLayer::loadStartPosObject @ 0x10014e5ab
// > GJBaseGameLayer::loadStartPosObject @ 0x10014e5be
// > GJBaseGameLayer::loadStartPosObject @ 0x10014e603
// > GJBaseGameLayer::loadStartPosObject @ 0x10014e616
// > GJBaseGameLayer::updateZoom @ 0x10014eb41
// > GJBaseGameLayer::updateZoom @ 0x10014ebc3
// > GJBaseGameLayer::updateScreenRotation @ 0x10014ecb6
// > GJBaseGameLayer::updateScreenRotation @ 0x10014ee49
// > GJBaseGameLayer::updateCameraOffsetX @ 0x10014eed3
// > GJBaseGameLayer::updateCameraOffsetX @ 0x10014ef45
// > GJBaseGameLayer::updateCameraOffsetY @ 0x10014efd3
// > GJBaseGameLayer::updateCameraOffsetY @ 0x10014f045
// > GJBaseGameLayer::updateMGOffsetY @ 0x10014f2db
// > GJBaseGameLayer::updateMGOffsetY @ 0x10014f34d
// > GJBaseGameLayer::updateCamera @ 0x1001554ea
// > GJBaseGameLayer::updateCamera @ 0x1001555c6
// > GJBaseGameLayer::updateCamera @ 0x100155637
// > GJBaseGameLayer::updateCamera @ 0x10015583f
// > GJBaseGameLayer::resetLevelVariables @ 0x10015977f
// > GJBaseGameLayer::resetLevelVariables @ 0x100159904
// > GJBaseGameLayer::removeTemporaryParticles @ 0x100159d7a
// > GJBaseGameLayer::resetCamera @ 0x100159ef2
// > GJBaseGameLayer::resetCamera @ 0x100159f59
// > GJBaseGameLayer::resetCamera @ 0x100159f86
// > GJBaseGameLayer::resetCamera @ 0x100159fd5
// > GJBaseGameLayer::resetCamera @ 0x10015a002
// > GJBaseGameLayer::resetCamera @ 0x10015a086
// > GJBaseGameLayer::resetCamera @ 0x10015a099
// > GJBaseGameLayer::resetCamera @ 0x10015a0de
// > GJBaseGameLayer::resetCamera @ 0x10015a0f1
// > GJBaseGameLayer::moveCameraToPos @ 0x10015bb6e
// > GJBaseGameLayer::moveCameraToPos @ 0x10015bc21
// > GJBaseGameLayer::cameraMoveX @ 0x10015bccb
// > GJBaseGameLayer::cameraMoveY @ 0x10015bda5
// > GJBaseGameLayer::updateInternalCamOffsetX @ 0x10015be68
// > GJBaseGameLayer::updateInternalCamOffsetX @ 0x10015bedd
// > GJBaseGameLayer::updateInternalCamOffsetY @ 0x10015bf58
// > GJBaseGameLayer::updateInternalCamOffsetY @ 0x10015bfcd
// > GJBaseGameLayer::animatePortalY @ 0x10015c04a
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c1dc
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c247
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c2fc
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c353
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c484
// > GJBaseGameLayer::updateStaticCameraPosToGroup @ 0x10015c55e
// > GJBaseGameLayer::exitStaticCamera @ 0x10015c7b2
// > GJBaseGameLayer::exitStaticCamera @ 0x10015c945
// > GJBaseGameLayer::updateParticles @ 0x10015e42c
// > GJEffectManager::resetEffects @ 0x1002ddba6
// > GJEffectManager::transferPersistentItems @ 0x1002dffef
// > GJEffectManager::handleObjectCollision @ 0x1002e0505
// > GJEffectManager::toggleGroup @ 0x1002e08d7
// > GJEffectManager::runOpacityActionOnGroup @ 0x1002e8109
// > GJEffectManager::updateOpacityAction @ 0x1002e832d
// > GJEffectManager::playerButton @ 0x1002e9b7b
// > GJEffectManager::updateCountForItem @ 0x1002ea3cd
// > GJEffectManager::updateCountForItem @ 0x1002eaa09
// > GJEffectManager::toggleItemPersistent @ 0x1002ec407
// > GJEffectManager::toggleTimerPersistent @ 0x1002ec5ec
// > GJEffectManager::setFollowing @ 0x1002ede24
// > GJEffectManager::loadFromState @ 0x1002ef4e0
// > GJShaderState::tweenValue @ 0x1003c9a74
// > GJShaderState::stopTweenAction @ 0x1003c9b3f
// > ShaderLayer::tweenValueAuto @ 0x1003cdc88
// > ShaderLayer::tweenValueAuto @ 0x1003ce0f5
// > ShaderLayer::tweenValue @ 0x1003d1ec0
// > FMODAudioEngine::playEffectAdvanced @ 0x1003e26d8
// > FMODAudioEngine::playEffectAdvanced @ 0x1003e26e8
// > FMODAudioEngine::unregisterChannel @ 0x1003e4f01
// > FMODAudioEngine::unregisterChannel @ 0x1003e4f10
// > FMODAudioEngine::unregisterChannel @ 0x1003e50b6
// > FMODAudioEngine::unregisterChannel @ 0x1003e50c6
// > PlayerObject::unrotateGameplayObject @ 0x10040b5ed
//
// 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
//
__int64 __fastcall sub_1000569A0(_QWORD *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 = v9[1];
if ( v11 == v4 )
{
if ( *((_DWORD *)v9 + 4) == (_DWORD)v4 )
goto LABEL_30;
}
else if ( (v10 & v11) != v6 )
{
return 0;
}
v9 = (__int64 *)*v9;
if ( !v9 )
return 0;
}
}
while ( 1 )
{
v12 = v9[1];
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 = (__int64 *)*v9;
if ( !v9 )
return 0;
}
if ( *((_DWORD *)v9 + 4) != (_DWORD)v4 )
goto LABEL_21;
LABEL_30:
sub_100056B40(&v14, a1, v9, v4, 0);
v13 = v14;
v14 = nullptr;
if ( v13 )
operator delete(v13);
return 1;
}