def METHOD_NAME(
        name,
        asn1_file,
        prefix):
    """Create a CC library of generated asn1 files.
    This library wraps up generated files from these 3 actions:
      1. generate .c/.h files by running asn1c with the given input: asn1_file
      2. remove all non .c/.h files
      3. apply string substitutions
    Args:
        name: the name of rule
        asn1_file: relative path to the .asn1 file that will be passed to asn1c
        prefix: value that is set to ASN1C_PREFIX
    """
    gen_name = name + "_genrule"
    flags = "-pdu=all -fcompound-names -fno-include-deps -gen-PER -no-gen-example"
    # Taken from https://github.com/magma/magma/blob/14c1cf643a61d576b3d24642e17ed3911d19210d/lte/gateway/c/core/oai/tasks/s1ap/CMakeLists.txt#L35
    # The original PR (PR2707) doesn't give an explanation on why this is necessary.
    # I'm guessing it is to avoid the following GCC error: To avoid the following GCC warning: integer constant is so large that it is unsigned
    substitutions = {
        "18446744073709551615": "18446744073709551615u",
    }
    gen_with_asn1c(
        name = gen_name,
        asn1_file = asn1_file,
        flags = flags,
        prefix = prefix,
        substitutions = substitutions,
    )
    cc_library(
        name = name,
        srcs = [gen_name],
        # This is needed so that the CCInfo (header/include info) can be used
        deps = [gen_name],
        # Dynamically linking this library is currently broken
        # linkstatic=True here forces only a .a file to be produced, forcing this library to be linked statically
        linkstatic = True,
    )