//
// GJBaseGameLayer::resetGroupCounters from 0x10014e280 to 0x10014e449 (457 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::init @ 0x1000dc071
// > LevelEditorLayer::onPlaytest @ 0x1000f2768
// > LevelEditorLayer::onStopPlaytest @ 0x1000f32a9
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJBaseGameLayer::resetGroupCounters(GJBaseGameLayer *a1, bool a2)
{
std::__hash_node_base>, void *> *>::__next_pointer next; // r13
LabelGameObject **v4; // rbx
LabelGameObject **i; // r15
_QWORD *p_next; // r12
std::__hash_node_base>, void *> *>::__next_pointer v7; // rbx
__int64 v8; // rdi
std::__hash_node_base>, void *> *>::__next_pointer v9; // r13
LabelGameObject **v10; // rbx
LabelGameObject **j; // r14
std::__hash_node_base>, void *> *>::__next_pointer v12; // r12
std::__hash_node_base>, void *> *>::__next_pointer v13; // rbx
std::__hash_node_base>, void *> *>::__next_pointer v14; // r15
const char *v15; // rsi
__int64 v16; // r14
size_t v17; // rdx
__int16 v18; // [rsp+8h] [rbp-68h] BYREF
char v19; // [rsp+Ah] [rbp-66h]
void *__p; // [rsp+18h] [rbp-58h] BYREF
char v21; // [rsp+20h] [rbp-50h] BYREF
_BYTE __dst[15]; // [rsp+21h] [rbp-4Fh] BYREF
void *v23; // [rsp+30h] [rbp-40h] BYREF
void **p_p; // [rsp+38h] [rbp-38h]
_BOOL4 v25; // [rsp+44h] [rbp-2Ch]
v25 = a2;
next = a1->m_labelObjects.__table_.__p1_.__value_.__next_;
if ( next )
{
if ( v25 )
{
p_p = &__p;
do
{
p_next = &next[3].__next_->__next_;
v7 = next[4].__next_;
while ( p_next != (_QWORD *)v7 )
{
v8 = *p_next;
v18 = 12290;
v19 = 0;
LabelGameObject::updateLabel(v8, &v18);
if ( (v18 & 1) != 0 )
operator delete(__p);
++p_next;
}
next = next->__next_;
}
while ( next );
}
else
{
do
{
v4 = (LabelGameObject **)next[3].__next_;
for ( i = (LabelGameObject **)next[4].__next_; v4 != i; ++v4 )
LabelGameObject::updatePreviewLabel(*v4);
next = next->__next_;
}
while ( next );
}
}
v9 = a1->m_timeLabelObjects.__table_.__p1_.__value_.__next_;
if ( v9 )
{
if ( v25 )
{
p_p = &v23;
do
{
v12 = v9[3].__next_;
v13 = v9[4].__next_;
while ( v12 != v13 )
{
v14 = v12->__next_;
v15 = "0.00";
if ( LOBYTE(v12->__next_[236].__next_) )
v15 = "0";
v16 = LOBYTE(v12->__next_[236].__next_) ^ 1LL;
v17 = 3 * v16 + 1;
v21 = 2 * v17;
memcpy(__dst, v15, v17);
__dst[3 * v16 + 1] = 0;
LabelGameObject::updateLabel(v14, &v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
++v12;
}
v9 = v9->__next_;
}
while ( v9 );
}
else
{
do
{
v10 = (LabelGameObject **)v9[3].__next_;
for ( j = (LabelGameObject **)v9[4].__next_; v10 != j; ++v10 )
LabelGameObject::updatePreviewLabel(*v10);
v9 = v9->__next_;
}
while ( v9 );
}
}
}