def METHOD_NAME(A, B, C, D):
    # Due to MLIR limitation, hcl.return_ must be the
    # last statement in the module (i.e. region terminator)
    # TODO(Niansong): add checker pass for this case
    # @hcl.def_([A.shape, B.shape, ()])
    # def find_max(A, B, x):
    #     with hcl.if_(A[x] > B[x]):
    #         hcl.return_(A[x])
    #     with hcl.else_():
    #         hcl.return_(B[x])
    @hcl.def_([A.shape, B.shape, ()])
    def find_max(A, B, x):
        ret = hcl.scalar(0, "ret")
        with hcl.if_(A[x] > B[x]):
            ret.v = A[x]
        with hcl.else_():
            ret.v = B[x]
        hcl.return_(ret.v)
    max_1 = hcl.compute(A.shape, lambda x: find_max(A, B, x), "max_1")
    max_2 = hcl.compute(A.shape, lambda x: find_max(C, D, x), "max_2")
    return hcl.compute(A.shape, lambda x: find_max(max_1, max_2, x), "max_o")