a5 = args[0];
a6 = args[1];
} else if (a1.isVariable()){
a5 = new VariableTerm(engine);
a6 = new VariableTerm(engine);
((VariableTerm) a1).bind(new ListTerm(a5, a6), engine.trail);
} else {
return engine.fail();
}
a6 = a6.dereference();
if (a6.isList()){
Term[] args = {((ListTerm)a6).car(), ((ListTerm)a6).cdr()};
a7 = args[0];
a8 = args[1];
} else if (a6.isVariable()){
a7 = new VariableTerm(engine);
a8 = new VariableTerm(engine);
((VariableTerm) a6).bind(new ListTerm(a7, a8), engine.trail);
} else {
return engine.fail();
}
a9 = new ListTerm(a7, a8);
a10 = new VariableTerm(engine);
a11 = new VariableTerm(engine);
a12 = new ListTerm(a5, a10);
a13 = new VariableTerm(engine);
a14 = new VariableTerm(engine);
p1 = new PRED_$merge_5(a13, a14, a2, a3, a4, cont);
p2 = new PRED_$sort_4(a11, a14, a3, a4, p1);
p3 = new PRED_$sort_4(a12, a13, a3, a4, p2);