//
// sub_D3BD08 from 0xd3bd08 to 0xd3beac (420 bytes)
//
// 2 xrefs:
// > sub_D3C0FC @ 0xd3c6c8
// > ssl_create_cipher_list @ 0xd3d548
//
// 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 sub_D3BD08(__int64 *a1, __int64 *a2)
{
__int64 v2; // x2
int v5; // w19
__int64 v6; // x0
__int64 v7; // x20
__int64 i; // x2
__int64 v9; // x3
int *v10; // x7
__int64 v11; // x2
__int64 v12; // x4
__int64 v13; // x5
__int64 v14; // x8
__int64 v15; // x6
__int64 v16; // x3
__int64 v18; // x4
__int64 v19; // x9
v2 = *a1;
if ( *a1 )
{
v5 = 0;
do
{
if ( *(_DWORD *)(v2 + 8) && v5 < *(_DWORD *)(*(_QWORD *)v2 + 60LL) )
v5 = *(_DWORD *)(*(_QWORD *)v2 + 60LL);
v2 = *(_QWORD *)(v2 + 16);
}
while ( v2 );
v6 = 4LL * (v5 + 1);
}
else
{
v6 = 4;
v5 = 0;
}
v7 = CRYPTO_zalloc(v6, "ssl/ssl_ciph.c", 954);
if ( v7 )
{
for ( i = *a1; i; i = *(_QWORD *)(i + 16) )
{
if ( *(_DWORD *)(i + 8) )
{
v9 = 4LL * *(int *)(*(_QWORD *)i + 60LL);
++*(_DWORD *)(v7 + v9);
}
}
v10 = (int *)(v7 + 4LL * v5);
do
{
if ( *v10 > 0 )
{
v11 = *a1;
v12 = 0;
v13 = *a2;
v14 = *a1;
v15 = *a2;
if ( *a1 )
{
do
{
if ( v13 == v12 )
break;
v16 = *(_QWORD *)(v11 + 16);
if ( v5 == *(_DWORD *)(*(_QWORD *)v11 + 60LL) && v11 != v15 && *(_DWORD *)(v11 + 8) )
{
v18 = *(_QWORD *)(v11 + 24);
if ( v11 == v14 )
v14 = *(_QWORD *)(v11 + 16);
if ( v18 )
*(_QWORD *)(v18 + 16) = v16;
v19 = *(_QWORD *)(v11 + 16);
if ( v19 )
*(_QWORD *)(v19 + 24) = v18;
*(_QWORD *)(v15 + 16) = v11;
*(_QWORD *)(v11 + 24) = v15;
v15 = v11;
*(_QWORD *)(v11 + 16) = 0;
}
v12 = v11;
v11 = v16;
}
while ( v16 );
}
*a1 = v14;
*a2 = v15;
}
--v5;
--v10;
}
while ( v5 != -1 );
CRYPTO_free(v7, "ssl/ssl_ciph.c", 978);
return 1;
}
else
{
ERR_put_error(20, 231, 65, "ssl/ssl_ciph.c", 956);
return 0;
}
}