val synth_certificateStatusRequest_cases
      (x: LP.maybe_enum_key certificateStatusType_enum)
      (y: certificateStatusRequest_value_type x)
    : LP.refine_with_tag key_of_certificateStatusRequest x
val synth_certificateStatusRequest_cases
      (x: LP.maybe_enum_key certificateStatusType_enum)
      (y: certificateStatusRequest_value_type x)
    : LP.refine_with_tag key_of_certificateStatusRequest x
let synth_certificateStatusRequest_cases (x:LP.maybe_enum_key certificateStatusType_enum)
  (y:certificateStatusRequest_value_type x) : LP.refine_with_tag key_of_certificateStatusRequest x =
  match x with
  | LP.Unknown v ->
    [@inline_let] let x : certificateStatusRequest = Csr_Unknown_certificateStatusType (unknown_enum_repr_certificateStatusType_as_repr v) y in
    [@inline_let] let _ = assert_norm (key_of_certificateStatusRequest x == LP.Unknown v) in
    certificateStatusRequest_refine (LP.Unknown v) x
  | LP.Known k -> synth_known_certificateStatusRequest_cases k y
module MiTLS.Parsers.CertificateStatusRequest

(* 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"

friend MiTLS.Parsers.CertificateStatusType

// Need high Z3 limits for large sum types
#set-options "--z3rlimit 60"

inline_for_extraction unfold let known_certificateStatusType_as_enum_key
  (x: certificateStatusType { norm [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst certificateStatusType_enum)) == true })
  : LP.enum_key certificateStatusType_enum =
  [@inline_let] let _ = norm_spec [delta; zeta; iota; primops] (LP.list_mem x (LP.list_map fst certificateStatusType_enum)) in x

inline_for_extraction let unknown_certificateStatusType_as_enum_key (r:certificateStatusType_repr) : Pure (LP.unknown_enum_repr certificateStatusType_enum)
  (requires known_certificateStatusType_repr r == false) (ensures fun _ -> True) =
  [@inline_let] let _ = assert_norm(LP.list_mem r (LP.list_map snd certificateStatusType_enum) == known_certificateStatusType_repr r) in r

inline_for_extraction let unknown_enum_repr_certificateStatusType_as_repr (r:LP.unknown_enum_repr certificateStatusType_enum) : Pure certificateStatusType_repr
  (requires True) (ensures fun r -> known_certificateStatusType_repr r == false) =
  [@inline_let] let _ = assert_norm(LP.list_mem r (LP.list_map snd certificateStatusType_enum) == known_certificateStatusType_repr r) in r

inline_for_extraction let key_of_certificateStatusRequest (x:certificateStatusRequest) : LP.maybe_enum_key certificateStatusType_enum =
  match x with
  | Csr_ocsp _ -> LP.Known (known_certificateStatusType_as_enum_key Ocsp)
  | Csr_Unknown_certificateStatusType v _ -> LP.Unknown (unknown_certificateStatusType_as_enum_key v)

inline_for_extraction let certificateStatusRequest_case_of_certificateStatusType (x:certificateStatusType) : Type0 =
  match x with
  | Ocsp -> oCSPStatusRequest
  | Unknown_certificateStatusType _ -> squash False

unfold inline_for_extraction let certificateStatusRequest_value_type (x:LP.maybe_enum_key certificateStatusType_enum) =
  LP.dsum_type_of_tag' certificateStatusType_enum certificateStatusRequest_case_of_certificateStatusType (squash False) x

unfold inline_for_extraction let certificateStatusRequest_refine (k:LP.maybe_enum_key certificateStatusType_enum) (x:certificateStatusRequest)
  : Pure (LP.refine_with_tag key_of_certificateStatusRequest k)
  (requires key_of_certificateStatusRequest x == k) (ensures fun y -> y == x) =
  [@inline_let] let _ = norm_spec [delta; iota; zeta] (key_of_certificateStatusRequest x) in x

