//
// v2i_ASN1_BIT_STRING from 0xe6ff98 to 0xe70144 (428 bytes)
//
// 3 xrefs:
// > ??> @ 0xc4140
// > ??> @ 0x1227c00
// > ??> @ 0x1227c68
//
// 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
//
__int64 __fastcall v2i_ASN1_BIT_STRING(__int64 a1, __int64 a2, unsigned int *a3)
{
int v5; // w22
__int64 v6; // x25
__int64 v7; // x0
__int64 v8; // x19
_QWORD *v9; // x23
const char *v10; // x20
const char *v11; // x21
v5 = 0;
v6 = ASN1_BIT_STRING_new();
if ( v6 )
{
if ( (int)OPENSSL_sk_num(a3) <= 0 )
{
return v6;
}
else
{
while ( 1 )
{
v7 = OPENSSL_sk_value((__int64)a3, v5);
v8 = *(_QWORD *)(a1 + 96);
v9 = (_QWORD *)v7;
v10 = *(const char **)(v8 + 8);
if ( !v10 )
{
LABEL_12:
ERR_put_error(34, 101, 111, (__int64)"crypto/x509v3/v3_bitst.c", 86);
ERR_add_error_data(6, "section:", *v9, ",name:", v9[1], ",value:", v9[2]);
ASN1_BIT_STRING_free(v6);
return 0;
}
v11 = *(const char **)(v7 + 8);
while ( strcmp(*(const char **)(v8 + 16), v11) && strcmp(v10, v11) )
{
v8 += 24;
v10 = *(const char **)(v8 + 8);
if ( !v10 )
goto LABEL_12;
}
if ( !(unsigned int)ASN1_BIT_STRING_set_bit(v6, *(_DWORD *)v8, 1) )
break;
if ( !*(_QWORD *)(v8 + 8) )
goto LABEL_12;
if ( ++v5 >= (int)OPENSSL_sk_num(a3) )
return v6;
}
ERR_put_error(34, 101, 65, (__int64)"crypto/x509v3/v3_bitst.c", 77);
ASN1_BIT_STRING_free(v6);
return 0;
}
}
else
{
ERR_put_error(34, 101, 65, (__int64)"crypto/x509v3/v3_bitst.c", 67);
return 0;
}
}