//
// MessagesProfilePage::setupPageInfo from 0xa4a92c to 0xa4ad3c (1040 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'MessagesProfilePage::setupPageInfo @ 0xa4ad40
// > ??> @ 0x66ef8
// > ??> @ 0x148b0d8
//
// 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:02 +0000
//
__int64 __fastcall MessagesProfilePage::setupPageInfo(MessagesProfilePage *a1, __int64 a2, char *a3)
{
const char *v5; // x1
size_t v6; // x0
cocos2d::CCArray *v7; // x0
__int64 v8; // x0
unsigned __int8 v9; // w2
cocos2d::CCArray *v10; // x25
unsigned __int64 v11; // x24
_BYTE *v12; // x19
__int64 v13; // x22
unsigned __int64 v14; // x19
size_t v15; // x3
unsigned __int64 v16; // x2
char *i; // x1
size_t v18; // x2
char *v19; // x1
int v20; // w1
const char *v21; // x1
size_t v22; // x0
cocos2d::CCObject *v23; // x0
char *v24; // x2
unsigned __int64 v25; // x0
cocos2d::CCString *v26; // x0
cocos2d::CCString *v27; // x0
cocos2d::CCString *v28; // x0
__int64 *v30; // x20
char *v31; // x3
char *v32; // x0
_BYTE *v33; // x22
std::logic_error *exception; // x20
char *v35; // [xsp+68h] [xbp+68h]
char *v36; // [xsp+68h] [xbp+68h]
__int64 v37; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v38; // [xsp+78h] [xbp+78h]
void *v39; // [xsp+80h] [xbp+80h]
__int64 v40; // [xsp+88h] [xbp+88h] BYREF
__int64 v41; // [xsp+90h] [xbp+90h]
void *v42; // [xsp+98h] [xbp+98h]
__int64 v43[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v44; // [xsp+B0h] [xbp+B0h]
if ( !MessagesProfilePage::isCorrect(a1, a3) )
return _stack_chk_guard;
v5 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v5 = *(const char **)(a2 + 16);
v35 = (char *)v5;
v37 = 0;
v38 = 0;
v39 = nullptr;
v6 = strlen(v5);
v7 = (cocos2d::CCArray *)std::string::__init(&v37, v35, v6);
v8 = cocos2d::CCArray::create(v7);
v9 = v37;
v10 = (cocos2d::CCArray *)v8;
if ( (v37 & 1) == 0 )
{
LODWORD(v11) = (int)(unsigned __int8)v37 >> 1;
if ( !(_DWORD)v11 )
goto LABEL_6;
v12 = (char *)&v37 + 1;
v13 = -1;
v30 = (__int64 *)((char *)&v37 + (int)v11 + 1);
if ( v30 == (__int64 *)((char *)&v37 + 1) )
{
LABEL_38:
v11 = (int)v11;
goto LABEL_8;
}
LABEL_54:
v33 = v12;
if ( *v12 == 58 )
{
v13 = 0;
}
else
{
do
{
if ( v30 == (__int64 *)++v33 )
{
v13 = -1;
goto LABEL_61;
}
}
while ( *v33 != 58 );
v13 = v33 - v12;
}
LABEL_61:
LODWORD(v11) = (int)(unsigned __int8)v37 >> 1;
if ( (v37 & 1) != 0 )
{
v11 = v38;
goto LABEL_8;
}
goto LABEL_38;
}
v11 = v38;
v12 = v39;
if ( v38 )
{
v30 = (__int64 *)((char *)v39 + v38);
if ( v39 == (char *)v39 + v38 )
goto LABEL_7;
goto LABEL_54;
}
LABEL_6:
v11 = 0;
LABEL_7:
v13 = -1;
LABEL_8:
v40 = 0;
v41 = 0;
v14 = 0;
v42 = nullptr;
v15 = v13;
if ( (v37 & 1) == 0 )
goto LABEL_27;
LABEL_9:
v16 = v38;
if ( v14 > v38 )
{
LABEL_59:
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 *)v39; ; i = (char *)&v37 + 1 )
{
v18 = v16 - v14;
v19 = &i[v14];
if ( v18 > v15 )
v18 = v15;
std::string::__init(&v40, v19, v18);
v20 = v40 & 1;
if ( v20 )
{
if ( v14 == v11 )
{
v20 = 1;
if ( !v41 )
goto LABEL_20;
}
v21 = (const char *)v42;
}
else
{
if ( v14 == v11 && !((int)(unsigned __int8)v40 >> 1) )
goto LABEL_20;
v21 = (char *)&v40 + 1;
}
v36 = (char *)v21;
v43[0] = 0;
v43[1] = 0;
v44 = nullptr;
v22 = strlen(v21);
std::string::__init(v43, v36, v22);
v23 = (cocos2d::CCObject *)cocos2d::CCString::create(v43);
cocos2d::CCArray::addObject(v10, v23);
if ( (v43[0] & 1) != 0 )
operator delete(v44);
v20 = v40 & 1;
LABEL_20:
if ( v13 == -1 )
break;
v14 = v13 + 1;
if ( (v37 & 1) != 0 )
{
v24 = (char *)v39;
v25 = v38;
}
else
{
v25 = (unsigned __int8)v37 >> 1;
v24 = (char *)&v37 + 1;
}
v13 = -1;
if ( v14 >= v25 || (v31 = &v24[v14], v32 = &v24[v25], &v24[v14] == v32) )
{
if ( !v20 )
goto LABEL_25;
}
else if ( v24[v14] == 58 )
{
LABEL_51:
v13 = v31 - v24;
if ( !v20 )
goto LABEL_25;
}
else
{
while ( v32 != ++v31 )
{
if ( *v31 == 58 )
goto LABEL_51;
}
v13 = -1;
if ( !v20 )
{
LABEL_25:
v9 = v37;
goto LABEL_26;
}
}
operator delete(v42);
v9 = v37;
LABEL_26:
v40 = 0;
v15 = v13 - v14;
v41 = 0;
v42 = nullptr;
if ( (v9 & 1) != 0 )
goto LABEL_9;
LABEL_27:
v16 = v9 >> 1;
if ( v14 > v16 )
goto LABEL_59;
}
if ( v20 )
operator delete(v42);
if ( (v37 & 1) != 0 )
operator delete(v39);
if ( (unsigned int)cocos2d::CCArray::count(v10) > 2 )
{
v26 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v10, 0);
*((_DWORD *)a1 + 204) = cocos2d::CCString::intValue(v26);
v27 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v10, 1u);
*((_DWORD *)a1 + 205) = cocos2d::CCString::intValue(v27);
v28 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v10, 2u);
*((_DWORD *)a1 + 206) = cocos2d::CCString::intValue(v28);
MessagesProfilePage::updatePageArrows(a1);
}
return _stack_chk_guard;
}