//
// sub_67930C from 0x67930c to 0x679bca (2238 bytes)
//
// 5 xrefs:
// > sub_679BCC @ 0x679fa6
// > sub_679BCC @ 0x67a0ca
// > sub_679BCC @ 0x67a0e4
// > sub_679BCC @ 0x67a0fe
// > sub_679BCC @ 0x67a118
//
// 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
//
unsigned int __fastcall sub_67930C(int (__fastcall ***a1)(_DWORD, _DWORD, _DWORD), unsigned int a2, int *a3)
{
unsigned __int8 *v6; // r11
int v7; // r12
unsigned __int8 *v8; // r6
int v9; // r4
int v10; // r5
size_t v11; // r10
size_t v12; // t1
_DWORD *v13; // r1
int v14; // r5
int v15; // r6
_DWORD *v16; // r12
int v17; // r9
int v18; // r4
int v19; // r0
unsigned __int8 *v20; // r3
int v21; // t1
int v22; // r3
unsigned int v23; // r6
unsigned int result; // r0
const char *v25; // r12
unsigned __int8 *v26; // r3
unsigned int v27; // lr
int v28; // r8
unsigned __int8 *v29; // r7
int32x4_t v30; // q8
const char *v31; // r2
unsigned int v32; // r0
int v33; // r4
const char *v34; // r5
int v35; // r10
int v36; // r3
const char *v37; // r10
int v38; // r5
int v39; // r10
unsigned int v40; // r5
unsigned int v41; // r9
int32x4_t *v42; // r1
int8x8x2_t *v43; // r9
int v44; // r10
int v45; // r1
int v46; // r4
int v47; // r3
unsigned int v48; // r9
int v49; // r1
bool v50; // cf
unsigned int v51; // r5
unsigned int v52; // r4
int v53; // r9
char v54; // r0
bool v55; // cc
int v56; // r5
int v57; // r0
unsigned int v58; // r0
const char *v59; // r1
const char *v60; // r3
_DWORD *v61; // [sp+4h] [bp-530h]
int v62; // [sp+4h] [bp-530h]
const char *v63; // [sp+8h] [bp-52Ch]
_DWORD *v64; // [sp+8h] [bp-52Ch]
_DWORD *v65; // [sp+8h] [bp-52Ch]
unsigned __int8 *v66; // [sp+Ch] [bp-528h]
_BYTE v67[260]; // [sp+28h] [bp-50Ch] BYREF
_DWORD v68[258]; // [sp+12Ch] [bp-408h] BYREF
int8x8x2_t v69; // 0:d18.8,8:d19.8
if ( a2 > 3 )
{
(*a1)[5] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))&dword_34;
(*a1)[6] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))a2;
((void (__fastcall *)(int (__fastcall ***)(_DWORD, _DWORD, _DWORD)))**a1)(a1);
}
v6 = (unsigned __int8 *)a1[a2 + 49];
if ( !v6 )
{
(*a1)[5] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))&dword_34;
(*a1)[6] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))a2;
((void (__fastcall *)(int (__fastcall ***)(_DWORD, _DWORD, _DWORD)))**a1)(a1);
}
v7 = *a3;
if ( !*a3 )
{
v7 = (*a1[1])(a1, 1, 1424);
*a3 = v7;
}
v8 = v6;
v9 = 0;
v10 = 1;
*(_DWORD *)(v7 + 140) = v6;
v61 = (_DWORD *)v7;
do
{
v12 = *++v8;
v11 = v12;
if ( (int)(v12 + v9) > 256 )
{
(*a1)[5] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))byte_9;
((void (__fastcall *)(int (__fastcall ***)(_DWORD, _DWORD, _DWORD)))**a1)(a1);
}
v13 = (_DWORD *)v10++;
if ( v11 )
{
memset(&v67[v9], (int)v13, v11);
v9 += v11;
}
}
while ( v10 != 17 );
v14 = 0;
v67[v9] = 0;
v15 = v67[0];
v16 = v61;
v17 = v67[0];
if ( v67[0] )
{
v18 = 0;
while ( 1 )
{
v19 = v15;
if ( v15 == v17 )
break;
if ( v14 >= 1 << v17 )
{
LABEL_109:
v65 = v16;
(*a1)[5] = (int (__fastcall *)(_DWORD, _DWORD, _DWORD))byte_9;
((void (__fastcall *)(int (__fastcall ***)(_DWORD, _DWORD, _DWORD), _DWORD *))**a1)(a1, v13);
v16 = v65;
LABEL_19:
v14 *= 2;
++v17;
if ( !v15 )
goto LABEL_20;
}
else
{
v14 *= 2;
++v17;
}
}
v20 = &v67[v18 + 1];
v13 = &v68[v18 - 1];
do
{
v18 = v20 - v67;
v21 = *v20++;
v15 = v21;
v13[1] = v14;
++v13;
++v14;
}
while ( v19 == v21 );
if ( v14 < 1 << v17 )
goto LABEL_19;
goto LABEL_109;
}
LABEL_20:
v22 = v6[1];
if ( v6[1] )
{
v16[19] = -v68[0];
v22 = v6[1];
v16[1] = v68[v22 - 1];
}
else
{
v16[1] = -1;
}
if ( v6[2] )
{
v16[20] = v22 - v68[v22];
v22 += v6[2];
v16[2] = v68[v22 - 1];
}
else
{
v16[2] = -1;
}
if ( v6[3] )
{
v16[21] = v22 - v68[v22];
v22 += v6[3];
v16[3] = v68[v22 - 1];
}
else
{
v16[3] = -1;
}
if ( v6[4] )
{
v16[22] = v22 - v68[v22];
v22 += v6[4];
v16[4] = v68[v22 - 1];
}
else
{
v16[4] = -1;
}
if ( v6[5] )
{
v16[23] = v22 - v68[v22];
v22 += v6[5];
v16[5] = v68[v22 - 1];
}
else
{
v16[5] = -1;
}
if ( v6[6] )
{
v16[24] = v22 - v68[v22];
v22 += v6[6];
v16[6] = v68[v22 - 1];
}
else
{
v16[6] = -1;
}
if ( v6[7] )
{
v16[25] = v22 - v68[v22];
v22 += v6[7];
v16[7] = v68[v22 - 1];
}
else
{
v16[7] = -1;
}
if ( v6[8] )
{
v16[26] = v22 - v68[v22];
v22 += v6[8];
v16[8] = v68[v22 - 1];
}
else
{
v16[8] = -1;
}
if ( v6[9] )
{
v16[27] = v22 - v68[v22];
v22 += v6[9];
v16[9] = v68[v22 - 1];
}
else
{
v16[9] = -1;
}
if ( v6[10] )
{
v16[28] = v22 - v68[v22];
v22 += v6[10];
v16[10] = v68[v22 - 1];
}
else
{
v16[10] = -1;
}
if ( v6[11] )
{
v16[29] = v22 - v68[v22];
v22 += v6[11];
v16[11] = v68[v22 - 1];
}
else
{
v16[11] = -1;
}
if ( v6[12] )
{
v16[30] = v22 - v68[v22];
v22 += v6[12];
v16[12] = v68[v22 - 1];
}
else
{
v16[12] = -1;
}
if ( v6[13] )
{
v16[31] = v22 - v68[v22];
v22 += v6[13];
v16[13] = v68[v22 - 1];
}
else
{
v16[13] = -1;
}
if ( v6[14] )
{
v16[32] = v22 - v68[v22];
v22 += v6[14];
v16[14] = v68[v22 - 1];
}
else
{
v16[14] = -1;
}
if ( v6[15] )
{
v16[33] = v22 - v68[v22];
v22 += v6[15];
v16[15] = v68[v22 - 1];
}
else
{
v16[15] = -1;
}
if ( v6[16] )
{
v16[34] = v22 - v68[v22];
v16[16] = v68[v22 - 1 + v6[16]];
}
else
{
v16[16] = -1;
}
v16[17] = "ayer7onCloseEPN7cocos2d8CCObjectE";
v63 = (const char *)v16;
v23 = 1;
result = (unsigned int)memset(v16 + 36, 0, 0x400u);
v66 = v6 + 1;
v25 = v63;
v62 = 0;
v26 = v6 + 1;
do
{
if ( *v26 )
{
v27 = 1 << (8 - v23);
v28 = 1;
v29 = &v6[v62 + 18];
v30 = vdupq_n_s32(v23);
v64 = &v68[v62 - 1];
v31 = (const char *)&v6[v62 + 17];
do
{
v47 = v64[1];
++v64;
v36 = v47 << (8 - v23);
v48 = (unsigned int)&v25[v36 + 1168];
v49 = 4 * v36 + 144;
v50 = v48 >= (unsigned int)v29;
if ( v48 < (unsigned int)v29 )
v50 = v31 >= &v25[v36 + 1168 + v27];
v51 = (unsigned int)&v25[4 * v27 + 144 + 4 * v36];
v52 = (unsigned int)&v25[v49];
v53 = v36;
v54 = v50;
v55 = v51 > (unsigned int)v31;
if ( v51 > (unsigned int)v31 )
v55 = (unsigned int)v29 > v52;
v56 = !v55;
if ( v27 > 0x14 )
v57 = v54 & 1;
else
v57 = 0;
if ( (v57 & v56) != 0 )
{
v32 = ((int)(v52 << 29) >> 31) & 3;
v33 = 1 << (8 - v23);
if ( v32 >= v27 )
v32 = 1 << (8 - v23);
if ( v32 )
{
v34 = &v25[v36];
v35 = v36 + 1;
*(_DWORD *)&v25[4 * v36 + 144] = v23;
v33 = v27 - 1;
if ( v32 == 1 )
++v36;
*((_BYTE *)v34 + 1168) = *v31;
if ( v32 != 1 )
{
v37 = &v25[v35];
v38 = v36 + 2;
*(_DWORD *)&v25[4 * v36 + 148] = v23;
v33 = v27 - 2;
if ( v32 != 3 )
v36 += 2;
*((_BYTE *)v37 + 1168) = *v31;
if ( v32 == 3 )
{
v39 = v36 + 38;
v33 = v27 - 3;
v36 += 3;
*(_DWORD *)&v25[4 * v39] = v23;
v25[v38 + 1168] = *v31;
}
}
}
v40 = v27 - v32;
v41 = v53 + 1168 + v32;
v69 = vld1q_dup_s8(v31);
v42 = (int32x4_t *)&v25[4 * v32 + v49];
result = ((v27 - v32 - 16) >> 4) + 1;
v43 = (int8x8x2_t *)&v25[v41];
*v42 = v30;
v44 = 16 * result;
v42[1] = v30;
v42[2] = v30;
v42[3] = v30;
*v43 = v69;
if ( result != 1 )
{
v42[4] = v30;
v42[5] = v30;
v42[6] = v30;
v42[7] = v30;
v43[1] = v69;
if ( result != 2 )
{
v42[8] = v30;
v42[9] = v30;
v42[10] = v30;
v42[11] = v30;
v43[2] = v69;
if ( result != 3 )
{
v42[12] = v30;
v42[13] = v30;
v42[14] = v30;
v42[15] = v30;
v43[3] = v69;
if ( result != 4 )
{
v42[16] = v30;
v42[17] = v30;
v42[18] = v30;
v42[19] = v30;
v43[4] = v69;
if ( result != 5 )
{
v42[20] = v30;
v42[21] = v30;
v42[22] = v30;
v42[23] = v30;
v43[5] = v69;
if ( result != 6 )
{
v42[24] = v30;
v42[25] = v30;
v42[26] = v30;
v42[27] = v30;
v43[6] = v69;
if ( result == 8 )
{
v42[28] = v30;
v42[29] = v30;
v42[30] = v30;
v42[31] = v30;
v43[7] = v69;
}
}
}
}
}
}
}
v45 = v36 + v44;
v46 = v33 - v44;
if ( v40 != v44 )
{
result = (unsigned int)&v25[v45];
*(_DWORD *)&v25[4 * v45 + 144] = v23;
v25[v45 + 1168] = *v31;
if ( v46 != 1 )
{
result = v45 + 2;
*(_DWORD *)&v25[4 * v45 + 148] = v23;
v25[v45 + 1169] = *v31;
if ( v46 != 2 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 152] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 3 )
{
result = v45 + 4;
*(_DWORD *)&v25[4 * v45 + 156] = v23;
v25[v45 + 1171] = *v31;
if ( v46 != 4 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 160] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 5 )
{
result = v45 + 6;
*(_DWORD *)&v25[4 * v45 + 164] = v23;
v25[v45 + 1173] = *v31;
if ( v46 != 6 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 168] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 7 )
{
result = v45 + 8;
*(_DWORD *)&v25[4 * v45 + 172] = v23;
v25[v45 + 1175] = *v31;
if ( v46 != 8 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 176] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 9 )
{
result = v45 + 10;
*(_DWORD *)&v25[4 * v45 + 180] = v23;
v25[v45 + 1177] = *v31;
if ( v46 != 10 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 184] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 11 )
{
result = v45 + 12;
*(_DWORD *)&v25[4 * v45 + 188] = v23;
v25[v45 + 1179] = *v31;
if ( v46 != 12 )
{
result += (unsigned int)v25;
*(_DWORD *)&v25[4 * v45 + 192] = v23;
*(_BYTE *)(result + 1168) = *v31;
if ( v46 != 13 )
{
*(_DWORD *)&v25[4 * v45 + 196] = v23;
result = *(unsigned __int8 *)v31;
v25[v45 + 1181] = result;
if ( v46 != 14 )
{
*(_DWORD *)&v25[4 * v45 + 200] = v23;
v25[v45 + 1182] = *v31;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else
{
v58 = v27 + 35 + v36;
v59 = &v25[4 * v36 + 140];
v60 = &v25[v36 + 1167];
result = (unsigned int)&v25[4 * v58];
do
{
*((_DWORD *)v59 + 1) = v23;
v59 += 4;
*++v60 = *v31;
}
while ( v59 != (const char *)result );
}
++v28;
++v31;
++v29;
++v62;
}
while ( v28 <= *v66 );
}
++v23;
v26 = ++v66;
}
while ( v23 != 9 );
return result;
}