//
// cocos2d::CCPrettyPrinter::visit_2 from 0x10024e9d8 to 0x10024ec30 (600 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007cea08
//
// 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 cocos2d::CCPrettyPrinter::visit_2(cocos2d::CCPrettyPrinter *a1, const cocos2d::CCArray *a2)
{
int v4; // w10
cocos2d::CCPrettyPrinter_vtbl *v5; // x1
std::string::size_type v6; // x2
cocos2d::ccArray *data; // x9
__int64 num; // x8
int v9; // w24
cocos2d::CCObject **arr; // x25
unsigned __int64 v11; // x26
cocos2d::CCObject *v12; // x22
cocos2d::CCPrettyPrinter_vtbl *v13; // x8
void **v14; // x1
std::string::size_type v15; // x2
int v16; // w9
cocos2d::CCPrettyPrinter_vtbl *v17; // x1
std::string::size_type v18; // x2
void *__p[2]; // [xsp+10h] [xbp-100h] BYREF
__int64 v20; // [xsp+20h] [xbp-F0h]
_QWORD v21[4]; // [xsp+30h] [xbp-E0h] BYREF
char v22; // [xsp+57h] [xbp-B9h]
__int128 v23; // [xsp+58h] [xbp-B8h]
__int64 v24; // [xsp+68h] [xbp-A8h]
std::string::value_type __s[16]; // [xsp+70h] [xbp-A0h] BYREF
__int128 v26; // [xsp+80h] [xbp-90h]
__int128 v27; // [xsp+90h] [xbp-80h]
__int16 v28; // [xsp+A0h] [xbp-70h]
std::string::append((std::string *)&a1[5], "\n");
v4 = SHIBYTE(a1[4].__vftable);
if ( v4 >= 0 )
v5 = (cocos2d::CCPrettyPrinter_vtbl *)&a1[2];
else
v5 = a1[2].__vftable;
if ( v4 >= 0 )
v6 = HIBYTE(a1[4].__vftable);
else
v6 = (std::string::size_type)a1[3].__vftable;
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v5, v6);
std::string::append((std::string *)&a1[5], "
\n");
cocos2d::CCPrettyPrinter::setIndentLevel(a1, LODWORD(a1[1].__vftable) + 1);
v28 = 0;
v26 = 0u;
v27 = 0u;
*(_OWORD *)__s = 0u;
if ( a2 )
{
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
v9 = 0;
arr = data->arr;
v11 = (unsigned __int64)&arr[num - 1];
do
{
v12 = *arr;
if ( !*arr )
break;
if ( v9 )
std::string::append((std::string *)&a1[5], "\n");
v13 = (cocos2d::CCPrettyPrinter_vtbl *)&a1[2];
if ( SHIBYTE(a1[4].__vftable) < 0 )
v13 = a1[2].__vftable;
sprintf(__s, "%s%02d: ", (const char *)v13, v9);
std::string::append((std::string *)&a1[5], __s);
cocos2d::CCPrettyPrinter::CCPrettyPrinter((__int64)v21, (int)a1[1].__vftable);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD *))v12->acceptVisitor)(v12, v21);
if ( SHIBYTE(v24) < 0 )
{
sub_1000097D0(__p, (void *)v23, *((unsigned __int64 *)&v23 + 1));
}
else
{
*(_OWORD *)__p = v23;
v20 = v24;
}
if ( v20 >= 0 )
v14 = __p;
else
v14 = (void **)__p[0];
if ( v20 >= 0 )
v15 = HIBYTE(v20);
else
v15 = (std::string::size_type)__p[1];
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v14, v15);
if ( SHIBYTE(v20) < 0 )
operator delete(__p[0]);
v21[0] = &off_1007CE9C8;
if ( SHIBYTE(v24) < 0 )
operator delete((void *)v23);
if ( v22 < 0 )
operator delete((void *)v21[2]);
++arr;
++v9;
}
while ( (unsigned __int64)arr <= v11 );
}
}
cocos2d::CCPrettyPrinter::setIndentLevel(a1, LODWORD(a1[1].__vftable) - 1);
std::string::append((std::string *)&a1[5], "\n");
v16 = SHIBYTE(a1[4].__vftable);
if ( v16 >= 0 )
v17 = (cocos2d::CCPrettyPrinter_vtbl *)&a1[2];
else
v17 = a1[2].__vftable;
if ( v16 >= 0 )
v18 = HIBYTE(a1[4].__vftable);
else
v18 = (std::string::size_type)a1[3].__vftable;
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v17, v18);
std::string::append((std::string *)&a1[5], "");
}