def deflate_string(as_bytes: bytes) ->str:
    """ Inverse of inflate_string.

    Takes the undecoded binary string.
    """
    zero_loc = as_bytes.find(0)
    if zero_loc < 0:
        return as_bytes.decode()
    return as_bytes[:zero_loc].decode()
