sig
  type pos = int
  type pos_ref = Common.pos Pervasives.ref
  type buf =
      (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
  val create_buf : int -> Common.buf
  val assert_pos : Common.pos -> unit
  val check_pos : Common.buf -> Common.pos -> unit
  val check_next : Common.buf -> Common.pos -> unit
  val safe_get_pos : Common.buf -> Common.pos_ref -> Common.pos
  val blit_string_buf :
    ?src_pos:int -> string -> ?dst_pos:int -> Common.buf -> len:int -> unit
  val blit_buf_string :
    ?src_pos:int -> Common.buf -> ?dst_pos:int -> string -> len:int -> unit
  val blit_buf :
    ?src_pos:int ->
    src:Common.buf -> ?dst_pos:int -> dst:Common.buf -> int -> unit
  exception Buffer_short
  exception No_variant_match
  module ReadError :
    sig
      type t =
          Neg_int8
        | Int_code
        | Int_overflow
        | Nat0_code
        | Nat0_overflow
        | Int32_code
        | Int64_code
        | Nativeint_code
        | Unit_code
        | Bool_code
        | Option_code
        | String_too_long
        | Variant_tag
        | Array_too_long
        | Hashtbl_too_long
        | Sum_tag of string
        | Variant of string
        | Poly_rec_bound of string
        | Variant_wrong_type of string
        | Silly_type of string
        | Empty_type of string
      val to_string : Common.ReadError.t -> string
    end
  exception Read_error of Common.ReadError.t * Common.pos
  exception Poly_rec_write of string
  exception Empty_type of string
  val raise_read_error : Common.ReadError.t -> Common.pos -> 'a
  val raise_variant_wrong_type : string -> Common.pos -> 'a
  val raise_concurrent_modification : string -> 'a
  val array_bound_error : unit -> 'a
  type vec32 =
      (float, Bigarray.float32_elt, Bigarray.fortran_layout)
      Bigarray.Array1.t
  type vec64 =
      (float, Bigarray.float64_elt, Bigarray.fortran_layout)
      Bigarray.Array1.t
  type vec = Common.vec64
  type mat32 =
      (float, Bigarray.float32_elt, Bigarray.fortran_layout)
      Bigarray.Array2.t
  type mat64 =
      (float, Bigarray.float64_elt, Bigarray.fortran_layout)
      Bigarray.Array2.t
  type mat = Common.mat64
  val copy_htbl_list :
    ('a, 'b) Hashtbl.t -> ('a * 'b) list -> ('a, 'b) Hashtbl.t
  external variant_of_int : int -> [>  ] = "%identity"
  external unsafe_blit_buf :
    src_pos:int ->
    src:Common.buf -> dst_pos:int -> dst:Common.buf -> len:int -> unit
    = "bin_prot_blit_buf_stub"
  external unsafe_blit_string_buf :
    src_pos:int -> string -> dst_pos:int -> Common.buf -> len:int -> unit
    = "bin_prot_blit_string_buf_stub" "noalloc"
  external unsafe_blit_buf_string :
    src_pos:int -> Common.buf -> dst_pos:int -> string -> len:int -> unit
    = "bin_prot_blit_buf_string_stub" "noalloc"
  external unsafe_blit_float_array_buf :
    src_pos:int ->
    float array -> dst_pos:int -> Common.buf -> len:int -> unit
    = "bin_prot_blit_float_array_buf_stub" "noalloc"
  external unsafe_blit_buf_float_array :
    src_pos:int ->
    Common.buf -> dst_pos:int -> float array -> len:int -> unit
    = "bin_prot_blit_buf_float_array_stub" "noalloc"
end