def METHOD_NAME(u, v, p, q):
    with hcl.for_(1, Ny - 1, name="L1") as i:
        v[0][i] = hcl.scalar(1.0)
        p[i][0] = hcl.scalar(0.0)
        q[i][0] = v[0][i]
        with hcl.for_(1, Nx - 1, name="L2") as j:
            p[i][j] = -1.0 * c / (a * p[i][j - 1] + b)
            q[i][j] = (
                -1.0 * d * u[j][i - 1]
                + (1.0 + 2.0 * d) * u[j][i]
                - f * u[j][i + 1]
                - a * q[i][j - 1]
            ) / (a * p[i][j - 1] + b)
        v[Nx - 1][i] = hcl.scalar(1.0)
        with hcl.for_(Nx - 2, 0, -1, name="L3") as j:
            v[j][i] = p[i][j] * v[j + 1][i] + q[i][j]
    with hcl.for_(1, Nx - 1, name="L4") as i:
        u[i][0] = hcl.scalar(1.0)
        p[i][0] = hcl.scalar(0.0)
        q[i][0] = u[i][0]
        with hcl.for_(1, Ny - 1, name="L5") as j:
            p[i][j] = -1.0 * f / (d * p[i][j - 1] + e)
            q[i][j] = (
                -1.0 * a * v[i - 1][j]
                + (1.0 + 2 * a) * v[i][j]
                - c * v[i + 1][j]
                - d * q[i][j - 1]
            ) / (d * p[i][j - 1] + e)
        u[i][Ny - 1] = hcl.scalar(1.0)
        with hcl.for_(Ny - 2, 0, -1, name="L6") as j:
            u[i][j] = p[i][j] * u[i][j + 1] + q[i][j]