FUNCTION mystery8(string1, string2, limit)
    byteArray = {0, 1, 2, ..., 255}
    index = 0 
    DO
        limit = limit -1
        IF limit < 0 THEN
            BREAK

        R5 = string1[index]
        IF R5 == 0 THEN
            BREAK 

        R4 = byteArray[string2[index]]
        R3 = byteArray[string1[index]]
        index = index + 1
    WHILE R3 != R4

    // line 21
    index = index - 1
    IF limit >= 0 THEN
        R2 = byteArray[string2[index]]
        R3 = byteArray[string1[index]]
        RETURN R3 - R2
    ELSE
        RETURN 0
        

