//
// DeathMarkerLayer::updateVisibility from 0x1008becd0 to 0x1008bf43f (1903 bytes)
//
// 7 xrefs:
// > LevelEditorLayer::updateEditor @ 0x1000ac909
// > LevelEditorLayer::updateEditor @ 0x1000ac91e
// > LevelEditorLayer::postUpdate @ 0x1000c7420
// > LevelEditorLayer::postUpdate @ 0x1000c7435
// > DeathMarkerLayer::init @ 0x1008bd224
// > PlayLayer::dtUpdateLiveMarkers @ 0x100961406
// > PlayLayer::dtUpdateLiveMarkers @ 0x10096141b
//
// 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:37:28 +0000
//
void __fastcall DeathMarkerLayer::updateVisibility(__int64 a1, float *a2)
{
__int64 v2; // rbx
int v3; // r12d
int v4; // r13d
int v6; // ebx
int v7; // r14d
int v8; // eax
int v9; // r14d
__int64 **j; // r14
__int64 v11; // r12
int v12; // r10d
int v13; // eax
int v14; // edi
__int64 **i; // r14
int v16; // eax
int v17; // ecx
int v18; // r10d
int v19; // r11d
int v20; // eax
int v21; // edi
int v22; // r15d
int v23; // r13d
bool v24; // cc
unsigned __int64 v25; // rcx
bool v26; // dl
unsigned __int64 v27; // r8
unsigned __int64 v28; // rcx
unsigned __int64 v29; // r9
unsigned __int64 v30; // rsi
__int64 **v31; // rax
__int64 *v32; // r15
unsigned __int64 v33; // r8
unsigned __int64 v34; // rax
__int64 v35; // rax
__int64 v36; // rax
unsigned __int64 v37; // r13
__int64 v38; // r14
__int64 v39; // r12
__int64 v40; // rbx
__int64 v41; // rsi
__int64 v42; // rsi
unsigned __int64 v43; // rcx
unsigned __int64 v44; // r8
unsigned __int64 v45; // rcx
unsigned __int64 v46; // r9
unsigned __int64 v47; // rsi
__int64 **v48; // rax
__int64 *v49; // r14
unsigned __int64 v50; // r8
unsigned __int64 v51; // rax
__int64 v52; // rax
__int64 v53; // rax
unsigned __int64 v54; // r13
__int64 v55; // r12
__int64 v56; // r15
__int64 v57; // rbx
__int64 v58; // rsi
__int64 v59; // rsi
int v60; // [rsp+0h] [rbp-70h]
__int64 v61; // [rsp+8h] [rbp-68h]
int v62; // [rsp+14h] [rbp-5Ch]
int v63; // [rsp+18h] [rbp-58h]
int v64; // [rsp+18h] [rbp-58h]
int v65; // [rsp+24h] [rbp-4Ch]
int v66; // [rsp+2Ch] [rbp-44h]
unsigned __int64 v67; // [rsp+30h] [rbp-40h]
int v68; // [rsp+30h] [rbp-40h]
bool v69; // [rsp+38h] [rbp-38h]
int v70; // [rsp+38h] [rbp-38h]
int v71; // [rsp+40h] [rbp-30h]
unsigned int v72; // [rsp+40h] [rbp-30h]
v2 = a1;
if ( a2[2] <= 0.0 || a2[3] <= 0.0 )
{
if ( *(_BYTE *)(a1 + 400) )
return;
v12 = *(_DWORD *)(a1 + 384);
v13 = *(_DWORD *)(a1 + 388);
if ( v12 > v13 || (v14 = *(_DWORD *)(a1 + 396), *(_DWORD *)(v2 + 392) > v14) )
{
LABEL_14:
for ( i = *(__int64 ***)(v2 + 360); i; i = (__int64 **)*i )
sub_1008C0CD0(v2, *((unsigned int *)i + 4));
*(_BYTE *)(v2 + 400) = 1;
*(_QWORD *)(v2 + 384) = 0xFFFFFFFF00000000LL;
v16 = -1;
v17 = 0;
goto LABEL_35;
}
while ( 1 )
{
LODWORD(v43) = *(_DWORD *)(v2 + 392);
if ( (int)v43 <= v14 )
{
v44 = *(_QWORD *)(v2 + 352);
if ( v44 )
{
v68 = v12 << 16;
v70 = v12;
LABEL_83:
v72 = v43;
v45 = v68 | (unsigned int)v43;
v46 = (0x101010101010101LL
* ((((v44 - ((v44 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v44 - ((v44 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v44 - ((v44 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v44 - ((v44 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v46 > 1 )
{
v47 = v45;
if ( v44 <= v45 )
v47 = (unsigned int)v45 % (unsigned int)v44;
}
else
{
v47 = ((_DWORD)v44 - 1) & (unsigned int)v45;
}
v48 = *(__int64 ***)(*(_QWORD *)(v2 + 344) + 8 * v47);
if ( v48 )
{
v49 = *v48;
if ( *v48 )
{
if ( (unsigned int)v46 < 2 )
{
v50 = v44 - 1;
while ( 1 )
{
v52 = v49[1];
if ( v52 == v45 )
{
if ( *((_DWORD *)v49 + 4) == (_DWORD)v45 )
goto LABEL_106;
}
else if ( (v50 & v52) != v47 )
{
goto LABEL_114;
}
v49 = (__int64 *)*v49;
if ( !v49 )
goto LABEL_114;
}
}
do
{
v51 = v49[1];
if ( v51 == v45 )
{
if ( *((_DWORD *)v49 + 4) == (_DWORD)v45 )
{
LABEL_106:
v53 = v49[3];
v43 = v72;
if ( v49[4] == v53 )
goto LABEL_115;
v54 = 0;
do
{
v55 = *(_QWORD *)(v2 + 320);
v56 = v2;
v57 = 80LL * *(int *)(v53 + 4 * v54);
v58 = *(_QWORD *)(v55 + v57 + 64);
if ( v58 )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, unsigned __int64))(**(_QWORD **)(v56 + 408)
+ 552LL))(
*(_QWORD *)(v56 + 408),
v58,
0,
v43);
v59 = *(_QWORD *)(v57 + v55 + 72);
v2 = v56;
if ( v59 )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, unsigned __int64))(**(_QWORD **)(v56 + 416)
+ 552LL))(
*(_QWORD *)(v56 + 416),
v59,
0,
v43);
++v54;
v53 = v49[3];
v43 = (v49[4] - v53) >> 2;
}
while ( v54 < v43 );
v14 = *(_DWORD *)(v56 + 396);
v12 = v70;
break;
}
}
else
{
if ( v51 < v44 )
goto LABEL_97;
if ( (v44 | v51) >> 32 )
{
v51 %= v44;
LABEL_97:
if ( v51 != v47 )
break;
goto LABEL_92;
}
if ( (unsigned int)v51 % (unsigned int)v44 != v47 )
break;
}
LABEL_92:
v49 = (__int64 *)*v49;
}
while ( v49 );
}
}
LABEL_114:
LODWORD(v43) = v72;
LABEL_115:
while ( (int)v43 < v14 )
{
LODWORD(v43) = v43 + 1;
v44 = *(_QWORD *)(v2 + 352);
if ( v44 )
goto LABEL_83;
}
v13 = *(_DWORD *)(v2 + 388);
}
}
v24 = v12++ < v13;
if ( !v24 )
goto LABEL_14;
}
}
v3 = (int)(float)(sub_1002788E0((__int64)a2) / 240.0);
v60 = (int)(float)(sub_1002788A0(a2) / 240.0);
v4 = v60 + 1;
v6 = (int)(float)(sub_100278930((__int64)a2) / 240.0);
v7 = v3;
v71 = (int)(float)(sub_1002788F0((__int64)a2) / 240.0);
v8 = 1;
if ( v3 < 2 )
v7 = 1;
v9 = v7 - 1;
if ( v6 >= 2 )
v8 = v6;
v63 = v8;
v2 = a1;
v65 = v9;
if ( *(_BYTE *)(a1 + 400) )
{
for ( j = *(__int64 ***)(a1 + 360); j; j = (__int64 **)*j )
sub_1008C1820(a1, *((unsigned int *)j + 4));
*(_BYTE *)(a1 + 400) = 0;
*(_OWORD *)(a1 + 384) = xmmword_100A13660;
v11 = 0;
v9 = v65;
}
else
{
v11 = *(unsigned int *)(a1 + 384);
}
v18 = v71 + 1;
v19 = v63 - 1;
v20 = *(_DWORD *)(a1 + 388);
if ( !((unsigned int)v11 ^ v9 | v4 ^ v20) )
{
v20 = v60 + 1;
if ( v19 == *(_DWORD *)(a1 + 392) )
{
v20 = v60 + 1;
if ( v18 == *(_DWORD *)(a1 + 396) )
return;
}
}
v66 = v63 - 1;
if ( (int)v11 > v20 )
goto LABEL_23;
v21 = *(_DWORD *)(a1 + 396);
if ( *(_DWORD *)(a1 + 392) > v21 )
goto LABEL_23;
while ( 2 )
{
v25 = *(unsigned int *)(v2 + 392);
if ( (int)v25 > v21 )
goto LABEL_38;
v26 = (int)v11 < v9 || (int)v11 > v4;
v62 = (_DWORD)v11 << 16;
v69 = v26;
while ( 2 )
{
if ( !v26 && (int)v25 >= v19 && (int)v25 <= v18 )
goto LABEL_43;
v27 = *(_QWORD *)(v2 + 352);
if ( !v27 )
goto LABEL_43;
v67 = v25;
v28 = v62 | (unsigned int)v25;
v29 = (0x101010101010101LL
* ((((v27 - ((v27 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v27 - ((v27 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v27 - ((v27 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v27 - ((v27 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v29 > 1 )
{
v30 = v28;
if ( v27 <= v28 )
v30 = (unsigned int)v28 % (unsigned int)v27;
}
else
{
v30 = ((_DWORD)v27 - 1) & (unsigned int)v28;
}
v31 = *(__int64 ***)(*(_QWORD *)(v2 + 344) + 8 * v30);
if ( !v31 || (v32 = *v31) == nullptr )
{
LABEL_42:
LODWORD(v25) = v67;
v26 = v69;
goto LABEL_43;
}
if ( (unsigned int)v29 < 2 )
{
v33 = v27 - 1;
while ( 1 )
{
v35 = v32[1];
if ( v35 == v28 )
{
if ( *((_DWORD *)v32 + 4) == (_DWORD)v28 )
goto LABEL_70;
}
else if ( (v33 & v35) != v30 )
{
goto LABEL_42;
}
v32 = (__int64 *)*v32;
if ( !v32 )
goto LABEL_42;
}
}
while ( 1 )
{
v34 = v32[1];
if ( v34 == v28 )
break;
if ( v34 < v27 )
goto LABEL_61;
if ( (v27 | v34) >> 32 )
{
v34 %= v27;
LABEL_61:
if ( v34 != v30 )
goto LABEL_42;
goto LABEL_56;
}
if ( (unsigned int)v34 % (unsigned int)v27 != v30 )
goto LABEL_42;
LABEL_56:
v32 = (__int64 *)*v32;
if ( !v32 )
goto LABEL_42;
}
if ( *((_DWORD *)v32 + 4) != (_DWORD)v28 )
goto LABEL_56;
LABEL_70:
v36 = v32[3];
v25 = v67;
v26 = v69;
if ( v32[4] != v36 )
{
v61 = v11;
v37 = 0;
do
{
v38 = *(_QWORD *)(v2 + 320);
v39 = v2;
v40 = 80LL * *(int *)(v36 + 4 * v37);
v41 = *(_QWORD *)(v38 + v40 + 64);
if ( v41 )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, unsigned __int64))(**(_QWORD **)(v39 + 408) + 552LL))(
*(_QWORD *)(v39 + 408),
v41,
0,
v25);
v42 = *(_QWORD *)(v40 + v38 + 72);
v2 = v39;
if ( v42 )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, unsigned __int64))(**(_QWORD **)(v39 + 416) + 552LL))(
*(_QWORD *)(v39 + 416),
v42,
0,
v25);
++v37;
v36 = v32[3];
v25 = (v32[4] - v36) >> 2;
}
while ( v37 < v25 );
v21 = *(_DWORD *)(v39 + 396);
v9 = v65;
v4 = v60 + 1;
v18 = v71 + 1;
v19 = v63 - 1;
v11 = v61;
goto LABEL_42;
}
LABEL_43:
v24 = (int)v25 < v21;
v25 = (unsigned int)(v25 + 1);
if ( v24 )
continue;
break;
}
v20 = *(_DWORD *)(v2 + 388);
LABEL_38:
v24 = (int)v11 < v20;
v11 = (unsigned int)(v11 + 1);
if ( v24 )
continue;
break;
}
LABEL_23:
if ( v9 <= v4 && v66 <= v71 + 1 )
{
v64 = v63 - 2;
v22 = v9;
do
{
v23 = v64;
do
{
++v23;
if ( v22 < *(_DWORD *)(v2 + 384)
|| v22 > *(_DWORD *)(v2 + 388)
|| v23 < *(_DWORD *)(v2 + 392)
|| v23 > *(_DWORD *)(v2 + 396) )
{
sub_1008C0CD0(v2, (v22 << 16) | (unsigned int)v23);
}
}
while ( v23 <= v71 );
v24 = v22++ <= v60;
}
while ( v24 );
}
*(_DWORD *)(v2 + 384) = v9;
*(_DWORD *)(v2 + 388) = v60 + 1;
v16 = v71 + 1;
v17 = v66;
LABEL_35:
*(_DWORD *)(v2 + 392) = v17;
*(_DWORD *)(v2 + 396) = v16;
}