//
// i2a_ASN1_STRING from 0x867048 to 0x86716c (292 bytes)
//
// 7 xrefs:
// > OCSP_REQUEST_print @ 0x81f120
// > OCSP_REQUEST_print @ 0x81f144
// > OCSP_RESPONSE_print @ 0x81f3e4
// > OCSP_RESPONSE_print @ 0x81f5f0
// > OCSP_RESPONSE_print @ 0x81f614
// > sub_8B9C78 @ 0x8b9cb4
// > ??> @ 0x64d0c
//
// 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 i2a_ASN1_STRING(int a1, int *a2)
{
int result; // r0
int v4; // r4
int i; // r5
int v7; // r3
int v8; // r1
int v9; // r0
_BYTE v10[44]; // [sp+4h] [bp-2Ch] BYREF
if ( !a2 )
return 0;
if ( *a2 )
{
if ( *a2 <= 0 )
return 0;
v4 = 0;
for ( i = 0; ; i = v8 )
{
v7 = a2[2];
v10[0] = a0123456789abcd_9[*(unsigned __int8 *)(v7 + v4) >> 4];
v10[1] = a0123456789abcd_9[*(_BYTE *)(v7 + v4++) & 0xF];
if ( BIO_write(a1, (int)v10, 2) != 2 )
break;
v8 = i + 2;
if ( *a2 <= v4 )
return i + 2;
if ( v4 )
{
if ( v4 == 35 * (v4 / 35) )
{
v9 = BIO_write(a1, (int)"\\\n", 2);
v8 = i + 4;
if ( v9 != 2 )
return -1;
}
}
}
return -1;
}
result = BIO_write(a1, (int)"0", 1);
if ( result != 1 )
return -1;
return result;
}