def METHOD_NAME(self, num_to_name_map, export_map):
    new_end_funcs = []
    for e in self.end_funcs:
        func = ''
        for l in e.split('\n'):
            if re.search(CALL_INDIRECT_REGEX, l):
                pass
            elif re.search(CALL_REGEX, l):
                num = re.search(CALL_REGEX, l).group(2)
                if int(num) in num_to_name_map:
                    name = num_to_name_map[int(num)]
                    new_num = export_map[name]
                    new_call = re.sub(CALL_REGEX, lambda x: f'{x.group(1)}{new_num}{x.group(3)}', l)
                    func += new_call + '\n'
                elif num in self.function_symbol_map:
                    new_num = self.function_symbol_map[num]
                    new_call = re.sub(CALL_REGEX, lambda x: f'{x.group(1)}{new_num}{x.group(3)}', l)
                    func += new_call + '\n'
                elif num in self.imports_map:
                    # We're calling an import so we don't need to do anything
                    func += l
                else:
                    print('-----', e)
                    print('Error attempting to shift calls in compiled wasm')
                    raise Exception('Error attempting to shift calls in compiled wasm.')
            else:
                func += l + '\n'
        new_end_funcs.append(func)
    self.end_funcs = new_end_funcs