//
// i2a_ASN1_INTEGER from 0xe0ebf8 to 0xe0edcc (468 bytes)
//
// 8 xrefs:
// > OCSP_REQUEST_print @ 0xdc4d04
// > OCSP_RESPONSE_print @ 0xdc50e0
// > sub_DD23EC @ 0xdd2604
// > sub_DD23EC @ 0xdd2654
// > sub_DFF938 @ 0xdff980
// > i2a_ASN1_ENUMERATED @ 0xe0f0f0
// > sub_E63F08 @ 0xe63fc4
// > ??> @ 0xb5e00
//
// 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 i2a_ASN1_INTEGER(__int64 a1, __int64 a2)
{
unsigned int v4; // w19
unsigned int v5; // w21
bool v6; // cc
__int64 v7; // x20
int v8; // w19
__int64 v9; // x4
char v10; // w3
int v11; // w2
unsigned int v12; // w5
int v13; // w0
_BYTE v16[8]; // [xsp+68h] [xbp+68h] BYREF
if ( !a2 )
return 0;
v4 = 2;
v5 = *(_DWORD *)(a2 + 4) & 0x100;
if ( v5 )
{
v5 = 1;
v4 = 3;
if ( (unsigned int)BIO_write(a1, (__int64)&byte_F10E40, 1u) != 1 )
return (unsigned int)-1;
v6 = *(_DWORD *)a2 <= 0;
if ( *(_DWORD *)a2 )
{
LABEL_4:
if ( v6 )
return v5;
v7 = 0;
v8 = 0;
while ( 1 )
{
v9 = *(_QWORD *)(a2 + 8);
++v8;
v16[0] = a0123456789abcd[*(_BYTE *)(v9 + v7) >> 4];
v10 = *(_BYTE *)(v9 + v7++);
v16[1] = a0123456789abcd[v10 & 0xF];
v11 = BIO_write(a1, (__int64)v16, 2u);
v12 = v5 + 2;
if ( v11 != 2 )
break;
if ( *(_DWORD *)a2 <= v8 )
return v12;
if ( v8 )
{
if ( v8 == 35 * (v8 / 35) )
{
v13 = BIO_write(a1, (__int64)"\\\n", 2u);
v12 = v5 + 4;
if ( v13 != 2 )
break;
}
}
v5 = v12;
}
return (unsigned int)-1;
}
}
else
{
v6 = *(_DWORD *)a2 <= 0;
if ( *(_DWORD *)a2 )
goto LABEL_4;
}
if ( (unsigned int)BIO_write(a1, (__int64)"00", 2u) != 2 )
return (unsigned int)-1;
return v4;
}