}
@BIF
public static EObject spawn_opt(EProc self, EObject tup) throws Pausable {
ETuple t;
EAtom m;
EAtom f;
ESeq a;
ESeq o;
if ((t=tup.testTuple()) == null
|| t.arity() != 4
|| (m=t.elm(1).testAtom()) == null
|| (f=t.elm(2).testAtom()) == null
|| (a=t.elm(3).testSeq()) == null
|| (o=t.elm(4).testSeq()) == null
) throw ERT.badarg(tup);
boolean link = false;
boolean monitor = false;
EAtom priority = null;
for (; !o.isNil(); o = o.tail() ) {
EObject val = o.head();
ETuple2 t2;
if (val == am_link) {
link = true;
} else if (val == am_monitor) {
monitor = true;
} else if ((t2 = ETuple2.cast(val)) != null) {
if (t2.elm(1) == am_priority) {
EAtom am = t2.elm(2).testAtom();
if (am != null)
priority = am;
}
// ignore full_sweep_after and min_heap_size