//
// sub_AC4F6C from 0xac4f6c to 0xac52c8 (860 bytes)
//
// 4 xrefs:
// > GJMultiplayerManager::onJoinLobbyCompleted @ 0xac5ca0
// > GJMultiplayerManager::onJoinLobbyCompleted @ 0xac5d4c
// > GJMultiplayerManager::onJoinLobbyCompleted @ 0xac5dbc
// > GJMultiplayerManager::onJoinLobbyCompleted @ 0xac6000
//
// 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:01:07 +0000
//
cocos2d::CCArray *__fastcall sub_AC4F6C(unsigned __int8 *a1, const char *a2)
{
__int64 v4; // x0
int v5; // w19
unsigned __int8 *v6; // x27
__int64 v7; // x20
size_t v8; // x0
__int64 v9; // x27
__int64 v10; // x24
int v11; // w20
size_t v12; // x0
unsigned __int64 v13; // x25
size_t v14; // x2
unsigned __int64 v15; // x19
unsigned __int8 *v16; // x1
size_t v17; // x19
unsigned __int8 *v18; // x1
int v19; // w26
const char *v20; // x1
size_t v21; // x0
cocos2d::CCObject *v22; // x0
unsigned __int8 *v23; // x27
unsigned __int64 v24; // x28
size_t v25; // x0
unsigned __int8 *v26; // x6
unsigned __int8 *v27; // x28
unsigned __int8 *v28; // x0
int v29; // w4
const char *v30; // x1
__int64 v32; // x24
const char *v33; // x0
unsigned __int8 *v34; // x2
int v35; // w20
const char *v36; // x22
cocos2d::CCArray *v37; // [xsp+60h] [xbp+60h]
char *v38; // [xsp+68h] [xbp+68h]
__int64 v39; // [xsp+78h] [xbp+78h] BYREF
__int64 v40; // [xsp+80h] [xbp+80h]
void *v41; // [xsp+88h] [xbp+88h]
__int64 v42[2]; // [xsp+90h] [xbp+90h] BYREF
void *v43; // [xsp+A0h] [xbp+A0h]
v4 = cocos2d::CCArray::create(_stack_chk_guard);
v5 = *a1;
v37 = (cocos2d::CCArray *)v4;
if ( (v5 & 1) != 0 )
{
v6 = *((unsigned __int8 **)a1 + 2);
v7 = *((_QWORD *)a1 + 1);
v8 = strlen(a2);
if ( !v8 || !v7 || (v32 = (__int64)&v6[v7], v33 = &a2[v8], v6 == &v6[v7]) )
{
v9 = -1;
v10 = v7;
goto LABEL_8;
}
}
else
{
v11 = v5 >> 1;
v12 = strlen(a2);
v10 = v5 >> 1;
if ( !v12 || !v11 )
{
v9 = -1;
goto LABEL_8;
}
v6 = a1 + 1;
v33 = &a2[v12];
v32 = (__int64)&a1[v11 + 1];
if ( a1 + 1 == (unsigned __int8 *)v32 )
{
v9 = -1;
goto LABEL_58;
}
}
v34 = v6;
while ( a2 == v33 )
{
LABEL_54:
if ( (unsigned __int8 *)v32 == ++v34 )
{
v9 = -1;
goto LABEL_60;
}
}
v35 = *v34;
if ( *(unsigned __int8 *)a2 != v35 )
{
v36 = a2;
while ( v33 != ++v36 )
{
if ( *(unsigned __int8 *)v36 == v35 )
goto LABEL_59;
}
goto LABEL_54;
}
LABEL_59:
v9 = v34 - v6;
LABEL_60:
v11 = v5 >> 1;
if ( (v5 & 1) == 0 )
{
LABEL_58:
v10 = v11;
goto LABEL_8;
}
v10 = *((_QWORD *)a1 + 1);
LABEL_8:
v13 = 0;
LABEL_9:
v39 = 0;
v14 = v9 - v13;
v40 = 0;
v41 = nullptr;
if ( (v5 & 1) == 0 )
goto LABEL_29;
LABEL_10:
v15 = *((_QWORD *)a1 + 1);
if ( v13 > v15 )
LABEL_62:
sub_62E95C();
v16 = *((unsigned __int8 **)a1 + 2);
LABEL_12:
v17 = v15 - v13;
v18 = &v16[v13];
if ( v17 <= v14 )
v14 = v17;
std::string::__init(&v39, v18, v14);
v19 = v39 & 1;
if ( v19 )
{
if ( v13 != v10 || (v19 = 1, v40) )
{
v20 = (const char *)v41;
goto LABEL_18;
}
}
else if ( v13 != v10 || (int)(unsigned __int8)v39 >> 1 )
{
v20 = (char *)&v39 + 1;
LABEL_18:
v42[0] = 0;
v42[1] = 0;
v43 = nullptr;
v38 = (char *)v20;
v21 = strlen(v20);
std::string::__init(v42, v38, v21);
v22 = (cocos2d::CCObject *)cocos2d::CCString::create(v42);
cocos2d::CCArray::addObject(v37, v22);
if ( (v42[0] & 1) != 0 )
operator delete(v43);
v19 = v39 & 1;
}
if ( v9 != -1 )
{
v5 = *a1;
v13 = v9 + 1;
if ( (v5 & 1) != 0 )
{
v23 = *((unsigned __int8 **)a1 + 2);
v24 = *((_QWORD *)a1 + 1);
}
else
{
v23 = a1 + 1;
v24 = (unsigned __int8)v5 >> 1;
}
v25 = strlen(a2);
if ( !v25 || v13 >= v24 || (v26 = &v23[v13], v27 = &v23[v24], v28 = (unsigned __int8 *)&a2[v25], &v23[v13] == v27) )
{
v9 = -1;
goto LABEL_27;
}
while ( 1 )
{
if ( a2 != (const char *)v28 )
{
v29 = *v26;
if ( *(unsigned __int8 *)a2 == v29 )
{
LABEL_43:
v9 = v26 - v23;
LABEL_27:
if ( !v19 )
goto LABEL_9;
operator delete(v41);
v5 = *a1;
v39 = 0;
v14 = v9 - v13;
v40 = 0;
v41 = nullptr;
if ( (v5 & 1) != 0 )
goto LABEL_10;
LABEL_29:
v15 = v5 >> 1;
if ( v13 > v15 )
goto LABEL_62;
v16 = a1 + 1;
goto LABEL_12;
}
v30 = a2;
while ( v28 != (unsigned __int8 *)++v30 )
{
if ( *(unsigned __int8 *)v30 == v29 )
goto LABEL_43;
}
}
if ( v27 == ++v26 )
{
v9 = -1;
goto LABEL_27;
}
}
}
if ( v19 )
operator delete(v41);
return v37;
}