//
// sub_1005FBF8C from 0x1005fbf8c to 0x1005fc000 (116 bytes)
//
// 2 xrefs:
// > sub_1005EAF5C @ 0x1005eb034
// > sub_1005EB06C @ 0x1005eb0c0
//
// 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
//
__int64 __fastcall sub_1005FBF8C(__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_1005E0E48(13, 135, 109, (__int64)"evp_asn1.c", 85);
return 0xFFFFFFFFLL;
}
return v5;
}