//
// cocos2d::CCPrettyPrinter::visit from 0x10024ef2c to 0x10024f15c (560 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007cea18
//
// 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(cocos2d::CCPrettyPrinter *a1, const cocos2d::CCSet *a2)
{
int v4; // w10
cocos2d::CCPrettyPrinter_vtbl *v5; // x1
std::string::size_type v6; // x2
cocos2d::CCSetIterator v7; // x22
int v8; // w24
cocos2d::CCPrettyPrinter_vtbl *v9; // x1
void **v10; // x1
std::string::size_type v11; // x2
std::__tree_end_node *>::pointer left; // x8
std::__tree_end_node *> *v13; // x28
bool v14; // zf
int v15; // w9
cocos2d::CCPrettyPrinter_vtbl *v16; // x1
std::string::size_type v17; // x2
void *__p[2]; // [xsp+0h] [xbp-B0h] BYREF
__int64 v19; // [xsp+10h] [xbp-A0h]
_QWORD v20[4]; // [xsp+20h] [xbp-90h] BYREF
char v21; // [xsp+47h] [xbp-69h]
__int128 v22; // [xsp+48h] [xbp-68h]
__int64 v23; // [xsp+58h] [xbp-58h]
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);
v7.__ptr_ = cocos2d::CCSet::begin((cocos2d::CCSet *)a2).__ptr_;
if ( v7.__ptr_ != cocos2d::CCSet::end((cocos2d::CCSet *)a2).__ptr_ )
{
v8 = 0;
do
{
if ( v8 )
std::string::append((std::string *)&a1[5], "\n");
v9 = (cocos2d::CCPrettyPrinter_vtbl *)&a1[2];
if ( SHIBYTE(a1[4].__vftable) < 0 )
v9 = a1[2].__vftable;
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v9);
cocos2d::CCPrettyPrinter::CCPrettyPrinter((__int64)v20, (int)a1[1].__vftable);
(*(void (__fastcall **)(std::__tree_end_node *>::pointer, _QWORD *))(*(_QWORD *)v7.__ptr_[4].__left_ + 32LL))(
v7.__ptr_[4].__left_,
v20);
if ( SHIBYTE(v23) < 0 )
{
sub_1000097D0(__p, (void *)v22, *((unsigned __int64 *)&v22 + 1));
}
else
{
*(_OWORD *)__p = v22;
v19 = v23;
}
if ( v19 >= 0 )
v10 = __p;
else
v10 = (void **)__p[0];
if ( v19 >= 0 )
v11 = HIBYTE(v19);
else
v11 = (std::string::size_type)__p[1];
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v10, v11);
if ( SHIBYTE(v19) < 0 )
operator delete(__p[0]);
v20[0] = &off_1007CE9C8;
if ( SHIBYTE(v23) < 0 )
operator delete((void *)v22);
if ( v21 < 0 )
operator delete((void *)v20[2]);
left = v7.__ptr_[1].__left_;
if ( left )
{
do
{
v13 = (std::__tree_end_node *> *)left;
left = *(std::__tree_end_node *>::pointer *)left;
}
while ( left );
}
else
{
do
{
v13 = (std::__tree_end_node *> *)v7.__ptr_[2].__left_;
v14 = v13->__left_ == (std::__tree_end_node *>::pointer)v7.__ptr_;
v7.__ptr_ = v13;
}
while ( !v14 );
}
++v8;
v7.__ptr_ = v13;
}
while ( v13 != cocos2d::CCSet::end((cocos2d::CCSet *)a2).__ptr_ );
}
cocos2d::CCPrettyPrinter::setIndentLevel(a1, LODWORD(a1[1].__vftable) - 1);
std::string::append((std::string *)&a1[5], "\n");
v15 = SHIBYTE(a1[4].__vftable);
if ( v15 >= 0 )
v16 = (cocos2d::CCPrettyPrinter_vtbl *)&a1[2];
else
v16 = a1[2].__vftable;
if ( v15 >= 0 )
v17 = HIBYTE(a1[4].__vftable);
else
v17 = (std::string::size_type)a1[3].__vftable;
std::string::append((std::string *)&a1[5], (const std::string::value_type *)v16, v17);
std::string::append((std::string *)&a1[5], "\n");
}