//
// sub_100710208 from 0x100710208 to 0x1007103d4 (460 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009e9890
//
// 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:56 +0000
//
__int64 __fastcall sub_100710208(__int64 a1, char *__dst, int a3)
{
int v3; // w22
char *v4; // x23
int *v6; // x19
__int64 v7; // x9
int v8; // w8
__int64 v9; // x21
int v10; // w8
int v11; // w9
int v12; // w8
int v13; // w27
int v14; // w28
v3 = a3;
v4 = __dst;
if ( !__dst )
return 0;
v6 = *(int **)(a1 + 48);
if ( !v6 )
return 0;
if ( !*(_QWORD *)(a1 + 56) )
return 0;
if ( *v6 < 1 )
{
v9 = 0;
}
else
{
v7 = v6[1];
v8 = *v6 - v7;
if ( v8 <= a3 )
v9 = (unsigned int)v8;
else
v9 = (unsigned int)a3;
memcpy(__dst, (char *)v6 + v7 + 192, (int)v9);
v4 += (int)v9;
v3 -= v9;
v10 = *v6;
v11 = v6[1] + v9;
v6[1] = v11;
if ( v10 == v11 )
*(_QWORD *)v6 = 0;
}
if ( v3 >= 1 )
{
LABEL_15:
v12 = v6[2];
while ( v12 >= 1 )
{
v13 = sub_100700794(*(_QWORD *)(a1 + 56), (__int64)(v6 + 64), 4096);
if ( v13 < 1 )
{
if ( (unsigned int)sub_100700778(*(_QWORD *)(a1 + 56), 8u) )
{
if ( (_DWORD)v9 )
v9 = (unsigned int)v9;
else
v9 = (unsigned int)v13;
break;
}
v6[2] = v13;
v6[4] = sub_10070A024((__int64)(v6 + 6));
v6[1] = 0;
LABEL_22:
if ( *v6 <= v3 )
v14 = *v6;
else
v14 = v3;
if ( v14 >= 1 )
{
memcpy(v4, v6 + 48, v14);
v9 = (unsigned int)(v14 + v9);
v6[1] = v14;
v3 -= v14;
v4 += v14;
if ( v3 > 0 )
goto LABEL_15;
}
break;
}
sub_100709C88((__int64)(v6 + 6), (_DWORD)v6 + 192, (int)v6, v6 + 64);
v12 = 1;
v6[2] = 1;
if ( *v6 )
goto LABEL_22;
}
}
sub_100700768(a1, 15);
sub_100701210(a1);
if ( !(_DWORD)v9 )
return (unsigned int)v6[2];
return v9;
}