def METHOD_NAME(psy):
    '''PSyclone transformation script for the Dynamo0.3 API to optimise
    the matvec kernel for many-core CPUs. For the moment simply find
    the first matvec kernel in the example, transform the matmul
    intrinsic to equivalant inline code and then print out its PSyIR
    representation and output it as Fortran using the PSyIR Fortran
    back-end.
    '''
    matmul2code_trans = Matmul2CodeTrans()
    fortran_writer = FortranWriter()
    for invoke in psy.invokes.invoke_list:
        schedule = invoke.schedule
        for kernel in schedule.coded_kernels():
            if kernel.name.lower() == "matrix_vector_kernel_code":
                kernel_schedule = kernel.get_kernel_schedule()
                # Replace matmul with inline code
                for bin_op in kernel_schedule.walk(BinaryOperation):
                    if bin_op.operator is BinaryOperation.Operator.MATMUL:
                        matmul2code_trans.apply(bin_op)
                # Future optimisations will go here.
                print(kernel_schedule.view())
                result = fortran_writer(kernel_schedule)
                print(result)
                # Abort after the first matrix vector kernel for the
                # time being.
                print("Aborting to view the modifications to the matrix "
                      "vector kernel")
                sys.exit()
    return psy