pub fn select_res_output_syscall(ctx: &Context, rng: &mut RngType) -> Option<SyscallId> {
    let selected_res_kind = if ctx.res().is_empty() || rng.gen_ratio(1, 5) {
        ctx.target().res_kinds().choose(rng).unwrap()
    } else {
        let res_base = ctx.res().choose(rng).unwrap();
        if rng.gen() {
            ctx.target().res_sub_tys(res_base).choose(rng).unwrap()
        } else {
            ctx.target().res_super_tys(res_base).choose(rng).unwrap()
        }
    };
    ctx.target()
        .res_output_syscall(selected_res_kind)
        .choose(rng)
        .copied()
}
/// Select syscall that can output resources.
Select syscall that can output resources.
Select syscall that can output resources .
pub fn select_res_output_syscall(ctx: &Context, rng: &mut RngType) -> Option<SyscallId> {
    let selected_res_kind = if ctx.res().is_empty() || rng.gen_ratio(1, 5) {
        ctx.target().res_kinds().choose(rng).unwrap()
    } else {
        let res_base = ctx.res().choose(rng).unwrap();
        if rng.gen() {
            ctx.target().res_sub_tys(res_base).choose(rng).unwrap()
        } else {
            ctx.target().res_super_tys(res_base).choose(rng).unwrap()
        }
    };
    ctx.target()
        .res_output_syscall(selected_res_kind)
        .choose(rng)
        .copied()
}
pub fn select_res_output_syscall ( ctx : & Context , rng : & mut RngType ) -> Option < SyscallId > { let selected_res_kind = if ctx . res ( ) . is_empty ( ) || rng . gen_ratio ( 1 , 5 ) { ctx . target ( ) . res_kinds ( ) . choose ( rng ) . unwrap ( ) } else { let res_base = ctx . res ( ) . choose ( rng ) . unwrap ( ) ; if rng . gen ( ) { ctx . target ( ) . res_sub_tys ( res_base ) . choose ( rng ) . unwrap ( ) } else { ctx . target ( ) . res_super_tys ( res_base ) . choose ( rng ) . unwrap ( ) } } ; ctx . target ( ) . res_output_syscall ( selected_res_kind ) . choose ( rng ) . copied ( ) }
Select syscall that can output resources.
Select syscall that can output resources .
ctx
&Context
rng
&mut RngType
ctx
&Context
rng
&mut RngType