//
// GJBaseGameLayer::addObjectCounter from 0x5b65dc to 0x5b6640 (100 bytes)
//
// 3 xrefs:
// > PlayLayer::addObject @ 0x40031e
// > LevelEditorLayer::recreateGroups @ 0x468064
// > LevelEditorLayer::init @ 0x476738
//
// 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:53:38 +0000
//
void __fastcall GJBaseGameLayer::addObjectCounter(
GJBaseGameLayer *this,
LabelGameObject *a2,
unsigned int a3,
unsigned int a4)
{
char *v4; // r0
_DWORD *v5; // r0
LabelGameObject **v6; // r2
LabelGameObject *v7; // [sp+4h] [bp-Ch] BYREF
unsigned int v8[2]; // [sp+8h] [bp-8h] BYREF
v8[0] = a3;
v8[1] = a4;
v7 = a2;
v8[0] = *((_DWORD *)a2 + 375);
if ( *((int *)a2 + 420) < 0 )
v8[0] = *((_DWORD *)a2 + 420);
if ( *((_BYTE *)a2 + 1684) )
v4 = (char *)this + 2496;
else
v4 = (char *)this + 2476;
v5 = std::unordered_map>::operator[]((int)v4, v8);
v6 = (LabelGameObject **)v5[1];
if ( v6 == (LabelGameObject **)v5[2] )
{
std::vector::__push_back_slow_path((int)v5, &v7);
}
else
{
if ( v6 )
*v6 = v7;
v5[1] += 4;
}
}