unfold inline_for_extraction let certificateStatusRequest_type_of_known_case (k: LP.enum_key certificateStatusType_enum)
  (x:certificateStatusType) (q: squash ((k <: certificateStatusType) == x))
  (#x' : LP.maybe_enum_key certificateStatusType_enum) (y: certificateStatusRequest_value_type x')
  : Pure (norm [delta_only [(`%certificateStatusRequest_case_of_certificateStatusType)]; iota] (certificateStatusRequest_case_of_certificateStatusType x))
  (requires (LP.Known k == x')) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%certificateStatusRequest_case_of_certificateStatusType)]; iota] (certificateStatusRequest_case_of_certificateStatusType k) in y

unfold inline_for_extraction let certificateStatusRequest_known_case (k: LP.enum_key certificateStatusType_enum)
  (x: certificateStatusType) (y: norm [delta_only [(`%certificateStatusRequest_case_of_certificateStatusType)]; iota] (certificateStatusRequest_case_of_certificateStatusType x))
  : Pure (certificateStatusRequest_case_of_certificateStatusType k) (requires (k == x)) (ensures (fun y' -> y' == y)) =
  [@inline_let] let _ = norm_spec [delta_only [(`%certificateStatusRequest_case_of_certificateStatusType)] ; iota] (certificateStatusRequest_case_of_certificateStatusType x) in y

inline_for_extraction let synth_known_certificateStatusRequest_cases (k:LP.enum_key certificateStatusType_enum)
  (y:certificateStatusRequest_value_type (LP.Known k)) : LP.refine_with_tag key_of_certificateStatusRequest (LP.Known k) =
  match k with
  | Ocsp ->
    [@inline_let] let x : certificateStatusRequest = Csr_ocsp (certificateStatusRequest_type_of_known_case k Ocsp () y) in
    [@inline_let] let _ = assert_norm (key_of_certificateStatusRequest x == LP.Known Ocsp) in
    certificateStatusRequest_refine (LP.Known Ocsp) x
/
prims.fst.checked MiTLS.Parsers.CertificateStatusType.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.Seq.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.CertificateStatusRequest.fst

    x:
      LowParse.Spec.Enum.maybe_enum_key MiTLS.Parsers.CertificateStatusType.certificateStatusType_enum
       ->
    y: MiTLS.Parsers.CertificateStatusRequest.certificateStatusRequest_value_type x
  -> LowParse.Spec.Base.refine_with_tag MiTLS.Parsers.CertificateStatusRequest.key_of_certificateStatusRequest
      x
LowParse.Spec.Enum.maybe_enum_key MiTLS.Parsers.CertificateStatusType.certificateStatusType FStar.UInt8.t MiTLS.Parsers.CertificateStatusType.certificateStatusType_enum MiTLS.Parsers.CertificateStatusRequest.certificateStatusRequest_value_type LowParse.Spec.Enum.unknown_enum_repr MiTLS.Parsers.CertificateStatusRequest.certificateStatusRequest_refine LowParse.Spec.Enum.Unknown Prims.unit FStar.Pervasives.assert_norm Prims.eq2 MiTLS.Parsers.CertificateStatusRequest.key_of_certificateStatusRequest MiTLS.Parsers.CertificateStatusRequest.certificateStatusRequest MiTLS.Parsers.CertificateStatusRequest.Csr_Unknown_certificateStatusType MiTLS.Parsers.CertificateStatusRequest.unknown_enum_repr_certificateStatusType_as_repr LowParse.Spec.Enum.enum_key MiTLS.Parsers.CertificateStatusRequest.synth_known_certificateStatusRequest_cases LowParse.Spec.Base.refine_with_tag
let synth_certificateStatusRequest_cases
      (x: LP.maybe_enum_key certificateStatusType_enum)
      (y: certificateStatusRequest_value_type x)
    : LP.refine_with_tag key_of_certificateStatusRequest x =
  
match x with
| LP.Unknown v ->
  [@@ inline_let ]let x:certificateStatusRequest =
    Csr_Unknown_certificateStatusType (unknown_enum_repr_certificateStatusType_as_repr v) y
  in
  [@@ inline_let ]let _ = assert_norm (key_of_certificateStatusRequest x == LP.Unknown v) in
  certificateStatusRequest_refine (LP.Unknown v) x
| LP.Known k -> synth_known_certificateStatusRequest_cases k y