//
// sub_F7F9A0 from 0xf7f9a0 to 0xf7fa4c (172 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:13:50 +0000
//
unsigned __int8 *__fastcall sub_F7F9A0(unsigned __int8 *a1, __int64 a2)
{
unsigned __int64 v3; // x8
unsigned __int8 *v4; // x20
unsigned __int64 v5; // x22
unsigned __int64 v6; // x21
unsigned __int64 v7; // x9
unsigned __int8 *v8; // x23
__int64 v9; // x24
__int64 v10; // x9
v3 = *a1;
if ( (v3 & 1) != 0 )
{
v5 = *((_QWORD *)a1 + 1);
v4 = *((unsigned __int8 **)a1 + 2);
}
else
{
v4 = a1 + 4;
v5 = v3 >> 1;
}
v6 = (a2 - (__int64)v4) >> 2;
v7 = v5 - v6;
if ( v5 < v6 )
std::__basic_string_common::__throw_out_of_range();
if ( (v3 & 1) != 0 )
v8 = *((unsigned __int8 **)a1 + 2);
else
v8 = a1 + 4;
v9 = v5 != v6;
if ( v7 != v9 )
{
wmemmove((wchar_t *)&v8[4 * v6], (const wchar_t *)&v8[4 * v6 + 4 * v9], v7 - v9);
LOBYTE(v3) = *a1;
}
v10 = v5 - v9;
if ( (v3 & 1) != 0 )
*((_QWORD *)a1 + 1) = v10;
else
*a1 = 2 * v10;
*(_DWORD *)&v8[4 * v10] = 0;
return &v4[4 * v6];
}