//
// WriteArchive::process from 0xc18928 to 0xc18b7c (596 bytes)
//
// 6 xrefs:
// > sub_C2D970 @ 0xc2daf8
// > sub_C2D970 @ 0xc2db0c
// > sub_C2D970 @ 0xc2db3c
// > sub_C2D970 @ 0xc2db48
// > processFMODAudioState @ 0xc2ded4
// > ??> @ 0xc2368
//
// This function is hookable on this platform (idp: arm, 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 13:04:04 +0000
//
__int64 __fastcall WriteArchive::process(WriteArchive *this, const char **a2)
{
cocos2d::CCString *v3; // x0
size_t v4; // x0
int v5; // w0
char *v6; // x20
size_t v7; // x24
__int64 v8; // x23
unsigned __int64 v9; // x22
__int64 v10; // x0
size_t v11; // x2
char *v12; // x23
size_t v13; // x0
__int64 v14; // x20
unsigned __int64 v15; // x22
__int64 v16; // x0
__int64 v18; // x0
void *v19; // x0
void *v20; // x0
size_t v21; // x0
void *v22; // x0
__int64 v23; // x0
char *CString; // [xsp+48h] [xbp+48h]
size_t v25; // [xsp+48h] [xbp+48h]
__int64 v26; // [xsp+50h] [xbp+50h] BYREF
size_t v27; // [xsp+58h] [xbp+58h]
void *v28; // [xsp+60h] [xbp+60h]
v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%llu", *a2);
v26 = 0;
CString = (char *)cocos2d::CCString::getCString(v3);
v27 = 0;
v28 = nullptr;
v4 = strlen(CString);
std::string::__init(&v26, CString, v4);
if ( (v26 & 1) != 0 )
{
v7 = v27;
v6 = (char *)v28;
v20 = v28;
if ( v27 )
{
v8 = *(_QWORD *)this;
v9 = *(_QWORD *)this + v27;
if ( v9 <= *((_QWORD *)this + 1) )
{
v23 = *((_QWORD *)this + 2);
*(_QWORD *)this = v9;
v22 = (void *)(v23 + v8);
LABEL_25:
memmove(v22, v6, v7);
if ( (v26 & 1) == 0 )
goto LABEL_6;
goto LABEL_26;
}
goto LABEL_23;
}
if ( !v28 )
{
v8 = *(_QWORD *)this;
if ( *((_QWORD *)this + 1) >= *(_QWORD *)this )
goto LABEL_27;
v9 = *(_QWORD *)this;
goto LABEL_23;
}
}
else
{
v5 = (int)(unsigned __int8)v26 >> 1;
v6 = (char *)&v26 + 1;
v7 = v5;
if ( v5 )
{
v8 = *(_QWORD *)this;
v9 = v5 + *(_QWORD *)this;
if ( v9 <= *((_QWORD *)this + 1) )
goto LABEL_4;
goto LABEL_23;
}
}
v21 = strlen(v6);
v8 = *(_QWORD *)this;
v7 = v21;
v9 = v21 + *(_QWORD *)this;
if ( v9 <= *((_QWORD *)this + 1) )
{
LABEL_4:
*(_QWORD *)this = v9;
v10 = *((_QWORD *)this + 2);
if ( !v7 )
goto LABEL_5;
goto LABEL_24;
}
LABEL_23:
fmt::internal::Array::grow((size_t *)this, v9);
*(_QWORD *)this = v9;
v10 = *((_QWORD *)this + 2);
if ( v7 )
{
LABEL_24:
v22 = (void *)(v10 + v8);
goto LABEL_25;
}
LABEL_5:
if ( (v26 & 1) == 0 )
goto LABEL_6;
LABEL_26:
v20 = v28;
LABEL_27:
operator delete(v20);
LABEL_6:
if ( (*((_BYTE *)this + 528) & 1) == 0 )
{
v11 = *((_BYTE *)this + 528) >> 1;
v12 = (char *)this + 529;
if ( !(*((_BYTE *)this + 528) >> 1) )
goto LABEL_8;
LABEL_11:
v14 = *(_QWORD *)this;
v15 = v11 + *(_QWORD *)this;
if ( v15 <= *((_QWORD *)this + 1) )
{
v18 = *((_QWORD *)this + 2);
*(_QWORD *)this = v15;
v19 = (void *)(v18 + v14);
LABEL_19:
memmove(v19, v12, v11);
return _stack_chk_guard;
}
goto LABEL_17;
}
v11 = *((_QWORD *)this + 67);
v12 = *((char **)this + 68);
if ( v11 )
goto LABEL_11;
if ( !v12 )
{
v14 = *(_QWORD *)this;
if ( *(_QWORD *)this <= *((_QWORD *)this + 1) )
return _stack_chk_guard;
v15 = *(_QWORD *)this;
v11 = 0;
goto LABEL_17;
}
LABEL_8:
v13 = strlen(v12);
v14 = *(_QWORD *)this;
v11 = v13;
v15 = v13 + *(_QWORD *)this;
if ( v15 > *((_QWORD *)this + 1) )
{
LABEL_17:
v25 = v11;
fmt::internal::Array::grow((size_t *)this, v15);
*(_QWORD *)this = v15;
v11 = v25;
v16 = *((_QWORD *)this + 2);
if ( !v25 )
return _stack_chk_guard;
goto LABEL_18;
}
*(_QWORD *)this = v15;
v16 = *((_QWORD *)this + 2);
if ( v11 )
{
LABEL_18:
v19 = (void *)(v16 + v14);
goto LABEL_19;
}
return _stack_chk_guard;
}