//
// sub_14033B0F0 from 0x14033b0f0 to 0x14033b34c (604 bytes)
//
// 3 xrefs:
// > MusicDownloadManager::createSongsInfo @ 0x14033debc
// > MusicDownloadManager::responseToDict @ 0x14033e433
// > ??> @ 0x1406d548c
//
// 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
//
// Hidden C++ exception states: #wind=2
cocos2d::CCArray *__fastcall sub_14033B0F0(__int64 *a1, __int64 a2)
{
cocos2d::CCArray *v4; // r12
unsigned __int64 v5; // rbx
char *v6; // r9
__int64 v7; // rcx
size_t v8; // r15
size_t v9; // r14
__int64 v10; // rbp
unsigned __int64 v11; // rcx
size_t v12; // r8
size_t v13; // rcx
__int64 *v14; // rax
void **v15; // rdx
size_t v16; // r8
struct cocos2d::CCObject *v17; // rax
void *v18; // rcx
char *v19; // r9
__int64 v20; // rcx
void *v21; // rcx
void *v22; // rcx
void *Block[2]; // [rsp+38h] [rbp-80h] BYREF
__int64 v25; // [rsp+48h] [rbp-70h]
unsigned __int64 v26; // [rsp+50h] [rbp-68h]
__int128 v27; // [rsp+58h] [rbp-60h] BYREF
__int64 v28; // [rsp+68h] [rbp-50h]
unsigned __int64 v29; // [rsp+70h] [rbp-48h]
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v5 = 0;
v6 = (char *)a2;
if ( *(_QWORD *)(a2 + 24) > 0xFu )
v6 = *(char **)a2;
v7 = (__int64)a1;
if ( (unsigned __int64)a1[3] > 0xF )
v7 = *a1;
v8 = *(_QWORD *)(a2 + 16);
v9 = a1[2];
v10 = sub_14003BCE0(v7, v9, 0, v6, v8);
while ( 1 )
{
*(_OWORD *)Block = 0;
v25 = 0;
v26 = 0;
v11 = a1[2];
if ( v11 < v5 )
sub_14003BCC0(v11);
v12 = v10 - v5;
v13 = v11 - v5;
if ( v13 < v10 - v5 )
v12 = v13;
v14 = a1;
if ( (unsigned __int64)a1[3] > 0xF )
v14 = (__int64 *)*a1;
sub_14003A930(Block, (char *)v14 + v5, v12);
if ( v25 || v5 != v9 )
{
v15 = Block;
if ( v26 > 0xF )
v15 = (void **)Block[0];
v27 = 0;
v28 = 0;
v29 = 0;
v16 = -1;
do
++v16;
while ( *((_BYTE *)v15 + v16) );
sub_14003A930(&v27, v15, v16);
v17 = (struct cocos2d::CCObject *)cocos2d::CCString::create(&v27);
cocos2d::CCArray::addObject(v4, v17);
if ( v29 > 0xF )
{
v18 = (void *)v27;
if ( v29 + 1 >= 0x1000 )
{
v18 = *(void **)(v27 - 8);
if ( (unsigned __int64)(v27 - (_QWORD)v18 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v18);
}
}
if ( v10 == -1 )
break;
v5 = v10 + (int)v8;
v19 = (char *)a2;
if ( *(_QWORD *)(a2 + 24) > 0xFu )
v19 = *(char **)a2;
v20 = (__int64)a1;
if ( (unsigned __int64)a1[3] > 0xF )
v20 = *a1;
v10 = sub_14003BCE0(v20, a1[2], v10 + (int)v8, v19, *(_QWORD *)(a2 + 16));
if ( v26 > 0xF )
{
v21 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v21 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v21 - 8) > 0x1F )
goto LABEL_34;
}
j_j_free(v21);
}
}
if ( v26 > 0xF )
{
v22 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v22 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v22 - 8) > 0x1F )
LABEL_34:
invalid_parameter_noinfo_noreturn();
}
j_j_free(v22);
}
return v4;
}