//
// sub_DEC0E8 from 0xdec0e8 to 0xdec60c (1316 bytes)
//
// 1 xrefs:
// > sub_DEE968 @ 0xdef538
//
// 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:09:14 +0000
//
void **__fastcall sub_DEC0E8(_QWORD *a1, const char *a2, const char *a3, unsigned __int8 a4)
{
unsigned int v7; // w23
time_t v8; // x21
_QWORD *v9; // x24
time_t v10; // x22
_QWORD *v11; // x0
time_t v12; // x5
_QWORD *v13; // x19
unsigned int v14; // w28
_QWORD *v15; // x19
void **v16; // x22
size_t v17; // d8
time_t v18; // x4
__int64 v19; // x1
const char *v20; // x25
size_t v21; // x27
const char *v22; // x0
_BYTE *v23; // x20
char *v24; // x0
size_t v25; // x0
void (__fastcall **v26)(_BYTE *); // x1
_BYTE *v27; // x0
int v28; // w20
void **v29; // x20
const char *v30; // x0
char *v31; // x0
const char *v32; // x0
char *v33; // x0
const char *v34; // x0
char *v35; // x0
const char *v36; // x0
char *v37; // x0
const char *v38; // x0
char *v39; // x0
const char *v40; // x0
char *v41; // x0
const char *v42; // x0
char *v43; // x0
const char *v44; // x0
char *v45; // x0
void *v46; // x4
char v47; // w3
char v48; // w2
char v49; // w1
char v50; // w0
void **result; // x0
size_t v52; // x27
size_t v53; // x0
size_t v54; // x20
const char *v55; // x25
__int64 *v56; // d9
char *v57; // x0
__int64 *v58; // x0
__int64 *v59; // x19
void ***i; // x1
__int64 v61; // x20
__int64 v62; // x1
_QWORD *v63; // x2
void **v64; // x0
size_t v65; // [xsp+88h] [xbp+88h]
const char *v66; // [xsp+88h] [xbp+88h]
char buf[8]; // [xsp+90h] [xbp+90h] BYREF
char v68[16]; // [xsp+98h] [xbp+98h] BYREF
v7 = a4;
v8 = time(nullptr);
if ( !a1 || !*a1 )
return nullptr;
v9 = nullptr;
v10 = time(nullptr);
v11 = (_QWORD *)*a1;
if ( *a1 )
{
do
{
while ( 1 )
{
v12 = v11[6];
v13 = (_QWORD *)*v11;
if ( v10 > v12 )
{
if ( v12 )
break;
}
v9 = v11;
v11 = (_QWORD *)*v11;
if ( !v13 )
goto LABEL_11;
}
if ( v11 == (_QWORD *)*a1 )
*a1 = v13;
else
*v9 = v13;
--a1[3];
sub_DEAC48((void **)v11);
v11 = v13;
}
while ( v13 );
}
LABEL_11:
v14 = 1;
if ( !inet_pton(2, a2, buf) )
v14 = inet_pton(10, a2, v68) != 0;
v15 = (_QWORD *)*a1;
if ( !*a1 )
return nullptr;
v16 = nullptr;
v17 = 0;
do
{
while ( 1 )
{
v18 = v15[6];
if ( v8 >= v18 && v18 || *((unsigned __int8 *)v15 + 88) > v7 )
goto LABEL_16;
v19 = v15[5];
if ( !v19 )
goto LABEL_22;
if ( *((unsigned __int8 *)v15 + 64) > v14 )
{
v66 = (const char *)v15[5];
v52 = strlen(v66);
v53 = strlen(a2);
v54 = v53;
if ( v52 > v53 )
goto LABEL_16;
v55 = &a2[v53 - v52];
if ( (unsigned int)sub_E0A69C(v66, v55) && (v52 == v54 || *(v55 - 1) == 46) )
goto LABEL_22;
if ( v14 < *((unsigned __int8 *)v15 + 64) )
goto LABEL_16;
v19 = v15[5];
}
if ( !(unsigned int)sub_E0A69C(a2, v19) )
goto LABEL_16;
LABEL_22:
v20 = (const char *)v15[4];
if ( !v20 )
break;
v21 = strlen((const char *)v15[4]);
if ( v21 == 1 )
break;
v22 = off_154A3D8(a3);
v23 = v22;
if ( !v22 )
goto LABEL_16;
v24 = strchr(v22, 63);
if ( v24 )
*v24 = 0;
if ( *v23 == 47 )
{
v56 = &ZZN7cocos2d11CCFileUtils16getClassTypeInfoEvE2id_ptr;
}
else
{
v56 = &ZZN7cocos2d11CCFileUtils16getClassTypeInfoEvE2id_ptr;
off_154A3C8(v23);
v57 = off_154A3D8((const char *)&word_11BA098);
v23 = v57;
if ( !v57 )
goto LABEL_16;
}
v25 = strlen(v23);
if ( v21 > v25 || (v65 = v25, strncmp(v20, v23, v21)) )
{
(*(void (__fastcall **)(_BYTE *))v56[239])(v23);
goto LABEL_16;
}
v26 = (void (__fastcall **)(_BYTE *))v56[239];
v27 = v23;
if ( v21 == v65 )
{
(*v26)(v23);
break;
}
v28 = (unsigned __int8)v23[v21];
(*v26)(v27);
if ( v28 == 47 )
break;
LABEL_16:
v15 = (_QWORD *)*v15;
if ( !v15 )
goto LABEL_52;
}
v29 = (void **)off_154A3E0(0x60u, 1u);
if ( !v29 )
goto LABEL_71;
v30 = (const char *)v15[7];
if ( v30 )
{
v31 = off_154A3D8(v30);
v29[7] = v31;
if ( !v31 )
goto LABEL_70;
}
v32 = (const char *)v15[5];
if ( v32 )
{
v33 = off_154A3D8(v32);
v29[5] = v33;
if ( !v33 )
goto LABEL_70;
}
v34 = (const char *)v15[3];
if ( v34 )
{
v35 = off_154A3D8(v34);
v29[3] = v35;
if ( !v35 )
goto LABEL_70;
}
v36 = (const char *)v15[4];
if ( v36 )
{
v37 = off_154A3D8(v36);
v29[4] = v37;
if ( !v37 )
goto LABEL_70;
}
v38 = (const char *)v15[1];
if ( v38 )
{
v39 = off_154A3D8(v38);
v29[1] = v39;
if ( !v39 )
goto LABEL_70;
}
v40 = (const char *)v15[2];
if ( v40 )
{
v41 = off_154A3D8(v40);
v29[2] = v41;
if ( !v41 )
goto LABEL_70;
}
if ( (v42 = (const char *)v15[10]) != nullptr && (v43 = off_154A3D8(v42), (v29[10] = v43) == nullptr)
|| (v44 = (const char *)v15[9]) != nullptr && (v45 = off_154A3D8(v44), (v29[9] = v45) == nullptr) )
{
LABEL_70:
sub_DEAC48(v29);
goto LABEL_71;
}
v46 = (void *)v15[6];
v47 = *((_BYTE *)v15 + 64);
v48 = *((_BYTE *)v15 + 88);
v49 = *((_BYTE *)v15 + 89);
++v17;
v50 = *((_BYTE *)v15 + 90);
*v29 = v16;
v16 = v29;
v29[6] = v46;
v15 = (_QWORD *)*v15;
*((_BYTE *)v29 + 64) = v47;
*((_BYTE *)v29 + 88) = v48;
*((_BYTE *)v29 + 89) = v49;
*((_BYTE *)v29 + 90) = v50;
}
while ( v15 );
LABEL_52:
result = v16;
if ( !v17 )
return result;
v58 = (__int64 *)off_154A3C0(8 * v17);
v59 = v58;
if ( v58 )
{
for ( i = (void ***)v58; v16; v16 = (void **)*v16 )
*i++ = v16;
qsort(v58, v17, 8u, (int (*)(const void *, const void *))sub_DEACD8);
v61 = *v59;
v62 = 0;
if ( v17 != 1 )
{
do
{
v63 = (_QWORD *)v59[v62++];
*v63 = v59[v62];
}
while ( v62 != v17 - 1 );
}
*(_QWORD *)v59[v17 - 1] = 0;
off_154A3C8(v59);
return (void **)v61;
}
LABEL_71:
while ( v16 )
{
v64 = v16;
v16 = (void **)*v16;
sub_DEAC48(v64);
}
return nullptr;
}