//
// GJBaseGameLayer::restoreAllUIObjects from 0x10013e8f0 to 0x10013ea99 (425 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::onStopPlaytest @ 0x1000f2d9a
//
// 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::restoreAllUIObjects(GJBaseGameLayer *a1)
{
cocos2d::CCArray *m_uiObjects; // rdi
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r15
cocos2d::CCObject *v5; // r12
double v6; // xmm0_8
std::__hash_node_base, void *> *>::__next_pointer next; // rdi
std::__hash_node_base, void *> *> *v8; // r14
unsigned __int64 value; // rsi
int *p_m_uReference; // [rsp+0h] [rbp-40h] BYREF
unsigned __int64 v11; // [rsp+8h] [rbp-38h]
unsigned int m_uReference; // [rsp+10h] [rbp-30h] BYREF
char v13[41]; // [rsp+17h] [rbp-29h] BYREF
m_uiObjects = a1->m_uiObjects;
if ( !m_uiObjects )
{
sub_100720270(0);
if ( !a1->m_uiObjectPositions.__table_.__p2_.__value_ )
goto LABEL_15;
goto LABEL_10;
}
data = m_uiObjects->data;
if ( data->num )
{
arr = data->arr;
v11 = (unsigned __int64)&arr[data->num - 1];
do
{
v5 = *arr;
if ( !*arr )
break;
m_uReference = v5[16].m_uReference;
p_m_uReference = (int *)&m_uReference;
sub_100169820(&a1->m_uiObjectPositions, &m_uReference, &unk_100816AE0, &p_m_uReference, v13);
v6 = sub_10028CC60(&p_m_uReference);
((void (__fastcall *)(cocos2d::CCObject *, int **, double))v5->__vftable[16].setTag)(v5, &p_m_uReference, v6);
((void (__fastcall *)(cocos2d::CCObject *, __int64))v5->__vftable[16].~CCObject_0)(v5, 1);
v5[11].m_nLuaID = 0;
BYTE1(v5[24].__vftable) = 0;
((void (__fastcall *)(GJBaseGameLayer *, cocos2d::CCObject *))a1->addToSection)(a1, v5);
cocos2d::CCDictionary::setObject(a1->m_objectsToDeactivate, v5, v5[16].m_uReference);
BYTE2(v5[17].m_nZOrder) = 1;
++arr;
}
while ( (unsigned __int64)arr <= v11 );
m_uiObjects = a1->m_uiObjects;
}
sub_100720270(m_uiObjects);
if ( a1->m_uiObjectPositions.__table_.__p2_.__value_ )
{
LABEL_10:
next = a1->m_uiObjectPositions.__table_.__p1_.__value_.__next_;
if ( next )
{
do
{
v8 = next->__next_;
operator delete(next);
next = v8;
}
while ( v8 );
}
a1->m_uiObjectPositions.__table_.__p1_.__value_.__next_ = nullptr;
value = a1->m_uiObjectPositions.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( value )
__bzero(a1->m_uiObjectPositions.__table_.__bucket_list_.__ptr_.__value_, 8 * value);
a1->m_uiObjectPositions.__table_.__p2_.__value_ = 0;
}
LABEL_15:
a1->m_calcCollisionBlockObjects2.__end_ = a1->m_calcCollisionBlockObjects2.__begin_;
a1->m_calcCollisionBlockObjects2Size = 0;
}