//
// ASN1_i2d_bio from 0x10876f4 to 0x10877f4 (256 bytes)
//
// 11 xrefs:
// > i2d_RSA_PUBKEY_bio @ 0x106e4d8
// > i2d_DSAPrivateKey_bio @ 0x106e568
// > i2d_DSA_PUBKEY_bio @ 0x106e598
// > i2d_EC_PUBKEY_bio @ 0x106e628
// > i2d_ECPrivateKey_bio @ 0x106e658
// > i2d_PKCS8_bio @ 0x106e798
// > i2d_PKCS8_PRIV_KEY_INFO_bio @ 0x106e8ac
// > i2d_PrivateKey_bio @ 0x106e914
// > i2d_PUBKEY_bio @ 0x106e944
// > ASN1_i2d_fp @ 0x1087840
// > ??> @ 0x47938
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:17:13 +0000
//
__int64 __fastcall ASN1_i2d_bio(__int64 (__fastcall *a1)(__int64, void **), __int64 a2, __int64 a3)
{
signed int v6; // w19
void *v7; // x21
__int64 v8; // x0
int v9; // w20
int v10; // w0
bool v11; // zf
unsigned int v12; // w19
void *v14; // [xsp+58h] [xbp+58h] BYREF
v6 = a1(a3, nullptr);
v7 = CRYPTO_malloc((void *)v6, (__int64)"crypto/asn1/a_i2d_fp.c", 41);
if ( v7 )
{
v8 = a3;
v9 = 0;
v14 = v7;
a1(v8, &v14);
do
{
v10 = BIO_write(a2, (__int64)v7 + v9, v6);
v11 = v10 == v6;
v9 += v10;
v6 -= v10;
if ( v11 )
{
v12 = 1;
goto LABEL_7;
}
}
while ( v10 > 0 );
v12 = 0;
LABEL_7:
CRYPTO_free(v7, (__int64)"crypto/asn1/a_i2d_fp.c", 61);
return v12;
}
else
{
ERR_put_error(13, 116, 65, (__int64)"crypto/asn1/a_i2d_fp.c", 43);
return 0;
}
}