//
// sub_84DA88 from 0x84da88 to 0x84db60 (216 bytes)
//
// 2 xrefs:
// > X509v3_addr_add_range @ 0x84e6cc
// > X509v3_addr_canonize @ 0x84f378
//
// 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_84DA88(_DWORD *a1, int a2, int a3)
{
int v3; // r5
_DWORD *v6; // r0
int v7; // r5
_DWORD *v8; // r7
int v9; // r0
int v10; // r1
int v11; // r4
int v13; // r0
v3 = a3 + 7;
if ( a3 + 7 < 0 )
v3 = a3 + 14;
v6 = IPAddressOrRange_new();
v7 = v3 >> 3;
v8 = v6;
if ( !v6 )
return 0;
v9 = v6[1];
*v8 = 0;
if ( !v9 && (v13 = ASN1_BIT_STRING_new(), (v8[1] = v13) == 0) || !ASN1_BIT_STRING_set() )
{
IPAddressOrRange_free(v8);
return 0;
}
v10 = v8[1];
v11 = a3 % 8;
*(_DWORD *)(v10 + 12) = *(_DWORD *)(v10 + 12) & 0xFFFFFFF0 | 8;
if ( v11 > 0 )
{
*(_BYTE *)(*(_DWORD *)(v10 + 8) + v7 - 1) &= ~(255 >> v11);
*(_DWORD *)(v8[1] + 12) |= 8 - v11;
}
*a1 = v8;
return 1;
}