//
// ProfilePage::setupPageInfo from 0xa58350 to 0xa586b4 (868 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'ProfilePage::setupPageInfo @ 0xa586b8
// > ??> @ 0xf8b78
// > ??> @ 0x148d010
//
// 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:00:08 +0000
//
__int64 __fastcall ProfilePage::setupPageInfo(ProfilePage *a1, __int64 a2, char *a3)
{
void *v5; // x1
size_t v6; // x0
cocos2d::CCArray *v7; // x0
cocos2d::CCArray *v8; // x25
unsigned __int64 v9; // x24
_BYTE *v10; // x0
__int64 v11; // x21
unsigned __int64 v12; // x19
int v13; // w1
char *v14; // x1
size_t v15; // x0
cocos2d::CCObject *v16; // x0
char *v17; // x2
unsigned __int64 v18; // x0
cocos2d::CCString *v19; // x0
cocos2d::CCString *v20; // x0
cocos2d::CCString *v21; // x0
__int64 *v23; // x1
char *v24; // x3
char *v25; // x0
_BYTE *v26; // x21
void *v27; // [xsp+68h] [xbp+68h]
__int64 v28; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v29; // [xsp+78h] [xbp+78h]
void *v30; // [xsp+80h] [xbp+80h]
__int64 v31[2]; // [xsp+88h] [xbp+88h] BYREF
void *v32; // [xsp+98h] [xbp+98h]
__int64 v33[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v34; // [xsp+B0h] [xbp+B0h]
if ( !ProfilePage::isCorrect(a1, a3) )
return _stack_chk_guard;
v5 = (void *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v5 = *(void **)(a2 + 16);
v27 = v5;
v28 = 0;
v29 = 0;
v30 = nullptr;
v6 = strlen((const char *)v5);
v7 = (cocos2d::CCArray *)std::string::__init(&v28, v27, v6);
v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v7);
if ( (v28 & 1) == 0 )
{
LODWORD(v9) = (int)(unsigned __int8)v28 >> 1;
if ( !(_DWORD)v9 )
goto LABEL_6;
v10 = (char *)&v28 + 1;
v11 = -1;
v23 = (__int64 *)((char *)&v28 + (int)v9 + 1);
if ( v23 == (__int64 *)((char *)&v28 + 1) )
{
LABEL_31:
v9 = (int)v9;
goto LABEL_8;
}
LABEL_44:
v26 = v10;
if ( *v10 == 58 )
{
v11 = 0;
}
else
{
do
{
if ( v23 == (__int64 *)++v26 )
{
v11 = -1;
goto LABEL_49;
}
}
while ( *v26 != 58 );
v11 = v26 - v10;
}
LABEL_49:
LODWORD(v9) = (int)(unsigned __int8)v28 >> 1;
if ( (v28 & 1) != 0 )
{
v9 = v29;
goto LABEL_8;
}
goto LABEL_31;
}
v9 = v29;
v10 = v30;
if ( v29 )
{
v23 = (__int64 *)((char *)v30 + v29);
if ( v30 == (char *)v30 + v29 )
goto LABEL_7;
goto LABEL_44;
}
LABEL_6:
v9 = 0;
LABEL_7:
v11 = -1;
LABEL_8:
v12 = 0;
while ( 1 )
{
std::string::basic_string(v31, (__int64)&v28, v12, v11 - v12);
v13 = v31[0] & 1;
if ( v13 )
{
if ( v12 == v9 )
{
v13 = 1;
if ( !v31[1] )
goto LABEL_16;
}
v14 = (char *)v32;
}
else
{
if ( v12 == v9 && !((int)LOBYTE(v31[0]) >> 1) )
goto LABEL_16;
v14 = (char *)v31 + 1;
}
v27 = v14;
v33[0] = 0;
v33[1] = 0;
v34 = nullptr;
v15 = strlen(v14);
std::string::__init(v33, v27, v15);
v16 = (cocos2d::CCObject *)cocos2d::CCString::create(v33);
cocos2d::CCArray::addObject(v8, v16);
if ( (v33[0] & 1) != 0 )
operator delete(v34);
v13 = v31[0] & 1;
LABEL_16:
if ( v11 == -1 )
break;
v12 = v11 + 1;
if ( (v28 & 1) != 0 )
{
v17 = (char *)v30;
v18 = v29;
}
else
{
v18 = (unsigned __int8)v28 >> 1;
v17 = (char *)&v28 + 1;
}
v11 = -1;
if ( v12 < v18 )
{
v24 = &v17[v12];
v25 = &v17[v18];
if ( &v17[v12] != v25 )
{
if ( v17[v12] == 58 )
{
LABEL_42:
v11 = v24 - v17;
}
else
{
while ( v25 != ++v24 )
{
if ( *v24 == 58 )
goto LABEL_42;
}
v11 = -1;
}
}
}
if ( v13 )
operator delete(v32);
}
if ( v13 )
operator delete(v32);
if ( (v28 & 1) != 0 )
operator delete(v30);
if ( (unsigned int)cocos2d::CCArray::count(v8) > 2 )
{
v19 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v8, 0);
*((_DWORD *)a1 + 212) = cocos2d::CCString::intValue(v19);
v20 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v8, 1u);
*((_DWORD *)a1 + 213) = cocos2d::CCString::intValue(v20);
v21 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v8, 2u);
*((_DWORD *)a1 + 214) = cocos2d::CCString::intValue(v21);
ProfilePage::updatePageArrows(a1);
}
return _stack_chk_guard;
}