def weld_sort(arrays, weld_types, readable_text, ascending=True):
    weld_obj_sort = _weld_sort(arrays, weld_types, ascending)
    weld_obj_struct = weld_vec_of_struct_to_struct_of_vec(weld_obj_sort, weld_types)
    weld_obj_indices = weld_select_from_struct(weld_obj_struct, 0)
    intermediate_result = LazyArrayResult(weld_obj_indices, WeldLong())
    dependency_name = Cache.cache_intermediate_result(intermediate_result, readable_text)
    fake_weld_input = Cache.create_fake_array_input(dependency_name, readable_text + '_indices')
    obj_id, weld_obj = create_weld_object(fake_weld_input)
    weld_obj.weld_code = '{}'.format(obj_id)
    Cache.cache_fake_input(obj_id, fake_weld_input)
    return weld_obj