//
// sub_100402D5C from 0x100402d5c to 0x100402e54 (248 bytes)
//
// 2 xrefs:
// > sub_1003F823C @ 0x1003f8a98
// > LevelEditorLayer::onPlaytest @ 0x100404738
//
// 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:04:39 +0000
//
__int64 __fastcall sub_100402D5C(__int64 *a1)
{
unsigned __int64 i; // x20
__int64 result; // x0
_QWORD *v4; // x8
unsigned __int64 v5; // x10
__int64 v6; // x11
__int64 v7; // x9
__int64 v8; // x12
__int64 v9; // x9
_QWORD *v10; // x9
__int64 v11; // x11
for ( i = 0; i != 1102; ++i )
{
result = sub_10000F6A8(a1[269], i);
v4 = (_QWORD *)a1[1824];
v5 = i >> 6;
v6 = 1LL << i;
v7 = v4[i >> 6];
if ( (_DWORD)result == ((v7 & (1LL << i)) != 0) )
{
v10 = (_QWORD *)a1[1827];
v11 = v10[v5] & ~v6;
}
else
{
v8 = v7 & ~v6;
v9 = v7 | v6;
if ( !(_DWORD)result )
v9 = v8;
v4[v5] = v9;
v10 = (_QWORD *)a1[1827];
v11 = v10[v5] | v6;
}
v10[v5] = v11;
}
v4[15] |= 0x200000000000uLL;
v10[15] &= ~0x200000000000uLL;
v4[15] |= 0x400000000000uLL;
v10[15] &= ~0x400000000000uLL;
v4[15] |= 0x800000000000uLL;
v10[15] &= ~0x800000000000uLL;
*v4 &= ~1uLL;
*v10 &= ~1uLL;
return result;
}