Section MainTheorem.
(*Assumptions *)
Context (CPROOF : semax_to_juicy_machine.CSL_proof).
Context (program_proof : CSL_prog CPROOF = C_program).
Definition Main_ptr:=Values.Vptr (Ctypes.prog_main C_program) Integers.Ptrofs.zero.
Context (compilation : CC_correct.CompCert_compiler C_program = Some Asm_program).
Context (asm_genv_safe: Asm_core.safe_genv (@x86_context.X86Context.the_ge Asm_program)).
Instance SemTarget : Semantics:= @x86_context.X86Context.X86Sem Asm_program asm_genv_safe.
Existing Instance X86Inj.X86Inj.
Variable init_mem_wd:
forall m,
Genv.init_mem Asm_program = Some m ->
mem_obs_eq.MemoryWD.valid_mem m /\
mem_obs_eq.CoreInjections.ge_wd (Renamings.id_ren m) semantics.the_ge.
(* This should be instantiated: it says initial_Clight_state taken from CPROOF, is an initial state of CompCert. *)
Context (CPROOF_initial:
entry_point (Clight.globalenv C_program)
(erasure_safety.init_mem CPROOF)
(Clight_safety.initial_Clight_state CPROOF)
Main_ptr nil).

(* MOVE THIS TO ANOTHER FILE *)
Lemma CPROOF_initial_mem:  Genv.init_mem (Ctypes.program_of_program C_program) = Some (erasure_safety.init_mem CPROOF).