//
// LevelBrowserLayer::setupPageInfo from 0x7f6a98 to 0x7f6f80 (1256 bytes)
//
// 4 xrefs:
// > `non-virtual thunk to'LevelBrowserLayer::setupPageInfo @ 0x7f6f84
// > ??> @ 0x532c0
// > ??> @ 0x143e8b8
// > ??> @ 0x14dbea8
//
// 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:54:38 +0000
//
__int64 __fastcall LevelBrowserLayer::setupPageInfo(__int64 a1, __int64 a2, char *a3)
{
const char *v6; // x1
size_t v7; // x0
cocos2d::CCArray *v8; // x0
__int64 v9; // x0
unsigned __int8 v10; // w2
cocos2d::CCArray *v11; // x25
unsigned __int64 v12; // x24
_BYTE *v13; // x19
__int64 v14; // x22
unsigned __int64 v15; // x19
size_t v16; // x3
unsigned __int64 v17; // x2
char *i; // x1
size_t v19; // x2
char *v20; // x1
int v21; // w1
const char *v22; // x1
size_t v23; // x0
cocos2d::CCObject *v24; // x0
char *v25; // x2
unsigned __int64 v26; // x0
char *v27; // x3
char *v28; // x0
cocos2d::CCString *v29; // x0
cocos2d::CCString *v30; // x0
cocos2d::CCString *v31; // x0
__int64 v32; // x2
__int64 v33; // x0
__int64 v34; // x19
void (__fastcall *v35)(__int64); // x20
__int64 *v36; // x20
_BYTE *v37; // x22
std::logic_error *exception; // x20
char *v39; // [xsp+68h] [xbp+68h]
char *v40; // [xsp+68h] [xbp+68h]
__int64 v41; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v42; // [xsp+78h] [xbp+78h]
void *v43; // [xsp+80h] [xbp+80h]
__int64 v44; // [xsp+88h] [xbp+88h] BYREF
__int64 v45; // [xsp+90h] [xbp+90h]
void *v46; // [xsp+98h] [xbp+98h]
__int64 v47[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v48; // [xsp+B0h] [xbp+B0h]
if ( *(_BYTE *)(a1 + 764) || !LevelBrowserLayer::isCorrect((LevelBrowserLayer *)a1, a3) )
return _stack_chk_guard;
if ( (*(_BYTE *)a2 & 1) != 0 )
v6 = *(const char **)(a2 + 16);
else
v6 = (const char *)(a2 + 1);
v39 = (char *)v6;
v41 = 0;
v42 = 0;
v43 = nullptr;
v7 = strlen(v6);
v8 = (cocos2d::CCArray *)std::string::__init(&v41, v39, v7);
v9 = cocos2d::CCArray::create(v8);
v10 = v41;
v11 = (cocos2d::CCArray *)v9;
if ( (v41 & 1) == 0 )
{
LODWORD(v12) = (int)(unsigned __int8)v41 >> 1;
if ( !(_DWORD)v12 )
goto LABEL_8;
v13 = (char *)&v41 + 1;
v14 = -1;
v36 = (__int64 *)((char *)&v41 + (int)v12 + 1);
if ( v36 == (__int64 *)((char *)&v41 + 1) )
{
LABEL_68:
v12 = (int)v12;
goto LABEL_10;
}
LABEL_59:
v37 = v13;
if ( *v13 == 58 )
{
v14 = 0;
}
else
{
do
{
if ( v36 == (__int64 *)++v37 )
{
v14 = -1;
goto LABEL_71;
}
}
while ( *v37 != 58 );
v14 = v37 - v13;
}
LABEL_71:
LODWORD(v12) = (int)(unsigned __int8)v41 >> 1;
if ( (v41 & 1) != 0 )
{
v12 = v42;
goto LABEL_10;
}
goto LABEL_68;
}
v12 = v42;
v13 = v43;
if ( v42 )
{
v36 = (__int64 *)((char *)v43 + v42);
if ( v43 == (char *)v43 + v42 )
goto LABEL_9;
goto LABEL_59;
}
LABEL_8:
v12 = 0;
LABEL_9:
v14 = -1;
LABEL_10:
v44 = 0;
v45 = 0;
v15 = 0;
v46 = nullptr;
v16 = v14;
if ( (v41 & 1) == 0 )
goto LABEL_29;
LABEL_11:
v17 = v42;
if ( v15 > v42 )
{
LABEL_69:
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);
}
for ( i = (char *)v43; ; i = (char *)&v41 + 1 )
{
v19 = v17 - v15;
v20 = &i[v15];
if ( v19 > v16 )
v19 = v16;
std::string::__init(&v44, v20, v19);
v21 = v44 & 1;
if ( v21 )
{
if ( v15 == v12 )
{
v21 = 1;
if ( !v45 )
goto LABEL_22;
}
v22 = (const char *)v46;
}
else
{
if ( v15 == v12 && !((int)(unsigned __int8)v44 >> 1) )
goto LABEL_22;
v22 = (char *)&v44 + 1;
}
v40 = (char *)v22;
v47[0] = 0;
v47[1] = 0;
v48 = nullptr;
v23 = strlen(v22);
std::string::__init(v47, v40, v23);
v24 = (cocos2d::CCObject *)cocos2d::CCString::create(v47);
cocos2d::CCArray::addObject(v11, v24);
if ( (v47[0] & 1) != 0 )
operator delete(v48);
v21 = v44 & 1;
LABEL_22:
if ( v14 == -1 )
break;
v15 = v14 + 1;
if ( (v41 & 1) != 0 )
{
v25 = (char *)v43;
v26 = v42;
}
else
{
v26 = (unsigned __int8)v41 >> 1;
v25 = (char *)&v41 + 1;
}
v14 = -1;
if ( v15 >= v26 || (v27 = &v25[v15], v28 = &v25[v26], &v25[v15] == v28) )
{
if ( !v21 )
goto LABEL_27;
}
else if ( v25[v15] == 58 )
{
LABEL_43:
v14 = v27 - v25;
if ( !v21 )
goto LABEL_27;
}
else
{
while ( v28 != ++v27 )
{
if ( *v27 == 58 )
goto LABEL_43;
}
v14 = -1;
if ( !v21 )
{
LABEL_27:
v10 = v41;
goto LABEL_28;
}
}
operator delete(v46);
v10 = v41;
LABEL_28:
v44 = 0;
v16 = v14 - v15;
v45 = 0;
v46 = nullptr;
if ( (v10 & 1) != 0 )
goto LABEL_11;
LABEL_29:
v17 = v10 >> 1;
if ( v15 > v17 )
goto LABEL_69;
}
if ( v21 )
operator delete(v46);
if ( (v41 & 1) != 0 )
operator delete(v43);
if ( (unsigned int)cocos2d::CCArray::count(v11) > 2 )
{
v29 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v11, 0);
*(_DWORD *)(a1 + 720) = cocos2d::CCString::intValue(v29);
v30 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v11, 1u);
*(_DWORD *)(a1 + 724) = cocos2d::CCString::intValue(v30);
v31 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v11, 2u);
*(_DWORD *)(a1 + 728) = cocos2d::CCString::intValue(v31);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 624) + 344LL))(*(_QWORD *)(a1 + 624));
v32 = *(_QWORD *)(a1 + 616);
if ( *(_DWORD *)(a1 + 724) + *(_DWORD *)(a1 + 728) >= *(_DWORD *)(a1 + 720) )
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v32 + 344LL))(*(_QWORD *)(a1 + 616), 0);
else
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)v32 + 344LL))(*(_QWORD *)(a1 + 616), 1);
LevelBrowserLayer::updateLevelsLabel((LevelBrowserLayer *)a1);
v33 = *(_QWORD *)(a1 + 664);
if ( v33 )
*(_DWORD *)(v33 + 400) = *(_DWORD *)(a1 + 720);
v34 = *(_QWORD *)(a1 + 688);
v35 = *(void (__fastcall **)(__int64))(*(_QWORD *)v34 + 344LL);
if ( !(*(unsigned __int8 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 616) + 352LL))(*(_QWORD *)(a1 + 616)) )
(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 624) + 352LL))(*(_QWORD *)(a1 + 624));
v35(v34);
}
return _stack_chk_guard;
}