//
// sub_84DFDC from 0x84dfdc to 0x84e388 (940 bytes)
//
// 1 xrefs:
// > ??> @ 0xa392b4
//
// 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_84DFDC(int a1, _DWORD *a2, int a3, int a4)
{
signed int v7; // r11
int v8; // r5
_DWORD *afi; // r0
int v10; // r4
unsigned int v11; // r2
int v12; // r3
_DWORD *v13; // r7
signed int v14; // r5
int v15; // r8
_DWORD *v16; // r6
int v18; // [sp+34h] [bp-8h]
v7 = 0;
while ( v7 < OPENSSL_sk_num((int)a2) )
{
v8 = OPENSSL_sk_value(a2, v7);
afi = X509v3_addr_get_afi((_DWORD *)v8);
v10 = (int)afi;
if ( afi == (int *)((char *)&dword_0 + 1) )
{
BIO_printf(a3, "%*sIPv4", a4, &byte_9B1912);
}
else if ( afi == (int *)((char *)&dword_0 + 2) )
{
BIO_printf(a3, "%*sIPv6", a4, &byte_9B1912);
}
else
{
BIO_printf(a3, "%*sUnknown AFI %u", a4, &byte_9B1912, afi);
}
if ( **(int **)v8 <= 2 )
goto LABEL_13;
v11 = *(unsigned __int8 *)(*(_DWORD *)(*(_DWORD *)v8 + 8) + 2);
if ( v11 == 4 )
{
BIO_puts(a3, (int)" (MPLS)");
}
else if ( v11 <= 4 )
{
if ( v11 == 2 )
{
BIO_puts(a3, (int)" (Multicast)");
goto LABEL_13;
}
if ( v11 > 2 )
{
BIO_puts(a3, (int)" (Unicast/Multicast)");
goto LABEL_13;
}
if ( v11 != 1 )
goto LABEL_41;
BIO_puts(a3, (int)" (Unicast)");
}
else if ( v11 == 65 )
{
BIO_puts(a3, (int)" (VPLS)");
}
else if ( v11 <= 0x41 )
{
if ( v11 != 64 )
goto LABEL_41;
BIO_puts(a3, (int)" (Tunnel)");
}
else
{
if ( v11 == 66 )
{
BIO_puts(a3, (int)" (BGP MDT)");
goto LABEL_13;
}
if ( v11 != 128 )
{
LABEL_41:
BIO_printf(a3, " (Unknown SAFI %u)", v11);
goto LABEL_13;
}
BIO_puts(a3, (int)" (MPLS-labeled VPN)");
}
LABEL_13:
v12 = **(_DWORD **)(v8 + 4);
if ( v12 )
{
if ( v12 == 1 )
{
BIO_puts(a3, (int)":\n");
v13 = *(_DWORD **)(*(_DWORD *)(v8 + 4) + 4);
v18 = a4;
v14 = 0;
v15 = a4 + 2;
while ( 1 )
{
while ( 1 )
{
if ( v14 >= OPENSSL_sk_num((int)v13) )
{
a4 = v18;
goto LABEL_23;
}
v16 = (_DWORD *)OPENSSL_sk_value(v13, v14);
BIO_printf(a3, "%*s", v15, &byte_9B1912);
if ( *v16 )
break;
if ( !sub_84D13C(a3, v10, 0, v16[1]) )
return 0;
BIO_printf(a3, "/%d\n", 8 * *(_DWORD *)v16[1] - (*(_DWORD *)(v16[1] + 12) & 7));
++v14;
}
if ( *v16 == 1 )
{
if ( !sub_84D13C(a3, v10, 0, *(_DWORD *)v16[1]) )
return 0;
BIO_puts(a3, (int)"-");
if ( !sub_84D13C(a3, v10, 255, *(_DWORD *)(v16[1] + 4)) )
return 0;
BIO_puts(a3, (int)"\n");
}
++v14;
}
}
LABEL_23:
++v7;
}
else
{
BIO_puts(a3, (int)": inherit\n");
++v7;
}
}
return 1;
}