let as_int_format fmt z =
let def = Tapp ("as_int",[Tapp(fmt,[]) ; Tconst(ConstInt z)]) in
let opt = Tconst (ConstInt z) in
let signed_in_bound b = signed_in_bound b z opt def in
let unsigned_in_bound b =unsigned_in_bound b z opt def in
match fmt with
| "uint8_format" ->
let b = Big_int.big_int_of_int 256 in unsigned_in_bound b
| "sint8_format" ->
let b = Big_int.big_int_of_int 128 in signed_in_bound b
| "uint16_format" ->
let b = Big_int.big_int_of_int 65536 in unsigned_in_bound b
| "sint16_format" ->
let b = Big_int.big_int_of_int 32768 in signed_in_bound b
| "uint32_format" ->
let b = Big_int.big_int_of_string ("4294967296") in
unsigned_in_bound b
| "sint32_format" ->
let b = Big_int.big_int_of_string ("2147483648") in
signed_in_bound b
| "uint64_format" ->
let b = Big_int.big_int_of_string ("18446744073709551616") in
unsigned_in_bound b
| "sint64_format" ->
let b = Big_int.big_int_of_string ("9223372036854775808") in
signed_in_bound b
|_ -> def