//
// ASN1_ENUMERATED_to_BN from 0xe0b174 to 0xe0b234 (192 bytes)
//
// 2 xrefs:
// > i2s_ASN1_ENUMERATED @ 0xe03854
// > ??> @ 0x780f0
//
// 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
//
unsigned __int64 *__fastcall ASN1_ENUMERATED_to_BN(__int64 a1, __int64 a2)
{
unsigned __int64 *v3; // x0
int v4; // w1
unsigned __int64 *v5; // x19
if ( (*(_DWORD *)(a1 + 4) & 0xFFFFFEFF) == 0xA )
{
v3 = BN_bin2bn(*(_BYTE **)(a1 + 8), *(_DWORD *)a1, a2);
if ( !v3 )
{
v5 = nullptr;
ERR_put_error(13, 228, 105, (__int64)"crypto/asn1/a_int.c", 526);
return v5;
}
v4 = *(_DWORD *)(a1 + 4);
v5 = v3;
if ( (v4 & 0x100) == 0 )
return v5;
BN_set_negative((__int64)v3, 1);
return v5;
}
else
{
ERR_put_error(13, 228, 225, (__int64)"crypto/asn1/a_int.c", 520);
return nullptr;
}
}