//
// dtls1_ctrl from 0xd5d3ac to 0xd5d458 (172 bytes)
//
// 11 xrefs:
// > ??> @ 0x93348
// > ??> @ 0x121fcb0
// > ??> @ 0x121fd90
// > ??> @ 0x121fe70
// > ??> @ 0x121ff50
// > ??> @ 0x1220030
// > ??> @ 0x1220110
// > ??> @ 0x12201f0
// > ??> @ 0x12202d0
// > ??> @ 0x12203b0
// > ??> @ 0x1220490
//
// 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 dtls1_ctrl(__int64 a1, int a2, signed __int64 a3, char *a4)
{
__int64 result; // x0
if ( a2 == 74 )
return (int)dtls1_handle_timeout(a1);
if ( a2 > 74 )
{
if ( a2 == 120 )
{
result = 0;
if ( a3 > 255 )
{
*(_DWORD *)(*(_QWORD *)(a1 + 152) + 288LL) = a3;
return 1;
}
}
else
{
result = 256;
if ( a2 != 121 )
return (int)ssl3_ctrl(a1, a2, a3, a4);
}
}
else
{
if ( a2 != 17 )
{
if ( a2 == 73 )
return dtls1_get_timeout(a1, a4) != nullptr;
return (int)ssl3_ctrl(a1, a2, a3, a4);
}
result = 0;
if ( a3 > 207 )
{
*(_DWORD *)(*(_QWORD *)(a1 + 152) + 292LL) = a3;
return a3;
}
}
return result;
}