def create_xref(self):
        debug("Creating XREF/DREF")

        instances_class_name = self.classes.keys()

        last_vm = self.vms[-1]
        for current_class in last_vm.get_classes():
            for current_method in current_class.get_methods():
                debug("Creating XREF for %s" % current_method)

                code = current_method.get_code()
                if code == None:
                    continue

                off = 0
                bc = code.get_bc()
                try:
                    for instruction in bc.get_instructions():
                        op_value = instruction.get_op_value()
                        if op_value in [0x1c, 0x22]:
                            idx_type = instruction.get_ref_kind()
                            type_info = last_vm.get_cm_type(idx_type)

                            # Internal xref related to class manipulation
                            if type_info in instances_class_name and type_info != current_class.get_name(
                            ):
                                # new instance
                                if op_value == 0x22:
                                    self.classes[current_class.get_name(
                                    )].AddXrefTo(REF_NEW_INSTANCE,
                                                 self.classes[type_info],
                                                 current_method, off)
                                    self.classes[type_info].AddXrefFrom(
                                        REF_NEW_INSTANCE,
                                        self.classes[current_class.get_name()],
                                        current_method, off)
                                # class reference
                                else:
                                    self.classes[current_class.get_name(
                                    )].AddXrefTo(REF_CLASS_USAGE,
                                                 self.classes[type_info],
                                                 current_method, off)
                                    self.classes[type_info].AddXrefFrom(
                                        REF_CLASS_USAGE,
                                        self.classes[current_class.get_name()],
                                        current_method, off)

                        elif ((op_value >= 0x6e and op_value <= 0x72) or
                              (op_value >= 0x74 and 0x78 <= op_value)):
                            idx_meth = instruction.get_ref_kind()
                            method_info = last_vm.get_cm_method(idx_meth)
                            if method_info:
                                class_info = method_info[0]

                                method_item = last_vm.get_method_descriptor(
                                    method_info[0], method_info[1],
                                    ''.join(method_info[2]))
                                if method_item:
                                    self.classes[current_class.get_name(
                                    )].AddMXrefTo(current_method,
                                                  self.classes[class_info],
                                                  method_item,
                                                  off)
                                    self.classes[class_info].AddMXrefFrom(
                                        method_item,
                                        self.classes[current_class.get_name()],
                                        current_method,
                                        off)

                                    # Internal xref related to class manipulation
                                    if class_info in instances_class_name and class_info != current_class.get_name(
                                    ):
                                        self.classes[current_class.get_name(
                                        )].AddXrefTo(REF_CLASS_USAGE,
                                                     self.classes[class_info],
                                                     method_item, off)
                                        self.classes[class_info].AddXrefFrom(
                                            REF_CLASS_USAGE,
                                            self.classes[current_class.get_name()],
                                            current_method, off)

                        elif op_value >= 0x1a and op_value <= 0x1b:
                            string_value = last_vm.get_cm_string(
                                instruction.get_ref_kind())
                            if string_value not in self.strings:
                                self.strings[string_value] = StringAnalysis(
                                    string_value)
                            self.strings[string_value].AddXrefFrom(
                                self.classes[current_class.get_name()],
                                current_method)

                        elif op_value >= 0x52 and op_value <= 0x6d:
                            idx_field = instruction.get_ref_kind()
                            field_info = last_vm.get_cm_field(idx_field)
                            field_item = last_vm.get_field_descriptor(
                                field_info[0], field_info[2], field_info[1])
                            if field_item:
                                # read access to a field
                                if (op_value >= 0x52 and op_value <= 0x58) or (
                                        op_value >= 0x60 and op_value <= 0x66):
                                    self.classes[current_class.get_name(
                                    )].AddFXrefRead(
                                        current_method,
                                        self.classes[current_class.get_name()],
                                        field_item)
                                # write access to a field
                                else:
                                    self.classes[current_class.get_name(
                                    )].AddFXrefWrite(
                                        current_method,
                                        self.classes[current_class.get_name()],
                                        field_item)

                        off += instruction.get_length()
                except dvm.InvalidInstruction as e:
                    warning("Invalid instruction %s" % str(e))
dataset/ETHPy150Open androguard/androguard/androguard/core/analysis/analysis.py/newVMAnalysis.create_xref/swapped operands of `<=`