//
// cocos2d::CCPrettyPrinter::visit from 0x1800080b0 to 0x1800085dc (1324 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800ec438
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b7bc4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:19 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall cocos2d::CCPrettyPrinter::visit(cocos2d::CCPrettyPrinter *this, const struct cocos2d::CCArray *a2)
{
char *v4; // rbx
__int64 v5; // r8
unsigned __int64 v6; // rcx
char *v7; // rax
char *v8; // rdx
__int64 v9; // rcx
unsigned __int64 v10; // rdx
int v11; // r13d
unsigned int *v12; // rax
__int64 v13; // rcx
__int64 *v14; // r12
__m128i si128; // xmm6
__int64 v16; // r15
__int64 v17; // rcx
unsigned __int64 v18; // rdx
char *v19; // rax
size_t v20; // rdi
__int64 v21; // rcx
unsigned __int64 v22; // rdx
char *v23; // rax
char *v24; // rbx
int v25; // eax
int i; // ebx
__int64 v27; // rcx
__int128 *p_Src; // rax
__int64 Result; // rax
const void *v30; // rdx
_BYTE *v31; // rcx
void *v32; // rcx
void *v33; // rcx
_QWORD *v34; // rcx
__int64 v35; // rdx
unsigned __int64 v36; // r8
char *v37; // rdx
char *v38; // rcx
__int64 v39; // rdx
unsigned __int64 v40; // r8
__int64 *v41; // [rsp+30h] [rbp-A9h]
void **v42; // [rsp+40h] [rbp-99h] BYREF
int v43; // [rsp+48h] [rbp-91h]
__int128 Src; // [rsp+50h] [rbp-89h] BYREF
__int64 v45; // [rsp+60h] [rbp-79h]
unsigned __int64 v46; // [rsp+68h] [rbp-71h]
__int128 v47; // [rsp+70h] [rbp-69h]
__m128i v48; // [rsp+80h] [rbp-59h]
_BYTE *v49; // [rsp+90h] [rbp-49h] BYREF
unsigned __int64 v50; // [rsp+A8h] [rbp-31h]
char Str[16]; // [rsp+B0h] [rbp-29h] BYREF
__int128 v52; // [rsp+C0h] [rbp-19h]
__int128 v53; // [rsp+D0h] [rbp-9h]
__int16 v54; // [rsp+E0h] [rbp+7h]
v4 = (char *)this + 48;
v5 = *((_QWORD *)this + 8);
v6 = *((_QWORD *)this + 9);
if ( v6 == v5 )
{
sub_180007A50(v4, 1u, 0, "\n", 1u);
}
else
{
*((_QWORD *)v4 + 2) = v5 + 1;
v7 = v4;
if ( v6 > 0xF )
v7 = *(char **)v4;
*(_WORD *)&v7[v5] = 10;
}
v8 = (char *)this + 16;
if ( *((_QWORD *)this + 5) > 0xFu )
v8 = *((char **)this + 2);
sub_180007DF0(v4, v8, *((_QWORD *)this + 4));
v9 = *((_QWORD *)v4 + 2);
v10 = *((_QWORD *)v4 + 3);
if ( v10 - v9 < 8 )
{
sub_180007A50(v4, 8u, 0, "
\n", 8u);
}
else
{
*((_QWORD *)v4 + 2) = v9 + 8;
if ( v10 > 0xF )
v4 = *(char **)v4;
strcpy(&v4[v9], "\n");
}
cocos2d::CCPrettyPrinter::setIndentLevel(this, *((_DWORD *)this + 2) + 1);
v11 = 0;
*(_OWORD *)Str = 0;
v52 = 0;
v53 = 0;
v54 = 0;
if ( a2 )
{
v12 = *((unsigned int **)a2 + 7);
v13 = *v12;
if ( (_DWORD)v13 )
{
v14 = *((__int64 **)v12 + 2);
v41 = &v14[v13 - 1];
if ( v14 <= v41 )
{
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
do
{
v16 = *v14;
if ( !*v14 )
break;
if ( v11 > 0 )
{
v17 = *((_QWORD *)this + 8);
v18 = *((_QWORD *)this + 9);
if ( v18 == v17 )
{
sub_180007A50((_QWORD *)this + 6, 1u, 0, "\n", 1u);
}
else
{
*((_QWORD *)this + 8) = v17 + 1;
v19 = (char *)this + 48;
if ( v18 > 0xF )
v19 = *((char **)this + 6);
*(_WORD *)&v19[v17] = 10;
}
}
sub_1800095F0(Str, "%s%02d: ");
v20 = strlen(Str);
v21 = *((_QWORD *)this + 8);
v22 = *((_QWORD *)this + 9);
if ( v20 > v22 - v21 )
{
sub_180007A50((_QWORD *)this + 6, v20, 0, Str, v20);
}
else
{
*((_QWORD *)this + 8) = v21 + v20;
v23 = (char *)this + 48;
if ( v22 > 0xF )
v23 = *((char **)this + 6);
v24 = &v23[v21];
memmove(&v23[v21], Str, v20);
v24[v20] = 0;
}
v25 = *((_DWORD *)this + 2);
v42 = &cocos2d::CCPrettyPrinter::`vftable';
Src = 0;
v46 = 15;
v47 = 0;
v48 = si128;
LOBYTE(v47) = 0;
v43 = v25;
v45 = 0;
LOBYTE(Src) = 0;
for ( i = 0; i < v43; ++i )
{
v27 = v45;
if ( v46 == v45 )
{
sub_180007A50(&Src, 1u, 0, "\t", 1u);
}
else
{
++v45;
p_Src = &Src;
if ( v46 > 0xF )
p_Src = (__int128 *)Src;
*(_WORD *)((char *)p_Src + v27) = 9;
}
}
(*(void (__fastcall **)(__int64, void ***))(*(_QWORD *)v16 + 24LL))(v16, &v42);
Result = cocos2d::CCPrettyPrinter::getResult(&v42, (__int64)&v49);
v30 = (const void *)Result;
if ( *(_QWORD *)(Result + 24) > 0xFu )
v30 = *(const void **)Result;
sub_180007DF0((_QWORD *)this + 6, v30, *(_QWORD *)(Result + 16));
if ( v50 > 0xF )
{
v31 = v49;
if ( v50 + 1 >= 0x1000 )
{
v31 = *((_BYTE **)v49 - 1);
if ( (unsigned __int64)(v49 - v31 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v31);
}
++v11;
if ( v48.m128i_i64[1] > 0xFuLL )
{
v32 = (void *)v47;
if ( (unsigned __int64)(v48.m128i_i64[1] + 1) >= 0x1000 )
{
v32 = *(void **)(v47 - 8);
if ( (unsigned __int64)(v47 - (_QWORD)v32 - 8) > 0x1F )
LABEL_56:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v32);
}
v48 = si128;
LOBYTE(v47) = 0;
if ( v46 > 0xF )
{
v33 = (void *)Src;
if ( v46 + 1 >= 0x1000 )
{
v33 = *(void **)(Src - 8);
if ( (unsigned __int64)(Src - (_QWORD)v33 - 8) > 0x1F )
goto LABEL_56;
}
j_j_free_0(v33);
}
++v14;
}
while ( v14 <= v41 );
}
}
}
cocos2d::CCPrettyPrinter::setIndentLevel(this, *((_DWORD *)this + 2) - 1);
v34 = (_QWORD *)((char *)this + 48);
v35 = *((_QWORD *)this + 8);
v36 = *((_QWORD *)this + 9);
if ( v36 == v35 )
{
sub_180007A50(v34, 1u, 0, "\n", 1u);
}
else
{
*((_QWORD *)this + 8) = v35 + 1;
if ( v36 > 0xF )
v34 = (_QWORD *)*v34;
*(_WORD *)((char *)v34 + v35) = 10;
}
v37 = (char *)this + 16;
if ( *((_QWORD *)this + 5) > 0xFu )
v37 = *((char **)this + 2);
sub_180007DF0((_QWORD *)this + 6, v37, *((_QWORD *)this + 4));
v38 = (char *)this + 48;
v39 = *((_QWORD *)this + 8);
v40 = *((_QWORD *)this + 9);
if ( v40 - v39 < 8 )
{
sub_180007A50(v38, 8u, 0, "", 8u);
}
else
{
*((_QWORD *)this + 8) = v39 + 8;
if ( v40 > 0xF )
v38 = *(char **)v38;
strcpy(&v38[v39], "");
}
}