//
// sub_6E8290 from 0x6e8290 to 0x6e85d0 (832 bytes)
//
// 2 xrefs:
// > CreateGuidelinesLayer::getMergedRecordString @ 0x6e9ca0
// > CreateGuidelinesLayer::getMergedRecordString @ 0x6e9cb4
//
// 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 12:51:44 +0000
//
cocos2d::CCArray *__fastcall sub_6E8290(unsigned __int8 *a1)
{
cocos2d::CCArray *v2; // x24
int v3; // w2
__int64 v4; // x23
_BYTE *v5; // x0
__int64 v6; // x20
int v7; // w0
unsigned __int64 v8; // x26
size_t v9; // x3
unsigned __int64 v10; // x2
unsigned __int8 *v11; // x1
size_t v12; // x2
unsigned __int8 *v13; // x1
int v14; // w1
const char *v15; // x1
size_t v16; // x0
cocos2d::CCObject *v17; // x0
unsigned __int8 *v18; // x3
unsigned __int64 v19; // x2
unsigned __int8 *v20; // x4
unsigned __int8 *v21; // x2
__int64 v23; // x19
_BYTE *v24; // x20
std::logic_error *exception; // x19
char *v26; // [xsp+58h] [xbp+58h]
__int64 v27; // [xsp+68h] [xbp+68h] BYREF
__int64 v28; // [xsp+70h] [xbp+70h]
void *v29; // [xsp+78h] [xbp+78h]
__int64 v30[2]; // [xsp+80h] [xbp+80h] BYREF
void *v31; // [xsp+90h] [xbp+90h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v3 = *a1;
if ( (v3 & 1) == 0 )
{
LODWORD(v4) = v3 >> 1;
if ( !(v3 >> 1) )
goto LABEL_3;
v5 = a1 + 1;
v23 = (__int64)&a1[(int)v4 + 1];
if ( a1 + 1 == (unsigned __int8 *)v23 )
{
v6 = -1;
LABEL_53:
v4 = (int)v4;
goto LABEL_5;
}
LABEL_44:
v24 = v5;
if ( *v5 == 126 )
{
v6 = 0;
}
else
{
do
{
if ( (_BYTE *)v23 == ++v24 )
{
v6 = -1;
goto LABEL_55;
}
}
while ( *v24 != 126 );
v6 = v24 - v5;
}
LABEL_55:
LODWORD(v4) = v3 >> 1;
if ( (v3 & 1) != 0 )
{
v4 = *((_QWORD *)a1 + 1);
goto LABEL_5;
}
goto LABEL_53;
}
v4 = *((_QWORD *)a1 + 1);
v5 = *((_BYTE **)a1 + 2);
if ( v4 )
{
v23 = (__int64)&v5[v4];
if ( v5 == &v5[v4] )
goto LABEL_4;
goto LABEL_44;
}
LABEL_3:
v4 = 0;
LABEL_4:
v6 = -1;
LABEL_5:
v7 = *a1;
v8 = 0;
LABEL_6:
v27 = 0;
v9 = v6 - v8;
v28 = 0;
v29 = nullptr;
if ( (v7 & 1) != 0 )
{
LABEL_7:
v10 = *((_QWORD *)a1 + 1);
if ( v8 <= v10 )
{
v11 = *((unsigned __int8 **)a1 + 2);
goto LABEL_9;
}
LABEL_51:
exception = (std::logic_error *)_cxa_allocate_exception(0x10u);
std::logic_error::logic_error(exception, "basic_string");
*(_QWORD *)exception = off_1536D68;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::logic_error::~logic_error);
}
while ( 1 )
{
v10 = v7 >> 1;
if ( v8 > v10 )
goto LABEL_51;
v11 = a1 + 1;
LABEL_9:
v12 = v10 - v8;
v13 = &v11[v8];
if ( v12 > v9 )
v12 = v9;
std::string::__init(&v27, v13, v12);
v14 = v27 & 1;
if ( v14 )
{
if ( v8 == v4 )
{
v14 = 1;
if ( !v28 )
goto LABEL_18;
}
v15 = (const char *)v29;
}
else
{
if ( v8 == v4 && !((int)(unsigned __int8)v27 >> 1) )
goto LABEL_18;
v15 = (char *)&v27 + 1;
}
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
v26 = (char *)v15;
v16 = strlen(v15);
std::string::__init(v30, v26, v16);
v17 = (cocos2d::CCObject *)cocos2d::CCString::create(v30);
cocos2d::CCArray::addObject(v2, v17);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
v14 = v27 & 1;
LABEL_18:
if ( v6 == -1 )
break;
v7 = *a1;
v8 = v6 + 1;
if ( (v7 & 1) != 0 )
{
v18 = *((unsigned __int8 **)a1 + 2);
v19 = *((_QWORD *)a1 + 1);
}
else
{
v18 = a1 + 1;
v19 = (unsigned __int8)v7 >> 1;
}
v6 = -1;
if ( v8 >= v19 || (v20 = &v18[v8], v21 = &v18[v19], &v18[v8] == v21) )
{
if ( !v14 )
goto LABEL_6;
}
else if ( v18[v8] == 126 )
{
LABEL_37:
v6 = v20 - v18;
if ( !v14 )
goto LABEL_6;
}
else
{
while ( v21 != ++v20 )
{
if ( *v20 == 126 )
goto LABEL_37;
}
v6 = -1;
if ( !v14 )
goto LABEL_6;
}
operator delete(v29);
v27 = 0;
v7 = *a1;
v9 = v6 - v8;
v28 = 0;
v29 = nullptr;
if ( (v7 & 1) != 0 )
goto LABEL_7;
}
if ( v14 )
operator delete(v29);
return v2;
}