//
// sub_567D2C from 0x567d2c to 0x567efe (466 bytes)
//
// 3 xrefs:
// > GJRateLevelLayer::setupRateInfo @ 0x567f32
// > GJRateLevelLayer::setupRateInfo @ 0x567f62
// > GJRateLevelLayer::setupRateInfo @ 0x56824a
//
// 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:52:29 +0000
//
cocos2d::CCArray *__fastcall sub_567D2C(cocos2d::CCArray *a1, const char *a2)
{
cocos2d::CCArray *v4; // r0
int v5; // r6
int v6; // r4
unsigned __int8 *v7; // r9
size_t v8; // r0
unsigned __int8 *v9; // r4
unsigned __int8 *v10; // r0
unsigned __int8 *i; // r3
const char *v12; // r2
int v13; // t1
int v14; // r4
int v15; // r6
unsigned int v16; // r11
int v17; // r0
size_t v18; // r2
unsigned int v19; // r0
std::logic_error *exception; // r4
char *v21; // r1
char *v22; // r1
char *v23; // r11
size_t v24; // r0
cocos2d::CCObject *v25; // r0
int v26; // r1
int v27; // r1
unsigned __int8 *v28; // r4
size_t v29; // r0
unsigned __int8 *v30; // r2
unsigned __int8 *v31; // r0
const char *v32; // r1
int v33; // t1
cocos2d::CCArray *v35; // [sp+4h] [bp-30h]
unsigned int v36; // [sp+Ch] [bp-28h]
int v37; // [sp+14h] [bp-20h] BYREF
int v38; // [sp+18h] [bp-1Ch]
char *v39; // [sp+1Ch] [bp-18h]
int v40[3]; // [sp+20h] [bp-14h] BYREF
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v5 = *(unsigned __int8 *)a1;
if ( (v5 & 1) != 0 )
{
v6 = *((_DWORD *)a1 + 1);
v7 = *((unsigned __int8 **)a1 + 2);
}
else
{
v6 = v5 >> 1;
v7 = (unsigned __int8 *)a1 + 1;
}
v35 = v4;
v8 = strlen(a2);
if ( v6 && v8 )
{
v9 = &v7[v6];
v10 = (unsigned __int8 *)&a2[v8];
for ( i = v7; i != v9; ++i )
{
v12 = a2;
while ( v12 != (const char *)v10 )
{
v13 = *(unsigned __int8 *)v12++;
if ( *i == v13 )
{
v14 = i - v7;
goto LABEL_14;
}
}
}
}
v14 = -1;
LABEL_14:
if ( (v5 & 1) != 0 )
v15 = *((_DWORD *)a1 + 1);
else
v15 = v5 >> 1;
v16 = 0;
while ( 1 )
{
v17 = *(unsigned __int8 *)a1;
v18 = v14 - v16;
v37 = 0;
v38 = 0;
v39 = nullptr;
if ( (v17 & 1) != 0 )
{
v19 = *((_DWORD *)a1 + 1);
if ( v16 > v19 )
goto LABEL_22;
v21 = *((char **)a1 + 2);
}
else
{
v19 = v17 >> 1;
if ( v16 > v19 )
{
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);
}
v21 = (char *)a1 + 1;
}
v22 = &v21[v16];
if ( v18 >= v19 - v16 )
v18 = v19 - v16;
std::string::__init(&v37, v22, v18);
if ( (v37 & 1) != 0 )
{
if ( v38 || v16 != v15 )
{
v23 = v39;
LABEL_36:
memset(v40, 0, sizeof(v40));
v24 = strlen(v23);
std::string::__init(v40, v23, v24);
v25 = (cocos2d::CCObject *)cocos2d::CCString::create(v40);
cocos2d::CCArray::addObject(v35, v25);
std::string::~string((int)v40);
}
}
else if ( (unsigned __int8)v37 >> 1 || v16 != v15 )
{
v23 = (char *)&v37 + 1;
goto LABEL_36;
}
if ( v14 == -1 )
break;
v26 = *(unsigned __int8 *)a1;
v16 = v14 + 1;
if ( (v26 & 1) != 0 )
{
v27 = *((_DWORD *)a1 + 1);
v28 = *((unsigned __int8 **)a1 + 2);
}
else
{
v27 = v26 >> 1;
v28 = (unsigned __int8 *)a1 + 1;
}
v36 = v27;
v29 = strlen(a2);
if ( v16 < v36 && v29 )
{
v30 = &v28[v16];
v31 = (unsigned __int8 *)&a2[v29];
while ( v30 != &v28[v36] )
{
v32 = a2;
while ( v32 != (const char *)v31 )
{
v33 = *(unsigned __int8 *)v32++;
if ( *v30 == v33 )
{
v14 = v30 - v28;
goto LABEL_51;
}
}
++v30;
}
}
v14 = -1;
LABEL_51:
std::string::~string((int)&v37);
}
std::string::~string((int)&v37);
return v35;
}