//
// d2i_RSA_PUBKEY from 0xa5f4b0 to 0xa5f528 (120 bytes)
//
// 6 xrefs:
// > ??> @ 0x7eabc
// > PEM_read_bio_RSA_PUBKEY @ 0xa355a8
// > PEM_read_RSA_PUBKEY @ 0xa355e4
// > d2i_RSA_PUBKEY_fp @ 0xa5d104
// > d2i_RSA_PUBKEY_bio @ 0xa5d1a8
// > ??> @ 0xd1d670
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:32 +0000
//
int __fastcall d2i_RSA_PUBKEY(int *a1, unsigned __int8 **a2, int a3)
{
_DWORD *v5; // r0
int v6; // r7
int v7; // r4
int result; // r0
unsigned __int8 *v9; // [sp+4h] [bp-8h] BYREF
v9 = *a2;
v5 = (_DWORD *)d2i_PUBKEY(nullptr, &v9, a3);
v6 = (int)v5;
if ( !v5 )
return 0;
v7 = EVP_PKEY_get1_RSA(v5);
EVP_PKEY_free(v6);
if ( !v7 )
return 0;
*a2 = v9;
if ( !a1 )
return v7;
RSA_free(*a1);
result = v7;
*a1 = v7;
return result;
}