//
// sub_100704A50 from 0x100704a50 to 0x100704ac0 (112 bytes)
//
// 2 xrefs:
// > sub_100645CE4 @ 0x1006460e8
// > sub_100667E38 @ 0x10066800c
//
// 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 11:12:50 +0000
//
__int64 __fastcall sub_100704A50(__int64 a1)
{
int v1; // w10
int v2; // w9
__int64 *v3; // x11
__int64 v4; // x8
bool v5; // vf
int v6; // w10
__int64 v7; // x11
if ( !a1 )
return 0;
v1 = *(_DWORD *)a1;
v2 = *(_DWORD *)a1 - 1;
if ( *(int *)a1 < 1 )
return 0;
v3 = *(__int64 **)(a1 + 8);
v4 = *v3;
v5 = __OFSUB__(v1, 2);
v6 = v1 - 2;
if ( v6 < 0 == v5 )
{
*v3 = v3[1];
if ( v6 )
{
v7 = 0;
do
{
*(_QWORD *)(*(_QWORD *)(a1 + 8) + 8 * v7 + 8) = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8 * v7 + 16);
++v7;
}
while ( v6 != (_DWORD)v7 );
}
}
*(_DWORD *)a1 = v2;
return v4;
}