val write_alertLevel_key:LL.leaf_writer_strong serialize_alertLevel_key
let write_alertLevel_key : LL.leaf_writer_strong serialize_alertLevel_key =
  LL.write_enum_key alertLevel_repr_writer alertLevel_enum (_ by (LP.enum_repr_of_key_tac alertLevel_enum))
val write_alertLevel_key:LL.leaf_writer_strong serialize_alertLevel_key
let write_alertLevel_key:LL.leaf_writer_strong serialize_alertLevel_key =
LL.write_enum_key alertLevel_repr_writer
  alertLevel_enum
  (FStar.Tactics.Effect.synth_by_tactic (fun _ -> (LP.enum_repr_of_key_tac alertLevel_enum)))
Parsers.AlertLevel.fst.checked
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
Parsers.AlertLevel.fst
LowParse.Low.Enum.write_enum_key Parsers.AlertLevel.alertLevel FStar.UInt8.t LowParse.Spec.Int.parse_u8_kind LowParse.Spec.Int.parse_u8 LowParse.Spec.Int.serialize_u8 Parsers.AlertLevel.alertLevel_repr_writer Parsers.AlertLevel.alertLevel_enum LowParse.Spec.Enum.enum_repr_of_key_cons' LowParse.Spec.Enum.enum_repr_of_key_cons_nil' LowParse.Spec.Enum.enum_tail'
module Parsers.AlertLevel

(* 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 alertLevel_enum : LP.enum alertLevel U8.t =
  [@inline_let] let e = [
    Warning, 1z;
    Fatal, 2z;
  ] 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 alertLevel_repr_parser = LPI.parse_u8

noextract let alertLevel_repr_serializer = LPI.serialize_u8

inline_for_extraction noextract let alertLevel_repr_parser32 = LS.parse32_u8

inline_for_extraction noextract let alertLevel_repr_serializer32 = LS.serialize32_u8

inline_for_extraction noextract let alertLevel_repr_size32 = LSZ.size32_u8

inline_for_extraction noextract let alertLevel_repr_validator = (LL.validate_u8 ())

inline_for_extraction noextract let alertLevel_repr_jumper = LL.jump_u8

inline_for_extraction noextract let alertLevel_repr_reader = LL.read_u8

inline_for_extraction noextract let alertLevel_repr_writer = LL.write_u8

inline_for_extraction let synth_alertLevel (x: LP.enum_key alertLevel_enum) : Tot alertLevel = x

inline_for_extraction let synth_alertLevel_inv (x: alertLevel) : Tot (LP.enum_key alertLevel_enum) =
  [@inline_let] let _ : squash (LP.list_mem x (LP.list_map fst alertLevel_enum)) =
    _ by (LP.synth_maybe_enum_key_inv_unknown_tac x)
  in
  x

let lemma_synth_alertLevel_inj () : Lemma
  (LP.synth_injective synth_alertLevel) = ()

let lemma_synth_alertLevel_inv () : Lemma
  (LP.synth_inverse synth_alertLevel synth_alertLevel_inv) = ()

noextract let parse_alertLevel_key : LP.parser _ (LP.enum_key alertLevel_enum) =
  LP.parse_enum_key alertLevel_repr_parser alertLevel_enum

noextract let serialize_alertLevel_key : LP.serializer parse_alertLevel_key =
  LP.serialize_enum_key alertLevel_repr_parser alertLevel_repr_serializer alertLevel_enum

noextract let alertLevel_parser : LP.parser _ alertLevel =
  lemma_synth_alertLevel_inj ();
  parse_alertLevel_key `LP.parse_synth` synth_alertLevel

noextract let alertLevel_serializer : LP.serializer alertLevel_parser =
  lemma_synth_alertLevel_inj ();
  lemma_synth_alertLevel_inv ();
  LP.serialize_synth _ synth_alertLevel serialize_alertLevel_key synth_alertLevel_inv ()

let alertLevel_bytesize (x:alertLevel) : GTot nat = Seq.length (alertLevel_serializer x)

let alertLevel_bytesize_eq x = ()

let parse32_alertLevel_key : LS.parser32 parse_alertLevel_key =
  FStar.Tactics.synth_by_tactic (LS.parse32_enum_key_tac alertLevel_repr_parser32 alertLevel_enum)

let alertLevel_parser32 : LS.parser32 alertLevel_parser =
  lemma_synth_alertLevel_inj ();
  LS.parse32_synth _ synth_alertLevel (fun x->synth_alertLevel x) parse32_alertLevel_key ()

let serialize32_alertLevel_key : LS.serializer32 serialize_alertLevel_key =
  FStar.Tactics.synth_by_tactic (LS.serialize32_enum_key_gen_tac
    alertLevel_repr_serializer32 alertLevel_enum)

let alertLevel_serializer32 : LS.serializer32 alertLevel_serializer =
  lemma_synth_alertLevel_inj ();
  lemma_synth_alertLevel_inv ();
  LS.serialize32_synth _ synth_alertLevel _ serialize32_alertLevel_key synth_alertLevel_inv (fun x->synth_alertLevel_inv x) ()

let alertLevel_size32 =
  [@inline_let] let _ = assert_norm (LSZ.size32_constant_precond alertLevel_serializer 1ul) in
  LSZ.size32_constant alertLevel_serializer 1ul ()

[@@ (LT.postprocess_with LT.pp_norm_tac)]
inline_for_extraction let validate_alertLevel_key : LL.validator parse_alertLevel_key =
    LL.mk_validate_enum_key alertLevel_repr_validator alertLevel_repr_reader alertLevel_enum

let alertLevel_validator =
  lemma_synth_alertLevel_inj ();
  LL.validate_synth validate_alertLevel_key synth_alertLevel ()

[@@ (LT.postprocess_with LT.pp_norm_tac) ]
inline_for_extraction let read_alertLevel_key : LL.leaf_reader parse_alertLevel_key =
  LL.mk_read_enum_key alertLevel_repr_reader alertLevel_enum

let alertLevel_reader =
 [@inline_let] let _ = lemma_synth_alertLevel_inj () in
 LL.read_synth' parse_alertLevel_key synth_alertLevel read_alertLevel_key ()
val write_alertLevel_key:LL.leaf_writer_strong serialize_alertLevel_key
LowParse.Low.Base.leaf_writer_strong Parsers.AlertLevel.serialize_alertLevel_key