let rewrite file =
if checking then check_types file;
Jessie_options.debug "Adding default behavior to all functions";
add_default_behavior file;
if checking then check_types file;
Jessie_options.debug "Rename entities";
rename_entities file;
if checking then check_types file;
Jessie_options.debug "Fill offset/size information in fields";
fill_offset_size_in_fields file;
if checking then check_types file;
Jessie_options.debug "Replace addrof array with startof";
replace_addrof_array file;
if checking then check_types file;
Jessie_options.debug "Replace string constants by global variables";
replace_string_constants file;
if checking then check_types file;
Jessie_options.debug "Put all global initializations in the [globinit] file";
gather_initialization file;
if checking then check_types file;
if Jessie_options.InferAnnot.get () <> "" then
begin
Jessie_options.debug "Rewrite comparison of pointers into difference of pointers";
rewrite_pointer_compare file;
if checking then check_types file
end;
Jessie_options.debug "Rewrite type void* and (un)signed char* into char*";
rewrite_void_pointer file;
if checking then check_types file;
if Jessie_options.InferAnnot.get () <> "" then
begin
Jessie_options.debug "Rewrite cursor pointers into offsets from base pointers";
rewrite_cursor_pointers file;
if checking then check_types file
end;
if Jessie_options.InferAnnot.get () <> "" then
begin
Jessie_options.debug "Rewrite cursor integers into offsets from base integers";
rewrite_cursor_integers file;
if checking then check_types file
end;
if Jessie_options.HintLevel.get () > 0 then
begin
Jessie_options.debug "Annotate code with strlen";
annotate_code_strlen file;
if checking then check_types file
end;
Jessie_options.debug "Annotate code with overflow checks";
annotate_overflow file;
if checking then check_types file;