def get_bb_ops(bb, ops):
    """Helper function returning all instructions (sorted by address) from ops
    that are inside the basic block bb"""
    bb_ops = [ op for addr, op in ops.items() if addr >= bb['addr'] and addr < bb['addr'] + bb['size']]
    bb_ops = sorted(bb_ops, key=lambda op : op['offset'])
    return bb_ops