+ if (c-0xa1>=0xfa-0xa1) {
+ if (c-0x87>=0xff-0x87) goto ilseq;
+ if (c < 0xa1) c -= 0x87;
+ else c -= 0x87 + (0xfa-0xa1);
+ c = (hkscs[4867+(c*157+d)/16]>>(c*157+d)%16)%2<<17
+ | hkscs[c*157+d];
+ /* A few HKSCS characters map to pairs of UCS
+ * characters. These are mapped to surrogate
+ * range in the hkscs table then hard-coded
+ * here. Ugly, yes. */
+ if (c/256 == 0xdc) {
+ union {
+ char c[8];
+ wchar_t wc[2];
+ } tmp;
+ char *ptmp = tmp.c;
+ size_t tmpx = iconv(combine_to_from(to, find_charmap("utf8")),
+ &(char *){"\303\212\314\204"
+ "\303\212\314\214"
+ "\303\252\314\204"
+ "\303\252\314\214"
+ +c%256}, &(size_t){4},
+ &ptmp, &(size_t){sizeof tmp});
+ size_t tmplen = ptmp - tmp.c;
+ if (tmplen > *outb) goto toobig;
+ if (tmpx) x++;
+ memcpy(*out, &tmp, tmplen);
+ *out += tmplen;
+ *outb -= tmplen;
+ continue;
+ }
+ if (!c) goto ilseq;
+ break;
+ }
+ c -= 0xa1;
+ c = big5[c][d]|(c==0x27&&(d==0x3a||d==0x3c||d==0x42))<<17;