//
// X509_PURPOSE_get_by_id from 0xa6f28c to 0xa6f2e4 (88 bytes)
//
// 7 xrefs:
// > X509_STORE_CTX_purpose_inherit @ 0xa5a564
// > X509_STORE_CTX_purpose_inherit @ 0xa5a61c
// > X509_STORE_CTX_init @ 0xa5aba4
// > X509_PURPOSE_set @ 0xa6f2fc
// > X509_PURPOSE_add @ 0xa6f35c
// > X509_check_purpose @ 0xa6fddc
// > ??> @ 0x8121c
//
// 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:41 +0000
//
int __fastcall X509_PURPOSE_get_by_id(int a1)
{
int v1; // r0
int v3; // [sp+4h] [bp-24h] BYREF
if ( (unsigned int)(a1 - 1) <= 8 )
return a1 - 1;
v3 = a1;
if ( !dword_D35AE0 )
return -1;
v1 = OPENSSL_sk_find(dword_D35AE0, (int)&v3);
if ( v1 == -1 )
return -1;
else
return v1 + 9;
}