def __print_contexts(self, context_init, x86_context, reil_context):
        out = "Contexts don't match!\n\n"

        header_fmt = " {0:^8s} : {1:^16s} | {2:>16s} ?= {3:<16s}\n"
        header = header_fmt.format("Register", "Initial", "x86", "REIL")
        ruler = "-" * len(header) + "\n"

        out += header
        out += ruler

        fmt = " {0:>8s} : {1:016x} | {2:016x} {eq} {3:016x} {marker}\n"

        mask = 2**64-1

        for reg in sorted(context_init.keys()):
            if (x86_context[reg] & mask) != (reil_context[reg] & mask):
                eq, marker = "!=", "<"
            else:
                eq, marker = "==", ""

            out += fmt.format(
                reg,
                context_init[reg] & mask,
                x86_context[reg] & mask,
                reil_context[reg] & mask,
                eq=eq,
                marker=marker
            )

        # Pretty print flags.
        reg = "rflags"
        fmt = "{0:s} ({1:>7s}) : {2:016x} ({3:s})"

        init_value = context_init[reg] & mask
        x86_value = x86_context[reg] & mask
        reil_value = reil_context[reg] & mask

        init_flags_str = self.__print_flags(context_init[reg])
        x86_flags_str = self.__print_flags(x86_context[reg])
        reil_flags_str = self.__print_flags(reil_context[reg])

        out += "\n"
        out += fmt.format(reg, "initial", init_value, init_flags_str) + "\n"
        out += fmt.format(reg, "x86", x86_value, x86_flags_str) + "\n"
        out += fmt.format(reg, "reil", reil_value, reil_flags_str)

        return out
dataset/ETHPy150Open programa-stic/barf-project/barf/tests/arch/x86/test_x86translator.py/X86TranslationTests.__print_contexts/original