open Fstarcompiler
open Prims
type ('a, 'uuuuu, 'uuuuu1) trivial_preorder = unit
type 'a buffer = ('a, unit, unit) LowStar_Monotonic_Buffer.mbuffer
let null (uu___ : unit) : 'a buffer= LowStar_Monotonic_Buffer.mnull ()
type 'a pointer = 'a buffer
type 'a pointer_or_null = 'a buffer
let sub (uu___ : unit) :
  ('a, ('a, unit, unit) trivial_preorder, ('a, unit, unit) trivial_preorder)
    LowStar_Monotonic_Buffer.mbuffer ->
    FStar_UInt32.t ->
      unit ->
        ('a, ('a, unit, unit) trivial_preorder,
          ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.msub
let offset (uu___ : unit) :
  ('a, ('a, unit, unit) trivial_preorder, ('a, unit, unit) trivial_preorder)
    LowStar_Monotonic_Buffer.mbuffer ->
    FStar_UInt32.t ->
      ('a, ('a, unit, unit) trivial_preorder,
        ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.moffset
type ('a, 'len) lbuffer = ('a, unit, unit) LowStar_Monotonic_Buffer.mbuffer
let gcmalloc (uu___ : unit) :
  unit ->
    'a ->
      FStar_UInt32.t ->
        ('a, ('a, unit, unit) trivial_preorder,
          ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.mgcmalloc
let malloc (uu___ : unit) :
  unit ->
    'a ->
      FStar_UInt32.t ->
        ('a, ('a, unit, unit) trivial_preorder,
          ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.mmalloc
let alloca (uu___ : unit) :
  'a ->
    FStar_UInt32.t ->
      ('a, ('a, unit, unit) trivial_preorder,
        ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.malloca
let alloca_of_list (uu___ : unit) :
  'a Prims.list ->
    ('a, ('a, unit, unit) trivial_preorder,
      ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.malloca_of_list
let gcmalloc_of_list (uu___ : unit) :
  unit ->
    'a Prims.list ->
      ('a, ('a, unit, unit) trivial_preorder,
        ('a, unit, unit) trivial_preorder) LowStar_Monotonic_Buffer.mbuffer=
  LowStar_Monotonic_Buffer.mgcmalloc_of_list
type ('a, 'l) assign_list_t = 'a buffer -> unit
let rec assign_list : 'a . 'a Prims.list -> 'a buffer -> unit =
  fun l b ->
    match l with
    | [] -> let h = FStar_HyperStack_ST.get () in ()
    | hd::tl ->
        let b_hd = LowStar_Monotonic_Buffer.msub b Stdint.Uint32.zero () in
        let b_tl = LowStar_Monotonic_Buffer.moffset b Stdint.Uint32.one in
        let h = FStar_HyperStack_ST.get () in
        ((let h1 = FStar_HyperStack_ST.get () in
          LowStar_Monotonic_Buffer.upd' b_hd Stdint.Uint32.zero hd);
         (let h0 = FStar_HyperStack_ST.get () in
          assign_list tl b_tl; (let h1 = FStar_HyperStack_ST.get () in ())))
