?? RIGHT := 110 ??
MODULE ocm$process_section_maps;
*copyc osd$default_pragmats
?? PUSH (LISTEXT := ON) ??
*copyc llt$section_address
*copyc llt$information_element
*copyc oct$single_module_predictor_hdr
*copyc oct$section_directory
*copyc oct$offset_change_list
*copyc ocp$new_offset
*copyc ocp$new_global_offset
?? POP ??

*copyc och$process_section_maps

  PROCEDURE [XDCL] ocp$process_section_maps (section_directory: ^oct$section_directory;
        mod_dictionary_ocv: ^oct$offset_change_list;
        section_maps: ^llt$section_maps;
        number_of_section_maps: llt$number_of_sections;
        intermediate_ol: ^SEQ ( * );
        p_module_predictor: ^SEQ ( * ));

    VAR
      new_map: record
        case boolean of
        = TRUE =
          pointer: ^llt$section_map_items,
        = FALSE =
          pva: ^cell,
        casend,
      recend,

      component_index_cv: ^array [1 .. * ] of 0 .. llc$max_components,
      j: llt$number_of_sections,
      module_predictor: ^SEQ ( * ),
      module_predictor_header: ^oct$single_module_predictor_hdr,
      new_offset: llt$section_address_range,
      section_ordinal: llt$number_of_sections;

    module_predictor := p_module_predictor;

    RESET module_predictor;
    NEXT module_predictor_header IN module_predictor;
    IF module_predictor_header^.length_component_index_cv > 0 THEN
      component_index_cv := #PTR (module_predictor_header^.component_index_cv, module_predictor^);
    ELSE
      component_index_cv := NIL;
    IFEND;
    FOR section_ordinal := 0 TO (number_of_section_maps - 1) DO
      new_map.pointer := #PTR (section_maps^ [section_ordinal].map, intermediate_ol^);
      FOR j := 1 TO section_maps^ [section_ordinal].number_of_items DO
        new_map.pointer^ [j].offset := ocp$new_offset (new_map.pointer^ [j].offset, section_directory^
              [section_ordinal].section_offset_change_vector);
        new_map.pointer^ [j].component := component_index_cv^ [new_map.pointer^ [j].component];
      FOREND;
      new_offset := ocp$new_global_offset (#offset (new_map.pointer), mod_dictionary_ocv);
      new_map.pva := #address (#ring (intermediate_ol), #segment (intermediate_ol), new_offset);
      section_maps^ [section_ordinal].map := #REL (new_map.pointer, intermediate_ol^);
    FOREND;
  PROCEND ocp$process_section_maps;
MODEND ocm$process_section_maps;
