Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs. mk_varspecs prog. Defined.
Definition putchars_spec := DECLARE _putchars putchars_spec.
Definition getchars_spec := DECLARE _getchars getchars_spec.
Program Fixpoint chars_of_Z (n : Z) { measure (Z.to_nat n) } : list byte :=
let n' := n / 10 in
match n' <=? 0 with true => [Byte.repr (n + char0)] | false => chars_of_Z n' ++ [Byte.repr (n mod 10 + char0)] end.
Next Obligation.
(*Opaque bind.  Opaque Nat.div Nat.modulo.*)
Definition ext_link := ext_link_prog prog.
Instance Espec : OracleKind := IO_Espec ext_link.

Lemma prog_correct:
semax_prog prog main_itree Vprog Gprog.