//
// sub_10016456C from 0x10016456c to 0x100164648 (220 bytes)
//
// 1 xrefs:
// > DS_Dictionary::copyFile @ 0x1001613e8
//
// 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_10016456C(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4)
{
unsigned __int8 *v5; // x8
__int64 v6; // x1
_BYTE *v7; // x8
__int64 v8; // x8
__int64 v10; // [xsp+0h] [xbp-20h] BYREF
_QWORD *v11; // [xsp+8h] [xbp-18h] BYREF
v10 = a3;
v11 = a2;
if ( (sub_100164648(&v11, &v10) & 1) == 0 )
{
do
{
v5 = (unsigned __int8 *)v11[3];
if ( v5 == (unsigned __int8 *)v11[4] )
{
v6 = (*(unsigned __int8 (__fastcall **)(_QWORD *))(*v11 + 72LL))(v11);
if ( a4 )
{
LABEL_6:
v7 = (_BYTE *)a4[6];
if ( v7 == (_BYTE *)a4[7] )
{
if ( (*(unsigned int (__fastcall **)(_QWORD *, __int64))(*a4 + 104LL))(a4, v6) == -1 )
a4 = nullptr;
}
else
{
a4[6] = v7 + 1;
*v7 = v6;
}
}
}
else
{
v6 = *v5;
if ( a4 )
goto LABEL_6;
}
v8 = v11[3];
if ( v8 == v11[4] )
(*(void (__fastcall **)(_QWORD *, __int64))(*v11 + 80LL))(v11, v6);
else
v11[3] = v8 + 1;
}
while ( !(unsigned int)sub_100164648(&v11, &v10) );
}
return v11;
}