//
// sub_1007220F4 from 0x1007220f4 to 0x100722168 (116 bytes)
//
// 2 xrefs:
// > sub_1007110C4 @ 0x10071119c
// > sub_1007111D4 @ 0x100711228
//
// 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:13:05 +0000
//
__int64 __fastcall sub_1007220F4(__int64 a1, void *__dst, int a3)
{
unsigned int *v3; // x9
const void *v4; // x8
__int64 v5; // x19
int v6; // w9
if ( *(_DWORD *)a1 == 4 && (v3 = *(unsigned int **)(a1 + 8)) != nullptr )
{
v4 = *((const void **)v3 + 1);
v5 = *v3;
if ( (int)v5 >= a3 )
v6 = a3;
else
v6 = *v3;
memcpy(__dst, v4, v6);
}
else
{
sub_100706FB0(13, 135, 109, (__int64)"evp_asn1.c", 85);
return 0xFFFFFFFFLL;
}
return v5;
}