(* spawn handler *)
Notation tvoidptr := (Tpointer Tvoid noattr).Notation tvoidfun := (Tfunction (Tcons tvoidptr Tnil) tvoidptr AST.cc_default).Definition f_wrapper : Clight.function :=
  {| Clight.fn_return := Tvoid; Clight.fn_callconv := AST.cc_default;
     Clight.fn_params := [(1%positive, tvoidfun); (2%positive, tvoidptr)];
     Clight.fn_vars := []; Clight.fn_temps := [];
     Clight.fn_body := Clight.Scall None (Clight.Etempvar 1%positive tvoidfun) [Clight.Etempvar 2%positive tvoidptr] |}.Class spawn_wrapper := { lookup_wrapper: exists b_wrapper, Genv.find_funct_ptr (Clight.genv_genv ge) b_wrapper = Some (Ctypes.Internal f_wrapper)}.Class spawn_wrapper := { lookup_wrapper: exists b_wrapper, Genv.find_funct_ptr (Clight.genv_genv ge) b_wrapper = Some (Ctypes.Internal f_wrapper)}.

Lemma Clight_new_Clight_safety_gen: forall n sch tr tp m tp' (Hmem: mem_ok tp m), csafe (Sem := Clight_newSem ge) (machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig) (sch, tr, tp) m (n * 2) -> match_st tp tp' -> csafe (Sem := ClightSem ge) (ThreadPool:= OrdinalPool.OrdinalThreadPool(Sem:=ClightSem ge)) (machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig) (sch, tr, tp') m n.