'Checks that a detected incongruency is not caused by translation backends having a different
idea of what constitutes a basic block.'

def _validate_incongruency(self):

    ot = self._throw
    try:
        self._throw = False
        l.debug('Validating    incongruency.')
        if (('UNICORN' in self.simgr.right[0].options) ^ ('UNICORN' in self.simgr.left[0].options)):
            if ('UNICORN' in self.simgr.right[0].options):
                unicorn_stash = 'right'
                normal_stash = 'left'
            else:
                unicorn_stash = 'left'
                normal_stash = 'right'
            unicorn_path = self.simgr.stashes[unicorn_stash][0]
            normal_path = self.simgr.stashes[normal_stash][0]
            if (unicorn_path.arch.name in ('X86', 'AMD64')):
                npg = self.project.factory.simgr(unicorn_path)
                npg.explore(find=(lambda p: (p.addr == normal_path.addr)), n=200)
                if (len(npg.found) == 0):
                    l.debug('Validator    failed    to    sync    paths.')
                    return True
                new_unicorn = npg.found[0]
                delta = (new_unicorn.history.block_count - normal_path.history.block_count)
                normal_path.extra_length += delta
                new_normal = normal_path
            elif (unicorn_path.arch.name == 'MIPS32'):
                npg = self.project.factory.simgr(normal_path)
                npg.explore(find=(lambda p: (p.addr == unicorn_path.addr)), n=200)
                if (len(npg.found) == 0):
                    l.debug('Validator    failed    to    sync    paths.')
                    return True
                new_normal = npg.found[0]
                delta = (new_normal.history.block_count - unicorn_path.history.block_count)
                unicorn_path.extra_length += delta
                new_unicorn = unicorn_path
            else:
                l.debug('Dunno!')
                return True
            if self.compare_paths(new_unicorn, new_normal):
                l.debug('Divergence    accounted    for    by    unicorn.')
                self.simgr.stashes[unicorn_stash][0] = new_unicorn
                self.simgr.stashes[normal_stash][0] = new_normal
                return False
            else:
                l.warning('Divergence    unaccounted    for    by    unicorn.')
                return True
        else:
            l.warning('Divergence    unaccounted    for.')
            return True
    finally:
        self._throw = ot
