//
// asn1_enc_restore from 0xfee8d4 to 0xfee9a4 (208 bytes)
//
// 2 xrefs:
// > ASN1_item_ex_i2d @ 0xfec208
// > ??> @ 0xcae88
//
// 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:15:44 +0000
//
__int64 __fastcall asn1_enc_restore(_DWORD *a1, void **a2, __int64 *a3, __int64 a4)
{
__int64 v6; // x4
__int64 v7; // x1
__int64 v8; // x1
__int64 v9; // x20
if ( !a3 )
return (unsigned int)a3;
v6 = *a3;
if ( !*a3 )
return 0;
v7 = *(_QWORD *)(a4 + 32);
if ( v7 )
{
LODWORD(a3) = *(_DWORD *)(v7 + 8) & 2;
if ( (_DWORD)a3 )
{
v8 = *(int *)(v7 + 32);
LODWORD(a3) = 0;
v9 = v6 + v8;
if ( v6 + v8 )
{
if ( !*(_DWORD *)(v9 + 16) )
{
if ( a2 )
{
memcpy(*a2, *(const void **)(v6 + v8), *(_QWORD *)(v9 + 8));
*a2 = (char *)*a2 + *(_QWORD *)(v9 + 8);
}
LODWORD(a3) = 1;
if ( a1 )
*a1 = *(_QWORD *)(v9 + 8);
}
}
}
return (unsigned int)a3;
}
return 0;
}