//
// cocos2d::CCPrettyPrinter::visit_2 from 0x1004b5600 to 0x1004b5a36 (1078 bytes)
//
// 1 xrefs:
// > ??> @ 0x10094ac88
//
// 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)
{
cocos2d::CCPrettyPrinter *v3; // r12
unsigned int v4; // edx
cocos2d::CCPrettyPrinter_vtbl *v5; // rsi
cocos2d::CCPrettyPrinter_vtbl *v6; // rdx
int v7; // eax
bool v8; // zf
std::string *v9; // r13
int i; // r15d
cocos2d::ccArray *data; // rcx
__int64 num; // rdx
std::string *v13; // rsi
cocos2d::CCObject **arr; // r15
int v15; // ebx
cocos2d::CCObject *v16; // r12
std::string::value_type *v17; // rdx
int v18; // eax
int v19; // r15d
const std::string::value_type *v20; // rsi
std::string::size_type v21; // rdx
int v22; // eax
int v23; // r14d
unsigned int v24; // edx
std::string::value_type *v25; // rsi
std::string::size_type v26; // rdx
cocos2d::CCObject **v27; // [rsp+0h] [rbp-100h]
unsigned __int64 v28; // [rsp+8h] [rbp-F8h]
__int64 (__fastcall **v29)(); // [rsp+10h] [rbp-F0h] BYREF
int v30; // [rsp+18h] [rbp-E8h]
std::string v31[2]; // [rsp+20h] [rbp-E0h] BYREF
std::string::value_type v32[16]; // [rsp+50h] [rbp-B0h] BYREF
void *__p; // [rsp+60h] [rbp-A0h]
cocos2d::CCPrettyPrinter *v34; // [rsp+70h] [rbp-90h]
std::string::value_type *v35; // [rsp+78h] [rbp-88h]
std::string *v36; // [rsp+80h] [rbp-80h]
std::string *v37; // [rsp+88h] [rbp-78h]
std::string::value_type __s[16]; // [rsp+90h] [rbp-70h] BYREF
__int128 v39; // [rsp+A0h] [rbp-60h]
__int128 v40; // [rsp+B0h] [rbp-50h]
__int16 v41; // [rsp+C0h] [rbp-40h]
v3 = a1;
v37 = (std::string *)&a1[5];
std::string::append((std::string *)&a1[5], "\n");
v4 = LOBYTE(a1[2].__vftable);
v5 = (cocos2d::CCPrettyPrinter_vtbl *)((char *)&a1[2].__vftable + 1);
v35 = (char *)&a1[2].__vftable + 1;
if ( (v4 & 1) != 0 )
{
v5 = a1[4].__vftable;
v6 = a1[3].__vftable;
}
else
{
v6 = (cocos2d::CCPrettyPrinter_vtbl *)(v4 >> 1);
}
std::string::append(v37, (const std::string::value_type *)v5, (std::string::size_type)v6);
std::string::append(v37, "
\n");
v7 = LODWORD(a1[1].__vftable) + 1;
LODWORD(a1[1].__vftable) = v7;
v8 = ((__int64)a1[2].__vftable & 1) == 0;
v36 = (std::string *)&a1[2];
if ( v8 )
{
*v35 = 0;
LOBYTE(a1[2].__vftable) = 0;
v9 = v36;
if ( v7 <= 0 )
goto LABEL_10;
}
else
{
LOBYTE(a1[4].~CCPrettyPrinter) = 0;
a1[3].__vftable = nullptr;
v7 = (int)a1[1].__vftable;
v9 = v36;
if ( v7 <= 0 )
goto LABEL_10;
}
for ( i = 0; i < v7; ++i )
{
std::string::append(v9, "\t");
v7 = (int)a1[1].__vftable;
}
LABEL_10:
v40 = 0;
v39 = 0;
*(_OWORD *)__s = 0;
v41 = 0;
if ( !a2 )
goto LABEL_36;
data = a2->data;
num = data->num;
v13 = v36;
if ( data->num )
{
v34 = a1;
arr = data->arr;
v28 = (unsigned __int64)&arr[num - 1];
v15 = 0;
while ( 1 )
{
v16 = *arr;
if ( !*arr )
{
LABEL_35:
v3 = v34;
v7 = (int)v34[1].__vftable;
LABEL_36:
v13 = v36;
break;
}
v27 = arr;
if ( v15 )
std::string::append(v37, "\n");
v17 = v35;
if ( (*(_BYTE *)&v36->__r_.__value_.__s.0 & 1) != 0 )
v17 = (std::string::value_type *)v34[4].__vftable;
sprintf(__s, "%s%02d: ", v17, v15);
std::string::append(v37, __s);
v18 = (int)v34[1].__vftable;
v29 = &off_10094AC48;
memset(v31, 0, sizeof(v31));
v30 = v18;
if ( v18 > 0 )
{
v19 = 0;
do
{
std::string::append(v31, "\t");
++v19;
}
while ( v19 < v30 );
}
((void (__fastcall *)(cocos2d::CCObject *, __int64 (__fastcall ***)()))v16->acceptVisitor)(v16, &v29);
if ( (*(_BYTE *)&v31[1].__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(v32, v31[1].__r_.__value_.__l.__data_, v31[1].__r_.__value_.__l.__size_, 0.0);
}
else
{
__p = v31[1].__r_.__value_.__l.__data_;
*(_OWORD *)v32 = *(_OWORD *)&v31[1].__r_.__value_.__l.0;
}
if ( (v32[0] & 1) != 0 )
{
v20 = (const std::string::value_type *)__p;
v21 = *(_QWORD *)&v32[8];
}
else
{
v21 = (unsigned __int8)v32[0] >> 1;
v20 = &v32[1];
}
std::string::append(v37, v20, v21);
if ( (v32[0] & 1) != 0 )
{
operator delete(__p);
v29 = &off_10094AC48;
if ( (*(_BYTE *)&v31[1].__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_30:
if ( (*(_BYTE *)&v31[0].__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_34;
goto LABEL_13;
}
}
else
{
v29 = &off_10094AC48;
if ( (*(_BYTE *)&v31[1].__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_30;
}
operator delete(v31[1].__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_34:
operator delete(v31[0].__r_.__value_.__l.__data_);
LABEL_13:
++v15;
arr = v27 + 1;
if ( (unsigned __int64)(v27 + 1) > v28 )
goto LABEL_35;
}
}
v22 = v7 - 1;
LODWORD(v3[1].__vftable) = v22;
if ( ((__int64)v3[2].__vftable & 1) != 0 )
{
LOBYTE(v3[4].~CCPrettyPrinter) = 0;
v3[3].__vftable = nullptr;
if ( SLODWORD(v3[1].__vftable) <= 0 )
goto LABEL_43;
LABEL_41:
v23 = 0;
do
{
std::string::append(v36, "\t");
++v23;
}
while ( v23 < SLODWORD(v3[1].__vftable) );
goto LABEL_43;
}
*v35 = 0;
v13->__r_.__value_.__s.0 = 0;
if ( v22 > 0 )
goto LABEL_41;
LABEL_43:
std::string::append(v37, "\n");
v24 = LOBYTE(v3[2].__vftable);
if ( (v24 & 1) != 0 )
{
v25 = (std::string::value_type *)v3[4].__vftable;
v26 = (std::string::size_type)v3[3].__vftable;
}
else
{
v26 = v24 >> 1;
v25 = v35;
}
std::string::append(v37, v25, v26);
std::string::append(v37, "");
}