val gaccessor_timestamp_epoch : LL.gaccessor timestamp_parser LPI.parse_u32 clens_timestamp_epoch
val gaccessor_timestamp_epoch : LL.gaccessor timestamp_parser LPI.parse_u32 clens_timestamp_epoch
let gaccessor_timestamp_epoch = LL.gaccessor_ext (gaccessor_timestamp_timestamp' `LL.gaccessor_compose` gaccessor'_timestamp_epoch) clens_timestamp_epoch ()
module Zeta.Formats.Aux.Timestamp

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

type timestamp' = (U32.t & U32.t)

inline_for_extraction let synth_timestamp (x: timestamp') : timestamp =
  match x with (epoch,counter) -> {
    epoch = epoch;
    counter = counter;
  }

inline_for_extraction let synth_timestamp_recip (x: timestamp) : timestamp' = (x.epoch,x.counter)

let synth_timestamp_recip_inverse () : Lemma (LP.synth_inverse synth_timestamp_recip synth_timestamp) = ()

let synth_timestamp_injective () : Lemma (LP.synth_injective synth_timestamp) =
  LP.synth_inverse_synth_injective synth_timestamp_recip synth_timestamp;
  synth_timestamp_recip_inverse ()

let synth_timestamp_inverse () : Lemma (LP.synth_inverse synth_timestamp synth_timestamp_recip) =
  assert_norm (LP.synth_inverse synth_timestamp synth_timestamp_recip)

let synth_timestamp_recip_injective () : Lemma (LP.synth_injective synth_timestamp_recip) =
  synth_timestamp_recip_inverse ();
  LP.synth_inverse_synth_injective synth_timestamp synth_timestamp_recip

noextract let timestamp'_parser : LP.parser _ timestamp' = (LPI.parse_u32 `LP.nondep_then` LPI.parse_u32)

noextract let timestamp'_parser_kind = LP.get_parser_kind timestamp'_parser

let timestamp_parser =
  synth_timestamp_injective ();
  assert_norm (timestamp_parser_kind == timestamp'_parser_kind);
  timestamp'_parser `LP.parse_synth` synth_timestamp

noextract let timestamp'_serializer : LP.serializer timestamp'_parser = (LPI.serialize_u32 `LP.serialize_nondep_then` LPI.serialize_u32)

let timestamp_serializer =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LP.serialize_synth _ synth_timestamp timestamp'_serializer synth_timestamp_recip ()

let timestamp_bytesize (x:timestamp) : GTot nat = Seq.length (timestamp_serializer x)

let timestamp_bytesize_eq x = ()

inline_for_extraction let timestamp'_size32 : LSZ.size32 timestamp'_serializer = (LSZ.size32_u32 `LSZ.size32_nondep_then` LSZ.size32_u32)

let timestamp_size32 =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LSZ.size32_synth _ synth_timestamp _ timestamp'_size32 synth_timestamp_recip (fun x -> synth_timestamp_recip x) ()

inline_for_extraction let timestamp'_reader : LL.leaf_reader timestamp'_parser = (LL.read_nondep_then LL.jump_u32 LL.read_u32 LL.read_u32)

let timestamp_reader =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LL.read_synth _ synth_timestamp (fun x -> synth_timestamp x) timestamp'_reader ()

inline_for_extraction let timestamp'_lserializer : LL.serializer32 timestamp'_serializer = (LL.serialize32_u32 `LL.serialize32_nondep_then` LL.serialize32_u32)

let timestamp_lserializer =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LL.serialize32_synth timestamp'_lserializer synth_timestamp synth_timestamp_recip (fun x -> synth_timestamp_recip x) ()

let timestamp_bytesize_eqn x =
  [@inline_let] let _ = synth_timestamp_injective () in
  [@inline_let] let _ = synth_timestamp_inverse () in
  [@inline_let] let _ = assert_norm (timestamp_parser_kind == timestamp'_parser_kind) in
  LP.serialize_synth_eq _ synth_timestamp timestamp'_serializer synth_timestamp_recip () x;
LP.length_serialize_nondep_then LPI.serialize_u32 LPI.serialize_u32 x.epoch x.counter;
  (assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.epoch)) == 4));
  (assert (FStar.Seq.length (LP.serialize LP.serialize_u32 (x.counter)) == 4));
  assert(timestamp_bytesize x == Seq.length (LP.serialize LPI.serialize_u32 x.epoch) + Seq.length (LP.serialize LPI.serialize_u32 x.counter))

