def METHOD_NAME(instrs):
    """Make sure that every instr has an enum and that there are no clashes"""
    # There are 5 values populated by default into the enum so
    # we need to make sure that our first index is after those
    max_enum = 5
    enums = {}
    for i in (i for i in instrs if i.enum):
        if i.opcode in enums:
            assert enums[i.opcode] == i.enum, \
                "Multiple enums for the same opcode {}: {} {}".format(
                    i.opcode, i.enum, enums[i.opcode])
        else:
            enums[i.opcode] = i.enum
    reversed_enums = {}
    for opcode, enum in enums.items():
        reversed_enums.setdefault(enum, set()).add(opcode)
    for enum, opcodes in reversed_enums.items():
        assert len(opcodes) == 1, \
            "Multiple opcodes for the same enum {}: {}".format(
                enum, ','.join(opcodes))
    enums = {i.opcode: i.enum for i in instrs if i.enum}
    if enums:
        max_enum = max(int(i.enum) for i in instrs if i.enum)
    for i in (i for i in instrs if not i.enum):
        try:
            i.enum = enums[i.opcode]
        except KeyError:
            max_enum += 1
            i.enum = max_enum
            enums[i.opcode] = max_enum