//
// sub_1002F352C from 0x1002f352c to 0x1002f3754 (552 bytes)
//
// 3 xrefs:
// > PlayLayer::updateVisibility @ 0x100145958
// > GameObject::activateObject @ 0x1002f34ac
// > LevelEditorLayer::updateVisibility @ 0x1003fff80
//
// This function is hookable on this platform (idp: arm, 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 11:02:57 +0000
//
__int64 __fastcall sub_1002F352C(__int64 result, int a2)
{
__int64 v2; // x22
__int64 v3; // x19
int v4; // w8
int v6; // w24
__int64 v7; // x21
__int64 v8; // x22
__int64 v9; // x22
__int64 v10; // x22
unsigned int v11; // w22
__int64 ParentMode; // x23
int v13; // w25
__int64 v14; // x0
__int64 v15; // x8
_OWORD *v16; // x21
__int64 v17; // x20
__int64 v18; // x1
v2 = *(_QWORD *)(result + 888);
if ( v2 )
{
v3 = result;
if ( (*(_BYTE *)(result + 652) & 1) == 0 )
{
v4 = *(unsigned __int8 *)(result + 885);
if ( *(unsigned __int8 *)(result + 884) == v4 )
{
return sub_1002FA0C8(result);
}
else
{
v6 = *(unsigned __int8 *)(result + 866);
*(_BYTE *)(result + 866) = 0;
v7 = *(unsigned int *)(result + 1124);
if ( !(_DWORD)v7 )
v7 = *(unsigned int *)(result + 1116);
if ( v4 )
v7 = (unsigned int)v7 + *(unsigned __int8 *)(result + 1053);
(*(void (__fastcall **)(__int64))(*(_QWORD *)result + 136LL))(result);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v2 + 128LL))(v2);
v8 = *(_QWORD *)(v3 + 888);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 152LL))(v3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 144LL))(v8);
v9 = *(_QWORD *)(v3 + 888);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 384LL))(v3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 376LL))(v9);
v10 = *(_QWORD *)(v3 + 888);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v3 + 400LL))(v3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 392LL))(v10);
v11 = *(unsigned __int8 *)(v3 + 885);
ParentMode = GameObject::getParentMode(v3);
v13 = *(unsigned __int8 *)(v3 + 649);
v14 = GameManager::sharedState(ParentMode);
v15 = 544;
if ( v13 )
v15 = 552;
v16 = GJBaseGameLayer::parentForZLayer(
*(_QWORD *)(v14 + v15),
v7,
v11,
ParentMode,
*(unsigned __int8 *)(v3 + 1345));
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 888) + 512LL))(*(_QWORD *)(v3 + 888));
if ( (_OWORD *)result == v16 )
{
if ( a2 )
return (*(__int64 (__fastcall **)(_OWORD *, _QWORD))(*(_QWORD *)v16 + 592LL))(v16, *(_QWORD *)(v3 + 888));
}
else
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v3 + 888) + 528LL))(*(_QWORD *)(v3 + 888), 0);
result = (*(__int64 (__fastcall **)(_OWORD *, _QWORD))(*(_QWORD *)v16 + 464LL))(v16, *(_QWORD *)(v3 + 888));
if ( v6 )
{
v17 = *(_QWORD *)(v3 + 888);
v18 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 192LL))(v3);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 184LL))(v17, v18);
}
}
}
}
}
return result;
}