//
// sub_7AD920 from 0x7ad920 to 0x7ada14 (244 bytes)
//
// 3 xrefs:
// > tls1_set_curves_list @ 0x7ae824
// > tls1_set_curves_list @ 0x7ae83c
// > ??> @ 0x7ae874
//
// 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
//
const void *__fastcall sub_7AD920(const void *result, signed int a2, int *a3)
{
_BOOL4 v3; // r4
int v6; // lr
int v7; // r2
_DWORD *v8; // r1
int v9; // r3
int v10; // t1
int v11; // r3
char v12[44]; // [sp+4h] [bp-2Ch] BYREF
if ( result )
{
v3 = *a3 == 28;
if ( a2 > 19 )
v3 = 1;
if ( !v3 )
{
memcpy(v12, result, a2);
v12[a2] = 0;
v6 = EC_curve_nist2nid(v12);
if ( v6 || (v6 = OBJ_sn2nid(v12)) != 0 || (v6 = OBJ_ln2nid(v12)) != 0 )
{
v7 = *a3;
if ( !*a3 )
{
v11 = 1;
LABEL_13:
*a3 = v11;
a3[v7 + 1] = v6;
return &dword_0 + 1;
}
if ( v6 != a3[1] )
{
v8 = a3 + 1;
v9 = 0;
while ( ++v9 != v7 )
{
v10 = v8[1];
++v8;
if ( v6 == v10 )
return nullptr;
}
v11 = v7 + 1;
goto LABEL_13;
}
}
}
return nullptr;
}
return result;
}