val synth_protocolVersion (x: LP.maybe_enum_key protocolVersion_enum) : protocolVersion
val synth_protocolVersion (x: LP.maybe_enum_key protocolVersion_enum) : protocolVersion
let synth_protocolVersion (x:LP.maybe_enum_key protocolVersion_enum) : protocolVersion = 
  match x with
  | LP.Known k -> k
  | LP.Unknown y ->
    [@inline_let] let v : U16.t = y in
    [@inline_let] let _ = assert_norm (LP.list_mem v (LP.list_map snd protocolVersion_enum) == known_protocolVersion_repr v) in
    Unknown_protocolVersion v
module MiTLS.Parsers.ProtocolVersion

(* This file has been automatically generated by EverParse. *)
open FStar.Bytes
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module LP = LowParse.Spec
module LT = LowParse.TacLib
module LS = LowParse.SLow
module LSZ = LowParse.SLow
module LPI = LowParse.Spec.AllIntegers
module LL = LowParse.Low
module L = FStar.List.Tot
module B = LowStar.Buffer
module BY = FStar.Bytes
module HS = FStar.HyperStack
module HST = FStar.HyperStack.ST

#reset-options "--using_facts_from '* -FStar.Tactics -FStar.Reflection' --z3rlimit 16 --z3cliopt smt.arith.nl=false --max_fuel 2 --max_ifuel 2"

[@LT.Norm] inline_for_extraction let protocolVersion_enum : LP.enum protocolVersion U16.t =
  [@inline_let] let e = [
    SSL_3p0, 768us;
    TLS_1p0, 769us;
    TLS_1p1, 770us;
    TLS_1p2, 771us;
    TLS_1p3, 772us;
  ] in
  [@inline_let] let _ =
    assert_norm (L.noRepeats (LP.list_map fst e))
  in
  [@inline_let] let _ = 
    assert_norm (L.noRepeats (LP.list_map snd e))
  in e

noextract let protocolVersion_repr_parser = LPI.parse_u16

noextract let protocolVersion_repr_serializer = LPI.serialize_u16

inline_for_extraction noextract let protocolVersion_repr_parser32 = LS.parse32_u16

inline_for_extraction noextract let protocolVersion_repr_serializer32 = LS.serialize32_u16

inline_for_extraction noextract let protocolVersion_repr_size32 = LSZ.size32_u16

inline_for_extraction noextract let protocolVersion_repr_validator = (LL.validate_u16 ())

inline_for_extraction noextract let protocolVersion_repr_jumper = LL.jump_u16

inline_for_extraction noextract let protocolVersion_repr_reader = LL.read_u16

inline_for_extraction noextract let protocolVersion_repr_writer = LL.write_u16
/
prims.fst.checked LowStar.Buffer.fst.checked LowParse.TacLib.fst.checked LowParse.Spec.AllIntegers.fst.checked LowParse.Spec.fst.checked LowParse.SLow.fst.checked LowParse.Low.fst.checked FStar.UInt8.fsti.checked FStar.UInt64.fsti.checked FStar.UInt32.fsti.checked FStar.UInt16.fsti.checked FStar.Tactics.Effect.fsti.checked FStar.Tactics.fst.checked FStar.Seq.fst.checked FStar.Pervasives.Native.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.fst.checked FStar.HyperStack.ST.fsti.checked FStar.HyperStack.fst.checked FStar.Bytes.fsti.checked
MiTLS.Parsers.ProtocolVersion.fst
x: LowParse.Spec.Enum.maybe_enum_key MiTLS.Parsers.ProtocolVersion.protocolVersion_enum
  -> MiTLS.Parsers.ProtocolVersion.protocolVersion
LowParse.Spec.Enum.maybe_enum_key MiTLS.Parsers.ProtocolVersion.protocolVersion FStar.UInt16.t MiTLS.Parsers.ProtocolVersion.protocolVersion_enum LowParse.Spec.Enum.enum_key LowParse.Spec.Enum.unknown_enum_repr MiTLS.Parsers.ProtocolVersion.Unknown_protocolVersion Prims.unit FStar.Pervasives.assert_norm Prims.eq2 Prims.bool LowParse.Spec.Enum.list_mem LowParse.Spec.Enum.list_map FStar.Pervasives.Native.tuple2 FStar.Pervasives.Native.snd MiTLS.Parsers.ProtocolVersion.known_protocolVersion_repr
let synth_protocolVersion (x: LP.maybe_enum_key protocolVersion_enum) : protocolVersion =
  
match x with
| LP.Known k -> k
| LP.Unknown y ->
  [@@ inline_let ]let v:U16.t = y in
  [@@ inline_let ]let _ =
    assert_norm (LP.list_mem v (LP.list_map snd protocolVersion_enum) ==
        known_protocolVersion_repr v)
  in
  Unknown_protocolVersion v