//
// ProfilePage::setupPageInfo from 0x1008a70b0 to 0x1008a7540 (1168 bytes)
//
// 2 xrefs:
// > sub_1008A75B0 @ 0x1008a75bc
// > ??> @ 0x100ba9be8
//
// This function is hookable on this platform (idp: pc, 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:37:16 +0000
//
char __fastcall ProfilePage::setupPageInfo(_DWORD *a1, __int64 a2, const char *a3)
{
unsigned int v3; // eax
const char *v4; // r14
size_t v5; // rax
size_t v6; // r15
char *v7; // rbx
size_t v8; // r12
char *v9; // rax
unsigned __int64 v10; // r15
__int64 v11; // r14
unsigned __int64 v12; // rsi
char *v13; // rdx
unsigned __int64 v14; // rcx
bool v15; // zf
unsigned __int64 v16; // r12
char *v17; // r13
size_t v18; // r12
char *v19; // rbx
char v20; // al
const char *v21; // r12
size_t v22; // r15
size_t v23; // rax
size_t v24; // r13
char *v25; // rbx
size_t v26; // r15
_QWORD *v27; // rax
__int64 v28; // rbx
char *v29; // rax
unsigned __int64 v30; // rsi
__int64 v31; // r8
char *v32; // rdx
unsigned __int64 v33; // rdi
__int64 v34; // rax
_DWORD *v35; // rbx
__int64 v36; // rax
__int64 v37; // rax
unsigned __int64 v40; // [rsp+8h] [rbp-88h]
void *v41; // [rsp+10h] [rbp-80h]
_QWORD v42[2]; // [rsp+18h] [rbp-78h] BYREF
void *__p; // [rsp+28h] [rbp-68h]
char __s[8]; // [rsp+30h] [rbp-60h] BYREF
size_t v45; // [rsp+38h] [rbp-58h]
void *v46; // [rsp+40h] [rbp-50h]
__int64 v47; // [rsp+48h] [rbp-48h]
size_t __dst; // [rsp+50h] [rbp-40h] BYREF
unsigned __int64 v49; // [rsp+58h] [rbp-38h]
void *v50; // [rsp+60h] [rbp-30h]
LOBYTE(v3) = sub_1008A6DD0((__int64)a1, a3);
if ( !(_BYTE)v3 )
return v3;
if ( (*(_BYTE *)a2 & 1) != 0 )
v4 = *(const char **)(a2 + 16);
else
v4 = (const char *)(a2 + 1);
v5 = strlen(v4);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
v7 = (char *)operator new(v8);
v50 = v7;
__dst = v8 + 1;
v49 = v6;
goto LABEL_12;
}
LOBYTE(__dst) = 2 * v5;
v7 = (char *)&__dst + 1;
if ( v5 )
LABEL_12:
memmove(v7, v4, v6);
v7[v6] = 0;
v41 = sub_1007FE900();
if ( (__dst & 1) != 0 )
{
v9 = (char *)v50;
v10 = v49;
v11 = -1;
if ( !v49 )
goto LABEL_23;
LABEL_17:
v12 = v10;
v13 = v9;
while ( *v13 != 58 )
{
++v13;
if ( !--v12 )
{
v13 = &v9[v10];
break;
}
}
v11 = -1;
if ( v13 != &v9[v10] )
v11 = v13 - v9;
goto LABEL_23;
}
v10 = (unsigned __int8)__dst >> 1;
v9 = (char *)&__dst + 1;
v11 = -1;
if ( (unsigned __int8)__dst >> 1 )
goto LABEL_17;
LABEL_23:
v14 = 0;
v40 = v10;
do
{
if ( (__dst & 1) != 0 )
{
v16 = v49;
if ( v49 < v14 )
LABEL_75:
sub_100056810();
v17 = (char *)v50;
}
else
{
v16 = (unsigned __int8)__dst >> 1;
v17 = (char *)&__dst + 1;
if ( v14 > v16 )
goto LABEL_75;
}
v18 = v16 - v14;
if ( v18 >= v11 - v14 )
v18 = v11 - v14;
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v47 = v14;
if ( v18 >= 0x17 )
{
v22 = (v18 | 7) + 1;
if ( (v18 | 7) == 0x17 )
v22 = 26;
v19 = (char *)operator new(v22);
v46 = v19;
*(_QWORD *)__s = v22 | 1;
v45 = v18;
v10 = v40;
}
else
{
__s[0] = 2 * v18;
v19 = &__s[1];
if ( !v18 )
{
__s[1] = 0;
v20 = __s[0];
if ( (__s[0] & 1) == 0 )
goto LABEL_36;
goto LABEL_43;
}
}
memmove(v19, &v17[v47], v18);
v19[v18] = 0;
v20 = __s[0];
if ( (__s[0] & 1) == 0 )
{
LABEL_36:
if ( !v20 && v47 == v10 )
goto LABEL_56;
v21 = &__s[1];
goto LABEL_46;
}
LABEL_43:
if ( !v45 && v47 == v10 )
goto LABEL_56;
v21 = (const char *)v46;
LABEL_46:
v23 = strlen(v21);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v24 = v23;
if ( v23 >= 0x17 )
{
v26 = (v23 | 7) + 1;
if ( (v23 | 7) == 0x17 )
v26 = 26;
v25 = (char *)operator new(v26);
__p = v25;
v42[0] = v26 | 1;
v42[1] = v24;
v10 = v40;
LABEL_53:
memmove(v25, v21, v24);
goto LABEL_54;
}
LOBYTE(v42[0]) = 2 * v23;
v25 = (char *)v42 + 1;
if ( v23 )
goto LABEL_53;
LABEL_54:
v25[v24] = 0;
v27 = sub_10088E600((__int64)v42);
sub_1007FEBF0((__int64)v41, (__int64)v27);
if ( (v42[0] & 1) != 0 )
operator delete(__p);
LABEL_56:
v28 = -1;
if ( v11 == -1 )
goto LABEL_57;
if ( (__dst & 1) != 0 )
{
v29 = (char *)v50;
v30 = v49;
v31 = v11 + 1;
v47 = v11 + 1;
if ( v49 <= v11 + 1 )
goto LABEL_57;
}
else
{
v30 = (unsigned __int8)__dst >> 1;
v29 = (char *)&__dst + 1;
v31 = v11 + 1;
v47 = v11 + 1;
if ( v30 <= v11 + 1 )
goto LABEL_57;
}
v32 = &v29[v31];
v33 = v30 + ~v11;
while ( *v32 != 58 )
{
++v32;
if ( !--v33 )
{
v32 = &v29[v30];
break;
}
}
v28 = v32 - v29;
if ( v32 == &v29[v30] )
v28 = -1;
LABEL_57:
if ( (__s[0] & 1) != 0 )
operator delete(v46);
v15 = v11 == -1;
v11 = v28;
v14 = v47;
}
while ( !v15 );
if ( (__dst & 1) != 0 )
operator delete(v50);
v3 = sub_1007FEF90((__int64)v41);
if ( v3 >= 3 )
{
v34 = sub_1007FEFE0((__int64)v41, 0);
v35 = a1;
a1[212] = cocos2d::CCString::intValue(v34);
v36 = sub_1007FEFE0((__int64)v41, 1u);
a1[213] = cocos2d::CCString::intValue(v36);
v37 = sub_1007FEFE0((__int64)v41, 2u);
a1[214] = cocos2d::CCString::intValue(v37);
(*(void (__fastcall **)(_QWORD, bool))(**((_QWORD **)v35 + 100) + 344LL))(*((_QWORD *)v35 + 100), v35[213] != 0);
LOBYTE(v3) = (*(__int64 (__fastcall **)(_QWORD, bool))(**((_QWORD **)v35 + 99) + 344LL))(
*((_QWORD *)v35 + 99),
v35[213] + v35[214] < v35[212]);
}
return v3;
}