//
// ssl_version_supported from 0xd4eecc to 0xd4f104 (568 bytes)
//
// 2 xrefs:
// > tls_construct_client_hello @ 0xd48d3c
// > ??> @ 0x93750
//
// 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
//
bool __fastcall ssl_version_supported(__int64 a1, int a2)
{
int v2; // w2
int *v3; // x19
int v4; // w2
__int64 i; // x1
__int64 (*v9)(void); // x0
__int64 v10; // x23
int v11; // w1
signed int v12; // w22
int v13; // w0
int v14; // w0
int v15; // t1
int v16; // w0
int v17; // w0
v2 = **(_DWORD **)(a1 + 8);
if ( v2 == 0x10000 )
{
v3 = &dword_12205D0;
}
else
{
if ( v2 != 0x1FFFF )
return *(_DWORD *)a1 == a2;
v3 = &dword_1220570;
}
v4 = *v3;
if ( !*v3 )
return 0;
for ( i = *(_QWORD *)(a1 + 8); ; i = *(_QWORD *)(a1 + 8) )
{
if ( a2 != v4 )
{
if ( (*(_DWORD *)(*(_QWORD *)(i + 192) + 104LL) & 8) != 0 )
{
if ( a2 == 256 )
{
if ( v4 == 256 )
return 0;
v16 = 65280;
}
else
{
v16 = a2;
if ( v4 == 256 )
v4 = 65280;
}
if ( v16 <= v4 )
return 0;
}
else if ( a2 >= v4 )
{
return 0;
}
goto LABEL_27;
}
v9 = *((__int64 (**)(void))v3 + 1);
if ( !v9 )
goto LABEL_27;
v10 = v9();
v11 = *(_DWORD *)(a1 + 492);
v12 = *(_DWORD *)v10;
if ( v11 && v12 != v11 )
{
if ( (*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 104LL) & 8) != 0 )
{
if ( v12 == 256 )
{
v17 = 65280;
if ( v11 == 256 )
goto LABEL_16;
}
else
{
v17 = *(_DWORD *)v10;
if ( v11 == 256 )
v11 = 65280;
}
if ( v11 < v17 )
goto LABEL_27;
}
else if ( v12 < v11 )
{
goto LABEL_27;
}
}
LABEL_16:
if ( !(unsigned int)ssl_security(a1, 9u, 0, v12, 0) )
goto LABEL_27;
v13 = *(_DWORD *)(a1 + 496);
if ( v13 && v12 != v13 )
{
if ( (*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 8) + 192LL) + 104LL) & 8) != 0 )
{
if ( v12 == 256 )
{
v12 = 65280;
if ( v13 == 256 )
goto LABEL_27;
}
else if ( v13 == 256 )
{
v13 = 65280;
}
if ( v12 <= v13 )
goto LABEL_27;
}
else if ( v12 >= v13 )
{
goto LABEL_27;
}
}
if ( (*(unsigned int *)(a1 + 484) & *(_QWORD *)(v10 + 8)) == 0 )
{
v14 = *(_DWORD *)(v10 + 4);
if ( (v14 & 2) == 0 || (*(_DWORD *)(*(_QWORD *)(a1 + 328) + 28LL) & 0x30000) == 0 )
{
if ( (v14 & 1) == 0 )
return 1;
if ( !(unsigned int)FIPS_mode() )
break;
}
}
LABEL_27:
v15 = v3[6];
v3 += 6;
v4 = v15;
if ( !v15 )
return 0;
}
return 1;
}