//
// DeathMarkerLayer::resolveBadgeCollisions from 0x76b848 to 0x76bb50 (776 bytes)
//
// 1 xrefs:
// > DeathMarkerLayer::mountSection @ 0x76bc04
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:11 +0000
//
void __fastcall DeathMarkerLayer::resolveBadgeCollisions(DeathMarkerLayer *this)
{
DeathMarkerLayer *v2; // r0
DeathMarkerLayer *v3; // r4
int v4; // r11
unsigned int v5; // r4
int v6; // r10
unsigned int v7; // r5
unsigned int v8; // r9
unsigned int v9; // r3
int v10; // r9
void (__fastcall *v11)(int, _DWORD); // r10
float v12; // s17
float v13; // s16
float v14; // r0
int *v15; // r5
int v16; // r6
unsigned int v17; // r10
int v18; // r4
int v19; // t1
int v20; // r6
int *v21; // r7
int v22; // r11
unsigned int v23; // r4
int v24; // r2
int v25; // t1
unsigned int v26; // r3
unsigned int v27; // r3
unsigned int v28; // r0
int v29; // r3
int v30; // r2
int v31; // r3
unsigned int v32; // r1
int v33; // [sp+8h] [bp-54h]
int v34; // [sp+Ch] [bp-50h]
void *v35; // [sp+1Ch] [bp-40h] BYREF
char *v36; // [sp+20h] [bp-3Ch]
unsigned int v37; // [sp+24h] [bp-38h]
_DWORD *v38; // [sp+28h] [bp-34h] BYREF
unsigned int v39; // [sp+2Ch] [bp-30h]
int v40; // [sp+30h] [bp-2Ch]
_BYTE v41[16]; // [sp+34h] [bp-28h] BYREF
_DWORD v42[4]; // [sp+44h] [bp-18h] BYREF
v2 = (DeathMarkerLayer *)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 80) + 256))(*((_DWORD *)this + 80));
v3 = v2;
if ( v2 != this && v2 && (*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v2 + 244))(v2) )
{
v35 = nullptr;
v36 = nullptr;
v37 = 0;
v38 = nullptr;
v39 = 0;
v40 = 0;
if ( (*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v3 + 244))(v3)
&& **(_DWORD **)((*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v3 + 244))(v3) + 52) )
{
v15 = *(int **)(*(_DWORD *)((*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v3 + 244))(v3) + 52) + 12);
v16 = *(_DWORD *)(*(_DWORD *)((*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v3 + 244))(v3) + 52) + 12);
v17 = v16
+ 4 * (**(_DWORD **)((*(int (__fastcall **)(DeathMarkerLayer *))(*(_DWORD *)v3 + 244))(v3) + 52) + 0x3FFFFFFF);
while ( (unsigned int)v15 <= v17 )
{
v19 = *v15++;
v18 = v19;
if ( !v19 )
break;
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18) )
{
v20 = *((unsigned __int8 *)this + 324);
if ( v18 != *((_DWORD *)this + 80) )
v20 ^= 1u;
if ( (*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18)
&& **(_DWORD **)((*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18) + 52) )
{
v21 = *(int **)(*(_DWORD *)((*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18) + 52) + 12);
v22 = *(_DWORD *)(*(_DWORD *)((*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18) + 52) + 12);
v23 = v22 + 4 * (**(_DWORD **)((*(int (__fastcall **)(int))(*(_DWORD *)v18 + 244))(v18) + 52) + 0x3FFFFFFF);
while ( (unsigned int)v21 <= v23 )
{
v25 = *v21++;
v24 = v25;
if ( !v25 )
break;
v42[0] = v24;
if ( (unsigned int)v36 >= v37 )
{
std::vector::__push_back_slow_path((int)&v35, v42);
}
else
{
if ( v36 )
*(_DWORD *)v36 = v24;
v36 += 4;
}
v26 = v39;
if ( v39 == 32 * v40 )
{
if ( v39 + 1 >= 0x80000000 )
sub_38AC30();
if ( v39 > 0x3FFFFFFE )
{
v32 = 0x7FFFFFFF;
}
else
{
v32 = v40 << 6;
v26 = (v39 + 32) & 0xFFFFFFE0;
if ( v40 << 6 < v26 )
v32 = (v39 + 32) & 0xFFFFFFE0;
}
std::vector::reserve((void **)&v38, v32, 0x3FFFFFFEu, v26);
}
v27 = v39++;
v28 = v27 >> 5;
v29 = 1 << (v27 & 0x1F);
v30 = v38[v28];
if ( v20 )
v31 = v29 | v30;
else
v31 = v30 & ~v29;
v38[v28] = v31;
}
}
}
}
}
v4 = 8;
do
{
v5 = 0;
v6 = 0;
while ( v5 < (v36 - (_BYTE *)v35) >> 2 )
{
v7 = v5 + 1;
v33 = 1 << (v5 & 0x1F);
while ( v7 < (v36 - (_BYTE *)v35) >> 2 )
{
if ( (((1 << (v7 & 0x1F)) & v38[v7 >> 5]) != 0) == ((v33 & v38[v5 >> 5]) != 0) || (v33 & v38[v5 >> 5]) == 0 )
{
v8 = v5;
v9 = v7;
}
else
{
v8 = v7;
v9 = v5;
}
v34 = 4 * v9;
sub_769C9C((cocos2d::CCRect *)v41, *((_DWORD *)v35 + v9));
sub_769C9C((cocos2d::CCRect *)v42, *((_DWORD *)v35 + v8));
if ( cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v41, (const cocos2d::CCRect *)v42) )
{
v10 = *(_DWORD *)((char *)v35 + v34);
v11 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v10 + 116);
v12 = COERCE_FLOAT((*(int (__fastcall **)(int))(*(_DWORD *)v10 + 120))(v10));
v13 = COERCE_FLOAT(cocos2d::CCRect::getMaxY((cocos2d::CCRect *)v42)) + 2.0;
v14 = COERCE_FLOAT(cocos2d::CCRect::getMinY((cocos2d::CCRect *)v41));
v11(v10, v12 + (float)(v13 - v14));
v6 = 1;
}
++v7;
}
++v5;
}
if ( !v6 )
break;
--v4;
}
while ( v4 );
std::vector::~vector((void **)&v38);
if ( v35 )
{
v36 -= 4 * ((unsigned int)(v36 - (_BYTE *)v35) >> 2);
operator delete(v35);
}
}
}