'Search for the last branching exit, just like
#   if (t12) { PUT(184) = 0xBADF00D:I64; exit-Boring }
and then taint the temp variable inside if predicate'

@staticmethod
def _last_branching_statement(statements):

    cmp_stmt_id = None
    cmp_tmp_id = None
    all_statements = len(statements)
    statements = reversed(statements)
    for (stmt_rev_idx, stmt) in enumerate(statements):
        stmt_idx = ((all_statements - stmt_rev_idx) - 1)
        actions = stmt.actions
        has_code_action = False
        for a in actions:
            if isinstance(a, SimActionExit):
                has_code_action = True
                break
        if has_code_action:
            readtmp_action = next(ifilter((lambda r: ((r.type == 'tmp') and (r.action == 'read'))), actions), None)
            if (readtmp_action is not None):
                cmp_tmp_id = readtmp_action.tmp
                cmp_stmt_id = stmt_idx
                break
            else:
                raise AngrBackwardSlicingError('ReadTempAction    is    not    found.    Please    report    to    Fish.')
    return (cmp_stmt_id, cmp_tmp_id)
