- if (ref4 != call->a[0]) { // ref is not the best
- if (ref4 < 4) { // not ambiguous
- if (ref4 == call->a[1]) tmp = call->a[0], call->a[0] = call->a[1], call->a[1] = tmp; // switch 0 and 1
- else call->a[2] = call->a[1], call->a[1] = call->a[0], call->a[0] = ref4; // triallele
+ for (i = 0; i < 4; ++i) call->a[i] = -1;
+ call->unseen = -1;
+ if (ref4 < 4) {
+ call->a[0] = ref4;
+ for (i = 3, j = 1; i >= 0; --i) {
+ if ((sum[i]&3) != ref4) {
+ if (sum[i]>>2 != 0) call->a[j++] = sum[i]&3;
+ else break;
+ }