//
// cocos2d::CCPrettyPrinter::visit from 0x1800086c0 to 0x180008c23 (1379 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800ec430
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b7bdc
//
// 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::CCDictionary *a2)
{
_QWORD *v4; // rbx
__int64 v5; // r8
unsigned __int64 v6; // rcx
_QWORD *v7; // rax
char *v8; // rdx
__int64 v9; // rcx
unsigned __int64 v10; // rdx
_BYTE *v11; // rbx
__int64 v12; // r13
__int64 v13; // rsi
__m128i si128; // xmm6
size_t v15; // rdi
__int64 v16; // rcx
unsigned __int64 v17; // rdx
char *v18; // rax
char *v19; // rbx
int v20; // eax
int i; // ebx
__int64 v22; // rcx
__int128 *p_Src; // rax
__int64 Result; // rax
const void *v25; // rdx
_BYTE *v26; // rcx
void *v27; // rcx
void *v28; // rcx
__int64 v29; // rax
__int64 v30; // rcx
unsigned __int64 v31; // rdx
char *v32; // rax
_QWORD *v33; // rcx
__int64 v34; // rdx
unsigned __int64 v35; // r8
char *v36; // rdx
_QWORD *v37; // rcx
__int64 v38; // rdx
unsigned __int64 v39; // r9
char *v40; // rbx
void **v41; // [rsp+30h] [rbp-D0h] BYREF
int v42; // [rsp+38h] [rbp-C8h]
__int128 Src; // [rsp+40h] [rbp-C0h] BYREF
__int64 v44; // [rsp+50h] [rbp-B0h]
unsigned __int64 v45; // [rsp+58h] [rbp-A8h]
__int128 v46; // [rsp+60h] [rbp-A0h]
__m128i v47; // [rsp+70h] [rbp-90h]
_BYTE *v48; // [rsp+80h] [rbp-80h] BYREF
unsigned __int64 v49; // [rsp+98h] [rbp-68h]
char Str[1008]; // [rsp+A0h] [rbp-60h] BYREF
v4 = (_QWORD *)((char *)this + 48);
v5 = *((_QWORD *)this + 8);
v6 = *((_QWORD *)this + 9);
if ( v6 == v5 )
{
sub_180007A50(v4, 1u, 0, "\n", 1u);
}
else
{
v4[2] = v5 + 1;
v7 = v4;
if ( v6 > 0xF )
v7 = (_QWORD *)*v4;
*(_WORD *)((char *)v7 + v5) = 10;
}
v8 = (char *)this + 16;
if ( *((_QWORD *)this + 5) > 0xFu )
v8 = *((char **)this + 2);
sub_180007DF0(v4, v8, *((_QWORD *)this + 4));
v9 = v4[2];
v10 = v4[3];
if ( v10 - v9 < 7 )
{
sub_180007A50(v4, 7u, 0, "\n", 7u);
}
else
{
v4[2] = v9 + 7;
if ( v10 > 0xF )
v4 = (_QWORD *)*v4;
v11 = (char *)v4 + v9;
memmove(v11, "\n", 7u);
v11[7] = 0;
}
cocos2d::CCPrettyPrinter::setIndentLevel(this, *((_DWORD *)this + 2) + 1);
memset(Str, 0, 0x3E8u);
if ( a2 )
{
v12 = *((_QWORD *)a2 + 7);
v13 = v12 ? *(_QWORD *)(v12 + 288) : 0LL;
if ( v12 )
{
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
while ( 1 )
{
sub_1800095F0(Str, "%s%s: ");
v15 = strlen(Str);
v16 = *((_QWORD *)this + 8);
v17 = *((_QWORD *)this + 9);
if ( v15 > v17 - v16 )
{
sub_180007A50((_QWORD *)this + 6, v15, 0, Str, v15);
}
else
{
*((_QWORD *)this + 8) = v16 + v15;
v18 = (char *)this + 48;
if ( v17 > 0xF )
v18 = *((char **)this + 6);
v19 = &v18[v16];
memmove(&v18[v16], Str, v15);
v19[v15] = 0;
}
v20 = *((_DWORD *)this + 2);
v41 = &cocos2d::CCPrettyPrinter::`vftable';
Src = 0;
v45 = 15;
v46 = 0;
v47 = si128;
LOBYTE(v46) = 0;
v42 = v20;
v44 = 0;
LOBYTE(Src) = 0;
for ( i = 0; i < v42; ++i )
{
v22 = v44;
if ( v45 == v44 )
{
sub_180007A50(&Src, 1u, 0, "\t", 1u);
}
else
{
++v44;
p_Src = &Src;
if ( v45 > 0xF )
p_Src = (__int128 *)Src;
*(_WORD *)((char *)p_Src + v22) = 9;
}
}
(*(void (__fastcall **)(_QWORD, void ***))(**(_QWORD **)(v12 + 264) + 24LL))(*(_QWORD *)(v12 + 264), &v41);
Result = cocos2d::CCPrettyPrinter::getResult(&v41, (__int64)&v48);
v25 = (const void *)Result;
if ( *(_QWORD *)(Result + 24) > 0xFu )
v25 = *(const void **)Result;
sub_180007DF0((_QWORD *)this + 6, v25, *(_QWORD *)(Result + 16));
if ( v49 > 0xF )
{
v26 = v48;
if ( v49 + 1 >= 0x1000 )
{
v26 = *((_BYTE **)v48 - 1);
if ( (unsigned __int64)(v48 - v26 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v26);
}
if ( v47.m128i_i64[1] > 0xFuLL )
{
v27 = (void *)v46;
if ( (unsigned __int64)(v47.m128i_i64[1] + 1) >= 0x1000 )
{
v27 = *(void **)(v46 - 8);
if ( (unsigned __int64)(v46 - (_QWORD)v27 - 8) > 0x1F )
LABEL_55:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v27);
}
v47 = si128;
LOBYTE(v46) = 0;
if ( v45 > 0xF )
{
v28 = (void *)Src;
if ( v45 + 1 >= 0x1000 )
{
v28 = *(void **)(Src - 8);
if ( (unsigned __int64)(Src - (_QWORD)v28 - 8) > 0x1F )
goto LABEL_55;
}
j_j_free_0(v28);
}
v29 = v13;
v12 = v13;
v13 = v13 ? *(_QWORD *)(v13 + 288) : 0LL;
if ( !v29 )
break;
v30 = *((_QWORD *)this + 8);
v31 = *((_QWORD *)this + 9);
if ( v31 == v30 )
{
sub_180007A50((_QWORD *)this + 6, 1u, 0, "\n", 1u);
}
else
{
*((_QWORD *)this + 8) = v30 + 1;
v32 = (char *)this + 48;
if ( v31 > 0xF )
v32 = *((char **)this + 6);
*(_WORD *)&v32[v30] = 10;
}
}
}
}
cocos2d::CCPrettyPrinter::setIndentLevel(this, *((_DWORD *)this + 2) - 1);
v33 = (_QWORD *)((char *)this + 48);
v34 = *((_QWORD *)this + 8);
v35 = *((_QWORD *)this + 9);
if ( v35 == v34 )
{
sub_180007A50(v33, 1u, 0, "\n", 1u);
}
else
{
*((_QWORD *)this + 8) = v34 + 1;
if ( v35 > 0xF )
v33 = (_QWORD *)*v33;
*(_WORD *)((char *)v33 + v34) = 10;
}
v36 = (char *)this + 16;
if ( *((_QWORD *)this + 5) > 0xFu )
v36 = *((char **)this + 2);
sub_180007DF0((_QWORD *)this + 6, v36, *((_QWORD *)this + 4));
v37 = (_QWORD *)((char *)this + 48);
v38 = *((_QWORD *)this + 8);
v39 = *((_QWORD *)this + 9);
if ( v39 - v38 < 7 )
{
sub_180007A50(v37, 7u, 0, "", 7u);
}
else
{
*((_QWORD *)this + 8) = v38 + 7;
if ( v39 > 0xF )
v37 = (_QWORD *)*v37;
v40 = (char *)v37 + v38;
memmove((char *)v37 + v38, "", 7u);
v40[7] = 0;
}
}