//
// sub_3F7FF0 from 0x3f7ff0 to 0x3f818a (410 bytes)
//
// 2 xrefs:
// > CreateGuidelinesLayer::getMergedRecordString @ 0x3f9020
// > CreateGuidelinesLayer::getMergedRecordString @ 0x3f9030
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:18 +0000
//
cocos2d::CCArray *__fastcall sub_3F7FF0(cocos2d::CCArray *a1)
{
cocos2d::CCArray *v2; // r0
int v3; // r6
cocos2d::CCArray *v4; // r11
int v5; // r3
unsigned __int8 *v6; // r2
unsigned __int8 *v7; // r3
unsigned __int8 *v8; // r1
unsigned __int8 *v9; // r4
int v10; // lr
int v11; // r4
int v12; // r6
unsigned int v13; // r7
int v14; // r0
size_t v15; // r2
unsigned int v16; // r0
std::logic_error *exception; // r4
char *v18; // r1
char *v19; // r1
char *v20; // r7
size_t v21; // r0
cocos2d::CCObject *v22; // r0
int v23; // r2
unsigned int v24; // r2
unsigned __int8 *v25; // r1
unsigned __int8 *v26; // r0
unsigned __int8 *v27; // r2
unsigned __int8 *v28; // r4
int v29; // lr
int v31; // [sp+Ch] [bp-20h] BYREF
int v32; // [sp+10h] [bp-1Ch]
char *v33; // [sp+14h] [bp-18h]
int v34[3]; // [sp+18h] [bp-14h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v3 = *(unsigned __int8 *)a1;
v4 = v2;
if ( (v3 & 1) == 0 )
{
v5 = v3 >> 1;
if ( !(v3 >> 1) )
{
v11 = -1;
goto LABEL_16;
}
v6 = (unsigned __int8 *)a1 + 1;
LABEL_6:
v7 = &v6[v5];
v8 = v6;
while ( 1 )
{
v9 = v8;
if ( v8 == v7 )
break;
v10 = *v8++;
if ( v10 == 126 )
{
v11 = v9 - v6;
goto LABEL_11;
}
}
v11 = -1;
LABEL_11:
if ( (v3 & 1) != 0 )
goto LABEL_14;
LABEL_16:
v12 = v3 >> 1;
goto LABEL_17;
}
v5 = *((_DWORD *)a1 + 1);
v6 = *((unsigned __int8 **)a1 + 2);
if ( v5 )
goto LABEL_6;
v11 = -1;
LABEL_14:
v12 = *((_DWORD *)a1 + 1);
LABEL_17:
v13 = 0;
while ( 1 )
{
v14 = *(unsigned __int8 *)a1;
v15 = v11 - v13;
v31 = 0;
v32 = 0;
v33 = nullptr;
if ( (v14 & 1) != 0 )
{
v16 = *((_DWORD *)a1 + 1);
if ( v13 > v16 )
goto LABEL_22;
v18 = *((char **)a1 + 2);
}
else
{
v16 = v14 >> 1;
if ( v13 > v16 )
{
LABEL_22:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v18 = (char *)a1 + 1;
}
v19 = &v18[v13];
if ( v15 >= v16 - v13 )
v15 = v16 - v13;
std::string::__init(&v31, v19, v15);
if ( (v31 & 1) != 0 )
{
if ( v32 || v13 != v12 )
{
v20 = v33;
LABEL_36:
memset(v34, 0, sizeof(v34));
v21 = strlen(v20);
std::string::__init(v34, v20, v21);
v22 = (cocos2d::CCObject *)cocos2d::CCString::create(v34);
cocos2d::CCArray::addObject(v4, v22);
std::string::~string((int)v34);
}
}
else if ( (unsigned __int8)v31 >> 1 || v13 != v12 )
{
v20 = (char *)&v31 + 1;
goto LABEL_36;
}
if ( v11 == -1 )
break;
v23 = *(unsigned __int8 *)a1;
v13 = v11 + 1;
if ( (v23 & 1) != 0 )
{
v24 = *((_DWORD *)a1 + 1);
v25 = *((unsigned __int8 **)a1 + 2);
}
else
{
v24 = v23 >> 1;
v25 = (unsigned __int8 *)a1 + 1;
}
if ( v13 < v24 )
{
v26 = &v25[v13];
v27 = &v25[v24];
while ( 1 )
{
v28 = v26;
if ( v26 == v27 )
break;
v29 = *v26++;
if ( v29 == 126 )
{
v11 = v28 - v25;
goto LABEL_47;
}
}
}
v11 = -1;
LABEL_47:
std::string::~string((int)&v31);
}
std::string::~string((int)&v31);
return v4;
}