//
// sub_855934 from 0x855934 to 0x855c4c (792 bytes)
//
// 2 xrefs:
// > ??> @ 0xab3e98
// > ??> @ 0xab3ed0
//
// 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 sub_855934(int a1, _DWORD *a2, int a3, int a4)
{
signed int i; // r11
signed int **v6; // r0
signed int *v7; // r6
signed int **v8; // r7
signed int v9; // r5
signed int *v10; // r5
int v11; // r6
_DWORD *v12; // r9
bool v13; // zf
signed int *v14; // r6
signed int j; // r5
_DWORD *v16; // r0
_DWORD *v18; // r6
_DWORD *v19; // r0
signed int v22[5]; // [sp+34h] [bp-18h] BYREF
for ( i = 0; i < OPENSSL_sk_num((int)a2); ++i )
{
BIO_puts(a3, (int)"\n");
v6 = (signed int **)OPENSSL_sk_value(a2, i);
v7 = *v6;
v8 = v6;
if ( *v6 )
{
v9 = *v7;
if ( *v7 )
{
v22[0] = v7[1];
BIO_printf(a3, "%*sRelative Name:\n%*s", a4, &byte_9B1912, a4 + 2, &byte_9B1912);
X509_NAME_print_ex(a3, (int)v22, 0, 8520479);
BIO_puts(a3, (int)"\n");
}
else
{
BIO_printf(a3, "%*sFull Name:\n", a4, &byte_9B1912);
v18 = (_DWORD *)v7[1];
while ( v9 < OPENSSL_sk_num((int)v18) )
{
BIO_printf(a3, "%*s", a4 + 2, &byte_9B1912);
v19 = (_DWORD *)OPENSSL_sk_value(v18, v9++);
GENERAL_NAME_print(a3, v19);
BIO_puts(a3, (int)"\n");
}
}
}
v10 = v8[1];
if ( v10 )
{
BIO_printf(a3, "%*s%s:\n%*s", a4, &byte_9B1912, "Reasons", a4 + 2, &byte_9B1912);
v11 = 1;
v12 = &unk_A3948C;
do
{
if ( ASN1_BIT_STRING_get_bit(v10, *(v12 - 3)) )
{
v13 = v11 == 0;
v11 = 0;
if ( v13 )
BIO_puts(a3, (int)", ");
BIO_puts(a3, *(v12 - 2));
}
v12 += 3;
}
while ( *(v12 - 2) );
if ( v11 )
BIO_puts(a3, (int)"\n");
else
BIO_puts(a3, (int)"\n");
}
if ( v8[2] )
{
BIO_printf(a3, "%*sCRL Issuer:\n", a4, &byte_9B1912);
v14 = v8[2];
for ( j = 0; j < OPENSSL_sk_num((int)v14); ++j )
{
BIO_printf(a3, "%*s", a4 + 2, &byte_9B1912);
v16 = (_DWORD *)OPENSSL_sk_value(v14, j);
GENERAL_NAME_print(a3, v16);
BIO_puts(a3, (int)"\n");
}
}
}
return 1;
}