libstd: convert chained ifs to a match in base64.