//
// ASN1_item_i2d_bio from 0x861510 to 0x8615d0 (192 bytes)
//
// 12 xrefs:
// > i2d_PKCS12_bio @ 0x8264e0
// > i2d_X509_bio @ 0x84837c
// > i2d_X509_CRL_bio @ 0x8483dc
// > i2d_PKCS7_bio @ 0x84843c
// > i2d_X509_REQ_bio @ 0x84849c
// > i2d_RSAPrivateKey_bio @ 0x848570
// > i2d_RSAPublicKey_bio @ 0x8485cc
// > ASN1_item_i2d_fp @ 0x861618
// > i2d_CMS_bio @ 0x87429c
// > OCSP_REQ_CTX_i2d @ 0x8b90f4
// > i2d_ASN1_bio_stream @ 0x8c60d0
// > ??> @ 0x659ac
//
// 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_item_i2d_bio(unsigned __int8 *a1, int a2, size_t *a3)
{
int v3; // r5
int v5; // r0
void *v6; // r6
int v7; // r4
int v8; // r0
int v9; // r6
void *v11; // [sp+Ch] [bp-8h] BYREF
v3 = 0;
v11 = nullptr;
v5 = ASN1_item_i2d(a3, (int *)&v11, a1);
v6 = v11;
v7 = v5;
if ( v11 )
{
while ( 1 )
{
v8 = BIO_write(a2, (int)v6 + v3, v7);
if ( v8 == v7 )
{
v9 = 1;
goto LABEL_7;
}
if ( v8 <= 0 )
break;
v6 = v11;
v3 += v8;
v7 -= v8;
}
v9 = 0;
LABEL_7:
CRYPTO_free(v11, (int)"crypto/asn1/a_i2d_fp.c", 106);
return v9;
}
else
{
ERR_put_error(13, 192, 65, (int)"crypto/asn1/a_i2d_fp.c", 91);
return 0;
}
}