//
// sub_58183C from 0x58183c to 0x5819b0 (372 bytes)
//
// 2 xrefs:
// > GJAccountManager::onLoginAccountCompleted @ 0x581a94
// > GJAccountManager::onSyncAccountCompleted @ 0x5827ae
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:54 +0000
//
cocos2d::CCArray *__fastcall sub_58183C(cocos2d::CCArray *a1, const char *a2)
{
cocos2d::CCArray *v4; // r0
int v5; // r6
int v6; // r4
unsigned __int8 *v7; // r9
size_t v8; // r0
unsigned __int8 *v9; // r4
unsigned __int8 *v10; // r0
unsigned __int8 *i; // r3
const char *v12; // r2
int v13; // t1
int v14; // r4
int v15; // r6
unsigned int v16; // r11
const char *v17; // r11
size_t v18; // r0
cocos2d::CCObject *v19; // r0
int v20; // r2
int v21; // r2
unsigned __int8 *v22; // r4
size_t v23; // r0
unsigned __int8 *v24; // r3
unsigned __int8 *v25; // r0
const char *v26; // r2
int v27; // t1
cocos2d::CCArray *v29; // [sp+Ch] [bp-30h]
unsigned int v30; // [sp+14h] [bp-28h]
int v31[3]; // [sp+1Ch] [bp-20h] BYREF
int v32[3]; // [sp+28h] [bp-14h] BYREF
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v5 = *(unsigned __int8 *)a1;
if ( (v5 & 1) != 0 )
{
v6 = *((_DWORD *)a1 + 1);
v7 = *((unsigned __int8 **)a1 + 2);
}
else
{
v6 = v5 >> 1;
v7 = (unsigned __int8 *)a1 + 1;
}
v29 = v4;
v8 = strlen(a2);
if ( v6 && v8 )
{
v9 = &v7[v6];
v10 = (unsigned __int8 *)&a2[v8];
for ( i = v7; i != v9; ++i )
{
v12 = a2;
while ( v12 != (const char *)v10 )
{
v13 = *(unsigned __int8 *)v12++;
if ( *i == v13 )
{
v14 = i - v7;
goto LABEL_14;
}
}
}
}
v14 = -1;
LABEL_14:
if ( (v5 & 1) != 0 )
v15 = *((_DWORD *)a1 + 1);
else
v15 = v5 >> 1;
v16 = 0;
while ( 1 )
{
std::string::basic_string(v31, (unsigned __int8 *)a1, v16, v14 - v16);
if ( (v31[0] & 1) != 0 )
{
if ( v31[1] || v16 != v15 )
{
v17 = (const char *)v31[2];
LABEL_27:
memset(v32, 0, sizeof(v32));
v18 = strlen(v17);
std::string::__init(v32, v17, v18);
v19 = (cocos2d::CCObject *)cocos2d::CCString::create(v32);
cocos2d::CCArray::addObject(v29, v19);
std::string::~string((int)v32);
}
}
else if ( LOBYTE(v31[0]) >> 1 || v16 != v15 )
{
v17 = (char *)v31 + 1;
goto LABEL_27;
}
if ( v14 == -1 )
break;
v20 = *(unsigned __int8 *)a1;
v16 = v14 + 1;
if ( (v20 & 1) != 0 )
{
v21 = *((_DWORD *)a1 + 1);
v22 = *((unsigned __int8 **)a1 + 2);
}
else
{
v21 = v20 >> 1;
v22 = (unsigned __int8 *)a1 + 1;
}
v30 = v21;
v23 = strlen(a2);
if ( v16 < v30 && v23 )
{
v24 = &v22[v16];
v25 = (unsigned __int8 *)&a2[v23];
while ( v24 != &v22[v30] )
{
v26 = a2;
while ( v26 != (const char *)v25 )
{
v27 = *(unsigned __int8 *)v26++;
if ( *v24 == v27 )
{
v14 = v24 - v22;
goto LABEL_42;
}
}
++v24;
}
}
v14 = -1;
LABEL_42:
std::string::~string((int)v31);
}
std::string::~string((int)v31);
return v29;
}