REF_TYPE_LOCK_MASK
s = find_lock_state(env->cur_state, REF_TYPE_LOCK_MASK, id, ptr);
if (state->refs[i].type & REF_TYPE_LOCK_MASK) {