//
// ASN1_PRINTABLE_type from 0x7bddd8 to 0x7bde7c (164 bytes)
//
// 3 xrefs:
// > ASN1_UNIVERSALSTRING_to_string @ 0x7bdf6c
// > X509_NAME_ENTRY_set_data @ 0x847b1c
// > ??> @ 0x5e26c
//
// 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
//
int __fastcall ASN1_PRINTABLE_type(_BYTE *a1, int a2)
{
int v2; // r12
_BYTE *v3; // r1
int v4; // r4
unsigned int v5; // r3
bool v6; // cc
if ( a2 <= 0 )
a2 = -1;
if ( !a1 )
return 19;
v2 = 0;
v3 = &a1[a2];
v4 = 0;
while ( 1 )
{
v5 = (unsigned __int8)*a1;
if ( !*a1 || a1 == v3 )
break;
++a1;
if ( (v5 & 0xFFFFFFDF) - 65 > 0x19 )
{
v6 = v5 > 0x20;
if ( v5 != 32 )
v6 = v5 - 39 > 2;
if ( v6 && v5 - 43 > 0xF && (v5 & 0xFD) != 0x3D )
v4 = 1;
}
if ( (v5 & 0x80) != 0 )
v2 = 1;
}
if ( v2 )
return 20;
if ( v4 )
return 22;
return 19;
}