uint B;
jsuint B;
static JSBool decode(JSContext *cx, JSString *str, JSString *reservedSet, jsval *rval){    size_t start, k = 0;    jschar C, H;    uint32 V;    uint B;    unsigned char octets[6];    JSString *R;    int16 j, n;    R = js_NewString(cx, NULL, 0, 0);    if (!R)        return JS_FALSE;    while (k < str->length) {        C = str->chars[k];        if (C == '%') {            start = k;            if ((k + 2) >= str->length) goto errOut;            if (!JS7_ISHEX(str->chars[k + 1]) || !JS7_ISHEX(str->chars[k + 2]))                 goto errOut;            B = JS7_UNHEX(str->chars[k + 1]) * 16 + JS7_UNHEX(str->chars[k + 2]);            k += 2;            if (!(B & 0x80))                C = B;            else {                n = 1;                while (B & (0x80 >> n)) n++;                if ((n == 1) || (n > 6)) goto errOut;                octets[0] = (char)B;                if ((k + 3 * (n - 1)) >= str->length) goto errOut;                for (j = 1; j < n; j++) {                    k++;                    if (str->chars[k] != '%') goto errOut;                    if (!JS7_ISHEX(str->chars[k + 1]) || !JS7_ISHEX(str->chars[k + 2]))                         goto errOut;                    B = JS7_UNHEX(str->chars[k + 1]) * 16 + JS7_UNHEX(str->chars[k + 2]);                    if ((B & 0xC0) != 0x80) goto errOut;                    k += 2;                    octets[j] = (char)B;                }                V = utf8ToOneUcs4Char(octets, n);                if (V >= 0x10000) {                    V -= 0x10000;                    if (V > 0xFFFFF) goto errOut;                    C = (jschar)((V & 0x3FF) + 0xDC00);                    H = (jschar)((V >> 10) + 0xD800);                    if (!add_chars(cx, R, &H, 1)) return JS_FALSE;                }                else                    C = (jschar)V;            }            if (js_strchr(reservedSet->chars, C)) {                if (!add_chars(cx, R, &str->chars[start], (k - start + 1))) return JS_FALSE;            }            else                if (!add_chars(cx, R, &C, 1)) return JS_FALSE;        }        else            if (!add_chars(cx, R, &C, 1)) return JS_FALSE;        k++;    }    *rval = STRING_TO_JSVAL(R);    return JS_TRUE;errOut:    JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,		     JSMSG_BAD_URI, NULL);    return JS_FALSE;}