//
// sub_10016479C from 0x10016479c to 0x1001648a8 (268 bytes)
//
// 2 xrefs:
// > cocos2d::ZipUtils::urlDecode @ 0x10023e470
// > cocos2d::ZipUtils::urlDecode @ 0x10023e4ac
//
// 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
//
_QWORD *__fastcall sub_10016479C(_QWORD *a1, int a2, int a3)
{
char *v6; // x22
__int64 v7; // x23
int v8; // w25
int v9; // w24
const std::locale::facet *v10; // x0
int v11; // w2
_BYTE v13[16]; // [xsp+8h] [xbp-58h] BYREF
std::locale v14; // [xsp+18h] [xbp-48h] BYREF
std::ostream::sentry::sentry(v13, a1);
if ( v13[0] == 1 )
{
v6 = (char *)a1 + *(_QWORD *)(*a1 - 24LL);
v7 = *((_QWORD *)v6 + 5);
v8 = *((_DWORD *)v6 + 2);
v9 = *((_DWORD *)v6 + 36);
if ( v9 == -1 )
{
std::ios_base::getloc((const std::ios_base *)((char *)a1 + *(_QWORD *)(*a1 - 24LL)));
v10 = std::locale::use_facet(&v14, &std::ctype::id);
v9 = ((__int64 (__fastcall *)(const std::locale::facet *, __int64))v10->__vftable[2].~facet_0)(v10, 32);
std::locale::~locale(&v14);
*((_DWORD *)v6 + 36) = v9;
}
if ( (v8 & 0xB0) == 0x20 )
v11 = a2 + a3;
else
v11 = a2;
if ( !sub_100164904(v7, a2, v11, a2 + a3, (int)v6, (char)v9) )
std::ios_base::clear(
(std::ios_base *)((char *)a1 + *(_QWORD *)(*a1 - 24LL)),
*(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24LL) + 32) | 5);
}
std::ostream::sentry::~sentry(v13);
return a1;
}