//
// sub_180073010 from 0x180073010 to 0x180073194 (388 bytes)
//
// 2 xrefs:
// > cocos2d::CCApplication::setResourceRootPath @ 0x180073b38
// > ??> @ 0x1801b4404
//
// 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
//
__int64 *__fastcall sub_180073010(__int64 *a1, __int64 *a2, __int64 a3, __int64 a4)
{
_OWORD *v4; // rdi
__int64 v5; // rbp
_OWORD *v8; // rax
char *v9; // rbx
_QWORD *v10; // r14
char *v11; // rdi
void **v12; // rsi
_QWORD *v13; // rcx
void *v14; // rcx
void *Block[3]; // [rsp+28h] [rbp-40h] BYREF
unsigned __int64 v17; // [rsp+40h] [rbp-28h]
v4 = (_OWORD *)a1[1];
v5 = a3;
if ( v4 == (_OWORD *)a1[2] )
{
v5 = sub_18006C540(a1, a3, a4);
}
else if ( (_OWORD *)a3 == v4 )
{
sub_180016C80(a1[1], a4);
a1[1] += 32;
}
else
{
sub_180016C80((__int64)Block, a4);
v8 = v4 - 2;
*v4 = *(v4 - 2);
v4[1] = *(v4 - 1);
*((_QWORD *)v8 + 2) = 0;
*((_QWORD *)v8 + 3) = 15;
*(_BYTE *)v8 = 0;
a1[1] += 32;
if ( (_OWORD *)v5 != v4 - 2 )
{
v9 = (char *)v4 - 8;
do
{
v10 = v9;
v9 -= 32;
v11 = v9 - 24;
v12 = (void **)(v9 + 8);
if ( v9 + 8 != v9 - 24 )
{
if ( *v10 > 0xFu )
{
v13 = *v12;
if ( (unsigned __int64)(*v10 + 1LL) >= 0x1000 )
{
if ( (unsigned __int64)v13 - *(v13 - 1) - 8 > 0x1F )
goto LABEL_17;
v13 = (_QWORD *)*(v13 - 1);
}
j_j_free_0(v13);
}
*v10 = 15;
*(_OWORD *)v12 = *(_OWORD *)v11;
*(_OWORD *)(v9 + 24) = *((_OWORD *)v11 + 1);
*((_QWORD *)v9 - 1) = 0;
*(_QWORD *)v9 = 15;
*v11 = 0;
}
}
while ( (char *)v5 != v11 );
}
sub_1800656E0(v5, (__int64)Block);
if ( v17 > 0xF )
{
v14 = Block[0];
if ( v17 + 1 >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
LABEL_17:
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v14);
}
}
*a2 = v5;
return a2;
}