let gaccessor'_timestamp_epoch : LL.gaccessor timestamp'_parser LPI.parse_u32 _ = (LL.gaccessor_then_fst (LL.gaccessor_id timestamp'_parser))

let gaccessor'_timestamp_counter : LL.gaccessor timestamp'_parser LPI.parse_u32 _ = (LL.gaccessor_then_snd (LL.gaccessor_id timestamp'_parser))

inline_for_extraction noextract let accessor'_timestamp_epoch : LL.accessor gaccessor'_timestamp_epoch = (LL.accessor_then_fst (LL.accessor_id timestamp'_parser))

inline_for_extraction noextract let accessor'_timestamp_counter : LL.accessor gaccessor'_timestamp_counter = (LL.accessor_then_snd (LL.accessor_id timestamp'_parser) LL.jump_u32)

noextract let clens_timestamp_timestamp' : LL.clens timestamp timestamp' = synth_timestamp_recip_inverse (); synth_timestamp_recip_injective (); LL.clens_synth synth_timestamp_recip synth_timestamp

let gaccessor_timestamp_timestamp' : LL.gaccessor timestamp_parser timestamp'_parser clens_timestamp_timestamp' = synth_timestamp_inverse (); synth_timestamp_injective (); synth_timestamp_recip_inverse (); LL.gaccessor_synth timestamp'_parser synth_timestamp synth_timestamp_recip ()

inline_for_extraction noextract let accessor_timestamp_timestamp' : LL.accessor gaccessor_timestamp_timestamp' = synth_timestamp_inverse (); synth_timestamp_injective (); synth_timestamp_recip_inverse (); LL.accessor_synth timestamp'_parser synth_timestamp synth_timestamp_recip ()
/
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.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
Zeta.Formats.Aux.Timestamp.fst
LowParse.Low.Base.Spec.gaccessor Zeta.Formats.Aux.Timestamp.timestamp_parser
  LowParse.Spec.Int.parse_u32
  Zeta.Formats.Aux.Timestamp.clens_timestamp_epoch
LowParse.Low.Base.Spec.gaccessor_ext Zeta.Formats.Aux.Timestamp.timestamp_parser_kind Zeta.Formats.Aux.Timestamp.timestamp Zeta.Formats.Aux.Timestamp.timestamp_parser LowParse.Spec.Int.parse_u32_kind FStar.UInt32.t LowParse.Spec.Int.parse_u32 LowParse.Low.Base.Spec.clens_compose Zeta.Formats.Aux.Timestamp.timestamp' Zeta.Formats.Aux.Timestamp.clens_timestamp_timestamp' FStar.Pervasives.Native.tuple2 LowParse.Low.Base.Spec.clens_id LowParse.Low.Combinators.clens_fst LowParse.Low.Base.Spec.gaccessor_compose LowParse.Spec.Combinators.and_then_kind Zeta.Formats.Aux.Timestamp.timestamp'_parser Zeta.Formats.Aux.Timestamp.gaccessor_timestamp_timestamp' Zeta.Formats.Aux.Timestamp.gaccessor'_timestamp_epoch Zeta.Formats.Aux.Timestamp.clens_timestamp_epoch
let gaccessor_timestamp_epoch =
  
LL.gaccessor_ext (gaccessor_timestamp_timestamp' `LL.gaccessor_compose` gaccessor'_timestamp_epoch)
  clens_timestamp_epoch
  ()