def METHOD_NAME (left, right, one_method):
    if left + 1 >= right:
        gen_new (names [left])
    else:
        mid = (left + right) // 2
        print ("if (which < {0}) {{".format (mid))
        if one_method:
            METHOD_NAME (left, mid, one_method)
        else:
            print ("return {0} (which, refs, wrap);".format (search_method_name (left, mid)))
        print ("} else {")
        if one_method:
            METHOD_NAME (mid, right, one_method)
        else:
            print ("return {0} (which, refs, wrap);".format (search_method_name (mid, right)))
        print ("}")