//
// DS_Dictionary::getVec2ArrayForKey from 0xb49280 to 0xb4952c (684 bytes)
//
// 1 xrefs:
// > ??> @ 0xb8a40
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
std::vector *DS_Dictionary::getVec2ArrayForKey(
std::vector *__return_ptr retstr,
DS_Dictionary *a2,
const char *a3)
{
std::string *m_start; // x21
std::string *m_finish; // x26
__int64 v7; // x21
cocos2d::CCPoint *v8; // x0
std::string *v9; // x1
std::string *v10; // x19
cocos2d::CCPoint *v11; // x28
__int64 v12; // x1
unsigned __int64 v13; // x2
unsigned __int64 v14; // x3
unsigned __int64 v15; // x26
__int64 v16; // x0
cocos2d::CCPoint *v17; // x2
cocos2d::CCPoint *v18; // x27
cocos2d::CCPoint *v19; // x19
cocos2d::CCPoint *v20; // x25
cocos2d::CCPoint *v21; // x19
std::string *v22; // x1
stl::StringData::Internal *m_data; // x1
__int64 *v24; // x0
unsigned int *v25; // x1
int v26; // w2
cocos2d::CCPoint v28; // [xsp+68h] [xbp+68h] BYREF
std::vector v29; // [xsp+70h] [xbp+70h] BYREF
DS_Dictionary::getStringArrayForKey(&v29, a2, a3);
m_start = v29.m_start;
m_finish = v29.m_finish;
retstr->m_start = nullptr;
retstr->m_finish = nullptr;
retstr->m_reserveEnd = nullptr;
if ( m_finish - m_start )
{
v7 = 0;
while ( 1 )
{
cocos2d::CCPoint::CCPoint(&v28);
v8 = retstr->m_finish;
if ( v8 != retstr->m_reserveEnd )
{
if ( v8 )
{
cocos2d::CCPoint::CCPoint(v8, &v28);
v8 = retstr->m_finish;
}
v9 = v29.m_start;
retstr->m_finish = v8 + 1;
if ( !DS_Dictionary::vec2FromString(a2, (__int64)&v9[v7], v8) )
{
LABEL_22:
m_finish = v29.m_finish;
v10 = v29.m_start;
retstr->m_finish = retstr->m_start;
goto LABEL_23;
}
goto LABEL_6;
}
v11 = retstr->m_start;
v12 = (char *)v8 - (char *)retstr->m_start;
v13 = v12 >> 3;
if ( !(v12 >> 3) )
break;
v14 = 2 * v13;
v15 = 0x1FFFFFFFFFFFFFFFLL;
if ( v13 > 2 * v13 )
goto LABEL_10;
if ( v14 > 0x1FFFFFFFFFFFFFFFLL )
goto LABEL_10;
v15 = 2 * v13;
if ( v14 )
goto LABEL_10;
v17 = retstr->m_finish;
v19 = (cocos2d::CCPoint *)byte_8;
v18 = nullptr;
LABEL_11:
if ( (char *)v18 + v12 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)v18 + v12), &v28);
v20 = retstr->m_finish;
v11 = retstr->m_start;
}
else
{
v20 = v17;
}
if ( v11 != v20 )
{
v21 = v18;
do
{
if ( v21 )
cocos2d::CCPoint::CCPoint(v21, v11);
++v11;
++v21;
}
while ( v11 != v20 );
v20 = retstr->m_start;
v19 = v21 + 1;
}
if ( v20 )
operator delete(v20);
v22 = v29.m_start;
retstr->m_start = v18;
retstr->m_finish = v19;
retstr->m_reserveEnd = &v18[v15];
if ( !DS_Dictionary::vec2FromString(a2, (__int64)&v22[v7], v19 - 1) )
goto LABEL_22;
LABEL_6:
v10 = v29.m_start;
if ( ++v7 >= (unsigned __int64)(v29.m_finish - v29.m_start) )
{
m_finish = v29.m_finish;
goto LABEL_23;
}
}
v15 = 1;
LABEL_10:
v16 = operator new(v15 * 8);
v11 = retstr->m_start;
v17 = retstr->m_finish;
v18 = (cocos2d::CCPoint *)v16;
v19 = (cocos2d::CCPoint *)(v16 + 8);
v12 = (char *)v17 - (char *)retstr->m_start;
goto LABEL_11;
}
v10 = m_start;
LABEL_23:
if ( v10 != m_finish )
{
do
{
while ( 1 )
{
m_data = v10->m_data.m_data;
v24 = (__int64 *)((char *)v10->m_data.m_data - 24);
if ( v24 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)((char *)m_data - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *((_DWORD *)m_data - 2);
*((_DWORD *)m_data - 2) = v26 - 1;
}
if ( v26 <= 0 )
break;
}
if ( ++v10 == m_finish )
goto LABEL_32;
}
++v10;
operator delete(v24);
}
while ( v10 != m_finish );
LABEL_32:
m_finish = v29.m_start;
}
if ( m_finish )
operator delete(m_finish);
return retstr;
}