Repository: bytecodealliance/wasm-tools
Pull request #1615 (2024-06-12 22:00:20)

Use quoted identifiers in `wasmprinter` by default
This commit updates `wasmprinter` to use quoted identifiers of the form `$"foo"` when necessary instead of synthesizing identifiers such as `$#func4<foo>`. This helps produce more readable modules by default when names are synthesized since if a name is unique but otherwise has non-identifier characters then the quoted string form can be used.

While here I've additionally changed the way that non-printable characters in strings are printed to using `\u{XXX}` syntax instead of `\NN` syntax. This makes it a bit more obvious in unicode contexts that a single character is present and not multiple.

For a module I was looking at the "before" was:

```wasm
;; ...
    (func $#func73<undefined_weak:thread-local_initialization_routine_for_errno> (@name "undefined_weak:thread-local initialization routine for errno") (;73;) (type 13)
;; ...
    )
    (func $_initialize (;74;) (type 13)
;; ...
    )
    (func $#func75<initialize_char_const*_> (@name "initialize(char const*)") (;75;) (type 0) (param i32) (result i32)
;; ...
```

and the "after" is:

```wasm
;; ...
    (func $"undefined_weak:thread-local initialization routine for errno" (;73;) (type 13)
;; ...
    )
    (func $_initialize (;74;) (type 13)
;; ...
    )
    (func $"initialize(char const*)" (;75;) (type 0) (param i32) (result i32)
;; ...,
```

Notably `$"initialize(char const*)"` is much nicer to raed


Patch:
diff --git a/crates/wasmprinter/src/lib.rs b/crates/wasmprinter/src/lib.rs
index 8775bfdd..a6dd2575 100644
--- a/crates/wasmprinter/src/lib.rs
+++ b/crates/wasmprinter/src/lib.rs
@@ -147,8 +147,14 @@ impl State {
 }
 
 struct Naming {
-    identifier: Option<String>,
     name: String,
+    kind: NamingKind,
+}
+
+enum NamingKind {
+    DollarName,
+    DollarQuotedName,
+    SyntheticPrefix(String),
 }
 
 impl Config {
@@ -410,7 +416,7 @@ impl Printer<'_, '_> {
                     if len == 1 {
                         if let Some(name) = state.name.as_ref() {
                             self.result.write_str(" ")?;
-                            name.write(self.result)?;
+                            name.write(self)?;
                         }
                     }
                 }
@@ -925,7 +931,10 @@ impl Printer<'_, '_> {
         self.result.write_str(" ")?;
         if let Some(idxs @ (_, field_idx)) = ty_field_idx {
             match state.core.field_names.index_to_name.get(&idxs) {
-                Some(name) => write!(self.result, "${} ", name.identifier())?,
+                Some(name) => {
+                    name.write_identifier(self)?;
+                    self.result.write_str(" ")?;
+                }
                 None if self.config.name_unnamed => write!(self.result, "$#field{field_idx} ")?,
                 None => {}
             }
@@ -1453,7 +1462,7 @@ impl Printer<'_, '_> {
     fn _print_idx(&mut self, names: &HashMap<u32, Naming>, idx: u32, desc: &str) -> Result<()> {
         self.result.start_name()?;
         match names.get(&idx) {
-            Some(name) => write!(self.result, "${}", name.identifier())?,
+            Some(name) => name.write_identifier(self)?,
             None if self.config.name_unnamed => write!(self.result, "$#{desc}{idx}")?,
             None => write!(self.result, "{idx}")?,
         }
@@ -1464,7 +1473,7 @@ impl Printer<'_, '_> {
     fn print_local_idx(&mut self, state: &State, func: u32, idx: u32) -> Result<()> {
         self.result.start_name()?;
         match state.core.local_names.index_to_name.get(&(func, idx)) {
-            Some(name) => write!(self.result, "${}", name.identifier())?,
+            Some(name) => name.write_identifier(self)?,
             None if self.config.name_unnamed => write!(self.result, "$#local{idx}")?,
             None => write!(self.result, "{}", idx)?,
         }
@@ -1475,7 +1484,7 @@ impl Printer<'_, '_> {
     fn print_field_idx(&mut self, state: &State, ty: u32, idx: u32) -> Result<()> {
         self.result.start_name()?;
         match state.core.field_names.index_to_name.get(&(ty, idx)) {
-            Some(name) => write!(self.result, "${}", name.identifier())?,
+            Some(name) => name.write_identifier(self)?,
             None if self.config.name_unnamed => write!(self.result, "$#field{idx}")?,
             None => write!(self.result, "{}", idx)?,
         }
@@ -1499,7 +1508,7 @@ impl Printer<'_, '_> {
         self.result.start_name()?;
         match names.get(&cur_idx) {
             Some(name) => {
-                name.write(self.result)?;
+                name.write(self)?;
                 self.result.write_str(" ")?;
             }
             None if self.config.name_unnamed => {
@@ -1911,7 +1920,7 @@ impl Printer<'_, '_> {
         let outer = Self::outer_state(states, count)?;
         self.start_group("alias outer ")?;
         if let Some(name) = outer.name.as_ref() {
-            name.write(self.result)?;
+            name.write(self)?;
         } else {
             write!(self.result, "{count}")?;
         }
@@ -2592,7 +2601,7 @@ impl Printer<'_, '_> {
                 let outer = Self::outer_state(states, count)?;
                 self.start_group("alias outer ")?;
                 if let Some(name) = outer.name.as_ref() {
-                    name.write(self.result)?;
+                    name.write(self)?;
                 } else {
                     write!(self.result, "{count}")?;
                 }
@@ -2643,20 +2652,22 @@ impl Printer<'_, '_> {
 
     fn print_str(&mut self, name: &str) -> Result<()> {
         self.result.start_literal()?;
-        let mut bytes = [0; 4];
         self.result.write_str("\"")?;
+        self.print_str_contents(name)?;
+        self.result.write_str("\"")?;
+        self.result.reset_color()?;
+        Ok(())
+    }
+
+    fn print_str_contents(&mut self, name: &str) -> Result<()> {
         for c in name.chars() {
             let v = c as u32;
             if (0x20..0x7f).contains(&v) && c != '"' && c != '\\' && v < 0xff {
                 write!(self.result, "{c}")?;
             } else {
-                for byte in c.encode_utf8(&mut bytes).as_bytes() {
-                    self.hex_byte(*byte)?;
-                }
+                write!(self.result, "\\u{{{v:x}}}",)?;
             }
         }
-        self.result.write_str("\"")?;
-        self.result.reset_color()?;
         Ok(())
     }
 
@@ -2917,7 +2928,7 @@ impl NamedLocalPrinter {
         // Print the optional name if given...
         match name {
             Some(name) => {
-                name.write(dst.result)?;
+                name.write(dst)?;
                 dst.result.write_str(" ")?;
                 self.end_group_after_local = true;
             }
@@ -3057,7 +3068,10 @@ impl Naming {
         group: &str,
         used: Option<&mut HashSet<&'a str>>,
     ) -> Naming {
-        let mut identifier = None;
+        let mut kind = NamingKind::DollarName;
+        if name.chars().any(|c| !is_idchar(c)) {
+            kind = NamingKind::DollarQuotedName;
+        }
 
         // If the `name` provided can't be used as the raw identifier for the
         // item that it's describing then a synthetic name must be made. The
@@ -3078,17 +3092,13 @@ impl Naming {
         // valid identifier characters of `name` still appear in the returned
         // name).
         if name.is_empty()
-            || name.chars().any(|c| !is_idchar(c))
             || name.starts_with('#')
             || used.map(|set| !set.insert(name)).unwrap_or(false)
         {
-            let mut id = format!("#{group}{index}<");
-            id.extend(name.chars().map(|c| if is_idchar(c) { c } else { '_' }));
-            id.push('>');
-            identifier = Some(id);
+            kind = NamingKind::SyntheticPrefix(format!("#{group}{index}"));
         }
         return Naming {
-            identifier,
+            kind,
             name: name.to_string(),
         };
 
@@ -3126,37 +3136,39 @@ impl Naming {
         }
     }
 
-    fn identifier(&self) -> &str {
-        match &self.identifier {
-            Some(s) => s,
-            None => &self.name,
+    fn write_identifier(&self, printer: &mut Printer<'_, '_>) -> Result<()> {
+        match &self.kind {
+            NamingKind::DollarName => {
+                printer.result.write_str("$")?;
+                printer.result.write_str(&self.name)?;
+            }
+            NamingKind::DollarQuotedName => {
+                printer.result.write_str("$\"")?;
+                printer.print_str_contents(&self.name)?;
+                printer.result.write_str("\"")?;
+            }
+            NamingKind::SyntheticPrefix(prefix) => {
+                printer.result.write_str("$\"")?;
+                printer.result.write_str(&prefix)?;
+                printer.result.write_str(" ")?;
+                printer.print_str_contents(&self.name)?;
+                printer.result.write_str("\"")?;
+            }
         }
+        Ok(())
     }
 
-    fn write(&self, dst: &mut dyn Print) -> Result<()> {
-        match &self.identifier {
-            Some(alternate) => {
-                assert!(*alternate != self.name);
-                write!(dst, "${alternate} (@name \"")?;
-                // https://webassembly.github.io/spec/core/text/values.html#text-string
-                for c in self.name.chars() {
-                    match c {
-                        '\t' => write!(dst, "\\t")?,
-                        '\n' => write!(dst, "\\n")?,
-                        '\r' => write!(dst, "\\r")?,
-                        '"' => write!(dst, "\\\"")?,
-                        '\'' => write!(dst, "\\'")?,
-                        '\\' => write!(dst, "\\\\")?,
-                        c if (c as u32) < 0x20 || c as u32 == 0x7f => {
-                            write!(dst, "\\u{{{:x}}}", c as u32)?;
-                        }
-                        other => write!(dst, "{other}")?,
-                    }
-                }
-                write!(dst, "\")")?;
-            }
-            None => {
-                write!(dst, "${}", self.name)?;
+    fn write(&self, dst: &mut Printer<'_, '_>) -> Result<()> {
+        self.write_identifier(dst)?;
+        match &self.kind {
+            NamingKind::DollarName | NamingKind::DollarQuotedName => {}
+
+            NamingKind::SyntheticPrefix(_) => {
+                dst.result.write_str(" ")?;
+                dst.start_group("@name \"")?;
+                dst.print_str_contents(&self.name)?;
+                dst.result.write_str("\"")?;
+                dst.end_group()?;
             }
         }
         Ok(())
diff --git a/crates/wasmprinter/src/operator.rs b/crates/wasmprinter/src/operator.rs
index 41205a9f..8aac9020 100644
--- a/crates/wasmprinter/src/operator.rs
+++ b/crates/wasmprinter/src/operator.rs
@@ -86,7 +86,7 @@ impl<'printer, 'state, 'a, 'b> PrintOperator<'printer, 'state, 'a, 'b> {
         let has_name = match self.state.core.label_names.index_to_name.get(&key) {
             Some(name) => {
                 write!(self.printer.result, " ")?;
-                name.write(self.printer.result)?;
+                name.write(self.printer)?;
                 true
             }
             None if self.printer.config.name_unnamed => {
@@ -176,7 +176,7 @@ impl<'printer, 'state, 'a, 'b> PrintOperator<'printer, 'state, 'a, 'b> {
                 match name {
                     // Only print the name if one is found and there's also no
                     // name conflict.
-                    Some(name) if !name_conflict => name.write(self.printer.result)?,
+                    Some(name) if !name_conflict => name.write(self.printer)?,
 
                     // If there's no name conflict, and we're synthesizing
                     // names, and this isn't targetting the function itself then


Test patch:
diff --git a/crates/wasmprinter/tests/all.rs b/crates/wasmprinter/tests/all.rs
index 66de1461..114f3161 100644
--- a/crates/wasmprinter/tests/all.rs
+++ b/crates/wasmprinter/tests/all.rs
@@ -1,137 +1,3 @@
-#[test]
-fn no_panic() {
-    let bytes = wat::parse_str(
-        r#"
-            (module
-                (data (br 4294967295) "")
-            )
-        "#,
-    )
-    .unwrap();
-    wasmprinter::print_bytes(&bytes).unwrap();
-
-    let bytes = wat::parse_str(
-        r#"
-            (module
-                (func end)
-            )
-        "#,
-    )
-    .unwrap();
-    wasmprinter::print_bytes(&bytes).unwrap();
-}
-
-#[test]
-fn code_section_overflow() {
-    let bytes = wat::parse_str(
-        r#"
-            (module binary
-                "\00asm"
-                "\01\00\00\00"
-                "\0a\10\01"
-            )
-        "#,
-    )
-    .unwrap();
-    let err = wasmprinter::print_bytes(&bytes).unwrap_err();
-    assert!(
-        err.to_string().contains("unexpected end-of-file"),
-        "{:?}",
-        err
-    );
-}
-
-#[test]
-fn locals_overflow() {
-    let bytes = wat::parse_str(
-        r#"
-            (module binary
-                "\00asm" "\01\00\00\00"     ;; module header
-
-                "\01"           ;; type section
-                "\04"           ;; size of section
-                "\01"           ;; one type
-                "\60\00\00"     ;; function, no parameters or results
-
-                "\03"   ;; function section
-                "\02"   ;; size of function section
-                "\01"   ;; one function
-                "\00"   ;; type 0
-
-                "\0a"   ;; code section
-                "\09"   ;; size of code section
-                "\01"   ;; 1 function
-                "\07"   ;; size of function
-                "\01"   ;; one local
-                "\ff\ff\ff\ff\00"   ;; lots of this type
-                "\70"   ;; type
-            )
-        "#,
-    )
-    .unwrap();
-    let err = wasmprinter::print_bytes(&bytes).unwrap_err();
-    assert!(
-        err.to_string().contains("maximum number of locals"),
-        "{:?}",
-        err
-    );
-}
-
-#[test]
-fn memarg_too_big() {
-    let bytes = wat::parse_str(
-        r#"
-            (module binary
-                "\00asm" "\01\00\00\00"     ;; module header
-
-                "\0b"           ;; data section
-                "\07"           ;; size of section
-                "\01"           ;; number of segments
-                "\00"           ;; flags=active
-                "\2e"           ;; i32.load16_s
-                "\3f"           ;; alignment
-                "\00"           ;; offset
-                "\0b"           ;; end
-                "\00"           ;; data size
-            )
-        "#,
-    )
-    .unwrap();
-    let err = wasmprinter::print_bytes(&bytes).unwrap_err();
-    assert!(
-        err.to_string().contains("alignment in memarg too large"),
-        "{:?}",
-        err
-    );
-}
-
-#[test]
-fn no_panic_dangling_else() {
-    let bytes = wat::parse_str(
-        r#"
-            (module
-                (func else)
-            )
-        "#,
-    )
-    .unwrap();
-    wasmprinter::print_bytes(&bytes).unwrap();
-}
-
-#[test]
-fn dangling_if() {
-    let bytes = wat::parse_str(
-        r#"
-            (module
-                (func if)
-            )
-        "#,
-    )
-    .unwrap();
-    let wat = wasmprinter::print_bytes(&bytes).unwrap();
-    wat::parse_str(&wat).unwrap();
-}
-
 #[test]
 fn no_oom() {
     // Whatever is printed here, it shouldn't take more than 500MB to print
@@ -147,94 +13,6 @@ fn no_oom() {
     assert!(wat.len() < 500_000_000);
 }
 
-#[test]
-fn dont_reserve_the_world() {
-    let bytes = wat::parse_str(
-        r#"
-            (module binary
-                "\00asm" "\01\00\00\00"     ;; module header
-
-                "\03"               ;; function section
-                "\05"               ;; section size
-                "\ff\ff\ff\ff\0f"   ;; number of functions (u32::MAX)
-            )
-        "#,
-    )
-    .unwrap();
-    let err = wasmprinter::print_bytes(&bytes).unwrap_err();
-    assert!(
-        err.to_string()
-            .contains("functions which exceeds the limit"),
-        "{:?}",
-        err
-    );
-}
-
-#[test]
-fn label_shadowing_block() {
-    const MODULE: &str = r#"
-      (module
-        (type (;0;) (func))
-        (func (;0;) (type 0)
-          block $a
-            br $a
-          end
-          block $a
-            br $a
-          end
-        )
-      )
-    "#;
-    let bytes = wat::parse_str(MODULE).unwrap();
-    let result = wasmprinter::print_bytes(&bytes).unwrap();
-    assert_eq!(
-        result.replace(" ", "").trim(),
-        MODULE.replace(" ", "").trim()
-    );
-}
-
-#[test]
-fn label_shadowing_block_confusion() {
-    // Make sure we don’t refer to a shadowed label via a name.
-    const MODULE: &str = r#"
-      (module
-        (type (;0;) (func))
-        (func (;0;) (type 0)
-          block $a
-            block $a
-              br 1
-            end
-          end
-        )
-      )
-    "#;
-    let bytes = wat::parse_str(MODULE).unwrap();
-    let result = wasmprinter::print_bytes(&bytes).unwrap();
-    assert_eq!(
-        result.replace(" ", "").trim(),
-        MODULE.replace(" ", "").trim()
-    );
-}
-
-#[test]
-fn label_shadowing_locals() {
-    const MODULE: &str = r#"
-      (module
-        (type (;0;) (func (param i32) (result i32)))
-        (func (;0;) (type 0) (param $l i32) (result i32)
-          (local $#local1<l> (@name "l") i32) (local $#local2<l> (@name "l") i32)
-          local.get $l
-        )
-      )
-    "#;
-    let bytes = wat::parse_str(MODULE).unwrap();
-    let result = wasmprinter::print_bytes(&bytes).unwrap();
-    assert_eq!(
-        result.replace(" ", "").trim(),
-        MODULE.replace(" ", "").trim()
-    );
-}
-
 #[test]
 fn offsets_and_lines_smoke_test() {
     const MODULE: &str = r#"
@@ -268,29 +46,3 @@ fn offsets_and_lines_smoke_test() {
 
     assert_eq!(actual, expected);
 }
-
-#[test]
-fn no_panic_non_func_type() {
-    let bytes = wat::parse_str(
-        "(module
-            (type (struct))
-            (func (type 0))
-        )",
-    )
-    .unwrap();
-    wasmprinter::print_bytes(&bytes).unwrap();
-}
-
-#[test]
-fn shared_global() {
-    const MODULE: &str = r#"
-    (module
-        (global (;0;) (shared f32))
-    )"#;
-    let bytes = wat::parse_str(MODULE).unwrap();
-    let result = wasmprinter::print_bytes(&bytes).unwrap();
-    assert_eq!(
-        result.replace(" ", "").trim(),
-        MODULE.replace(" ", "").trim()
-    );
-}
diff --git a/crates/wit-component/tests/components/export-resource/component.wat b/crates/wit-component/tests/components/export-resource/component.wat
index ff2dff37..d6a3b4a0 100644
--- a/crates/wit-component/tests/components/export-resource/component.wat
+++ b/crates/wit-component/tests/components/export-resource/component.wat
@@ -25,13 +25,13 @@
   )
   (core module (;1;)
     (type (;0;) (func (param i32)))
-    (func $#func0<dtor-_export_foo-a> (@name "dtor-[export]foo-a") (;0;) (type 0) (param i32)
+    (func $"dtor-[export]foo-a" (;0;) (type 0) (param i32)
       local.get 0
       i32.const 0
       call_indirect (type 0)
     )
     (table (;0;) 1 1 funcref)
-    (export "0" (func $#func0<dtor-_export_foo-a>))
+    (export "0" (func $"dtor-[export]foo-a"))
     (export "$imports" (table 0))
     (@producers
       (processed-by "wit-component" "$CARGO_PKG_VERSION")
diff --git a/crates/wit-component/tests/components/import-in-adapter-and-main-module/component.wat b/crates/wit-component/tests/components/import-in-adapter-and-main-module/component.wat
index 47dce20f..1bd0dfbd 100644
--- a/crates/wit-component/tests/components/import-in-adapter-and-main-module/component.wat
+++ b/crates/wit-component/tests/components/import-in-adapter-and-main-module/component.wat
@@ -100,7 +100,7 @@
       i32.const 1
       call_indirect (type 0)
     )
-    (func $#func2<indirect-foo:shared-dependency/doc-g1> (@name "indirect-foo:shared-dependency/doc-g1") (;2;) (type 0) (param i32)
+    (func $"#func2 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;2;) (type 0) (param i32)
       local.get 0
       i32.const 2
       call_indirect (type 0)
@@ -117,7 +117,7 @@
     (table (;0;) 5 5 funcref)
     (export "0" (func $indirect-foo:shared-dependency/doc-g1))
     (export "1" (func $indirect-foo:shared-dependency/doc-g2))
-    (export "2" (func $#func2<indirect-foo:shared-dependency/doc-g1>))
+    (export "2" (func $"#func2 indirect-foo:shared-dependency/doc-g1"))
     (export "3" (func $indirect-foo:shared-dependency/doc-g3))
     (export "4" (func $adapt-old-adapter-f1))
     (export "$imports" (table 0))
diff --git a/tests/cli/dangling_if.wat b/tests/cli/dangling_if.wat
new file mode 100644
index 00000000..420cb6da
--- /dev/null
+++ b/tests/cli/dangling_if.wat
@@ -0,0 +1,5 @@
+;; RUN: print % | parse -t
+
+(module
+    (func if)
+)
diff --git a/tests/cli/dangling_if.wat.stdout b/tests/cli/dangling_if.wat.stdout
new file mode 100644
index 00000000..f7cec4aa
--- /dev/null
+++ b/tests/cli/dangling_if.wat.stdout
@@ -0,0 +1,7 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
+    if ;; label = @1
+    
+  )
+)
diff --git a/tests/cli/demangle1.wat.stdout b/tests/cli/demangle1.wat.stdout
index feee6de8..7171d9a1 100644
--- a/tests/cli/demangle1.wat.stdout
+++ b/tests/cli/demangle1.wat.stdout
@@ -2,5 +2,5 @@
   (type (;0;) (func))
   (func $do_no_demangle_me (;0;) (type 0))
   (func $rust (;1;) (type 0))
-  (func $#func2<foo_double_> (@name "foo(double)") (;2;) (type 0))
+  (func $"foo(double)" (;2;) (type 0))
 )
diff --git a/tests/cli/label_shadowing_block.wat b/tests/cli/label_shadowing_block.wat
new file mode 100644
index 00000000..2d235746
--- /dev/null
+++ b/tests/cli/label_shadowing_block.wat
@@ -0,0 +1,11 @@
+;; RUN: print %
+(module
+  (func
+    block $a
+      br $a
+    end
+    block $a
+      br $a
+    end
+  )
+)
diff --git a/tests/cli/label_shadowing_block.wat.stdout b/tests/cli/label_shadowing_block.wat.stdout
new file mode 100644
index 00000000..b438c698
--- /dev/null
+++ b/tests/cli/label_shadowing_block.wat.stdout
@@ -0,0 +1,11 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
+    block $a
+      br $a
+    end
+    block $a
+      br $a
+    end
+  )
+)
diff --git a/tests/cli/label_shadowing_block_confusion.wat b/tests/cli/label_shadowing_block_confusion.wat
new file mode 100644
index 00000000..f2f566e1
--- /dev/null
+++ b/tests/cli/label_shadowing_block_confusion.wat
@@ -0,0 +1,12 @@
+;; RUN: print %
+
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
+    block $a
+      block $a
+        br 1
+      end
+    end
+  )
+)
diff --git a/tests/cli/label_shadowing_block_confusion.wat.stdout b/tests/cli/label_shadowing_block_confusion.wat.stdout
new file mode 100644
index 00000000..4b2bbd85
--- /dev/null
+++ b/tests/cli/label_shadowing_block_confusion.wat.stdout
@@ -0,0 +1,10 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
+    block $a
+      block $a
+        br 1
+      end
+    end
+  )
+)
diff --git a/tests/cli/label_shadowing_locals.wat b/tests/cli/label_shadowing_locals.wat
new file mode 100644
index 00000000..5823adfb
--- /dev/null
+++ b/tests/cli/label_shadowing_locals.wat
@@ -0,0 +1,8 @@
+;; RUN: print %
+(module
+  (type (func (param i32) (result i32)))
+  (func (type 0) (param $l i32) (result i32)
+    (local $#local1<l> (@name "l") i32) (local $#local2<l> (@name "l") i32)
+    local.get $l
+  )
+)
diff --git a/tests/cli/label_shadowing_locals.wat.stdout b/tests/cli/label_shadowing_locals.wat.stdout
new file mode 100644
index 00000000..db3adf4e
--- /dev/null
+++ b/tests/cli/label_shadowing_locals.wat.stdout
@@ -0,0 +1,7 @@
+(module
+  (type (;0;) (func (param i32) (result i32)))
+  (func (;0;) (type 0) (param $l i32) (result i32)
+    (local $"#local1 l" (@name "l") i32) (local $"#local2 l" (@name "l") i32)
+    local.get $l
+  )
+)
diff --git a/tests/cli/no_panic_non_func_type.wat b/tests/cli/no_panic_non_func_type.wat
new file mode 100644
index 00000000..fcbe1b0d
--- /dev/null
+++ b/tests/cli/no_panic_non_func_type.wat
@@ -0,0 +1,6 @@
+;; RUN: print %
+
+(module
+    (type (struct))
+    (func (type 0))
+)
diff --git a/tests/cli/no_panic_non_func_type.wat.stdout b/tests/cli/no_panic_non_func_type.wat.stdout
new file mode 100644
index 00000000..ab571b73
--- /dev/null
+++ b/tests/cli/no_panic_non_func_type.wat.stdout
@@ -0,0 +1,4 @@
+(module
+  (type (;0;) (struct))
+  (func (;0;) (type 0))
+)
diff --git a/tests/cli/print-code-section-overflow.wat b/tests/cli/print-code-section-overflow.wat
new file mode 100644
index 00000000..08859c8e
--- /dev/null
+++ b/tests/cli/print-code-section-overflow.wat
@@ -0,0 +1,7 @@
+;; FAIL: print %
+
+(module binary
+    "\00asm"
+    "\01\00\00\00"
+    "\0a\10\01"
+)
diff --git a/tests/cli/print-code-section-overflow.wat.stderr b/tests/cli/print-code-section-overflow.wat.stderr
new file mode 100644
index 00000000..e01193c6
--- /dev/null
+++ b/tests/cli/print-code-section-overflow.wat.stderr
@@ -0,0 +1,1 @@
+error: unexpected end-of-file (at offset 0xb)
diff --git a/tests/cli/print-code-section-overflow.wat.stdout b/tests/cli/print-code-section-overflow.wat.stdout
new file mode 100644
index 00000000..356532d6
--- /dev/null
+++ b/tests/cli/print-code-section-overflow.wat.stdout
@@ -0,0 +1,1 @@
+(module
\ No newline at end of file
diff --git a/tests/cli/print-dont-reserve-the-world.wat b/tests/cli/print-dont-reserve-the-world.wat
new file mode 100644
index 00000000..df36f985
--- /dev/null
+++ b/tests/cli/print-dont-reserve-the-world.wat
@@ -0,0 +1,9 @@
+;; FAIL: print %
+
+(module binary
+    "\00asm" "\01\00\00\00"     ;; module header
+
+    "\03"               ;; function section
+    "\05"               ;; section size
+    "\ff\ff\ff\ff\0f"   ;; number of functions (u32::MAX)
+)
diff --git a/tests/cli/print-dont-reserve-the-world.wat.stderr b/tests/cli/print-dont-reserve-the-world.wat.stderr
new file mode 100644
index 00000000..ac95ab81
--- /dev/null
+++ b/tests/cli/print-dont-reserve-the-world.wat.stderr
@@ -0,0 +1,1 @@
+error: module contains 4294967295 functions which exceeds the limit of 1000000
diff --git a/tests/cli/print-dont-reserve-the-world.wat.stdout b/tests/cli/print-dont-reserve-the-world.wat.stdout
new file mode 100644
index 00000000..356532d6
--- /dev/null
+++ b/tests/cli/print-dont-reserve-the-world.wat.stdout
@@ -0,0 +1,1 @@
+(module
\ No newline at end of file
diff --git a/tests/cli/print-locals-overflow.wat b/tests/cli/print-locals-overflow.wat
new file mode 100644
index 00000000..66c20a3f
--- /dev/null
+++ b/tests/cli/print-locals-overflow.wat
@@ -0,0 +1,23 @@
+;; FAIL: print %
+
+(module binary
+    "\00asm" "\01\00\00\00"     ;; module header
+
+    "\01"           ;; type section
+    "\04"           ;; size of section
+    "\01"           ;; one type
+    "\60\00\00"     ;; function, no parameters or results
+
+    "\03"   ;; function section
+    "\02"   ;; size of function section
+    "\01"   ;; one function
+    "\00"   ;; type 0
+
+    "\0a"   ;; code section
+    "\09"   ;; size of code section
+    "\01"   ;; 1 function
+    "\07"   ;; size of function
+    "\01"   ;; one local
+    "\ff\ff\ff\ff\00"   ;; lots of this type
+    "\70"   ;; type
+)
diff --git a/tests/cli/print-locals-overflow.wat.stderr b/tests/cli/print-locals-overflow.wat.stderr
new file mode 100644
index 00000000..42167d7e
--- /dev/null
+++ b/tests/cli/print-locals-overflow.wat.stderr
@@ -0,0 +1,1 @@
+error: function exceeds the maximum number of locals that can be printed
diff --git a/tests/cli/print-locals-overflow.wat.stdout b/tests/cli/print-locals-overflow.wat.stdout
new file mode 100644
index 00000000..564f603c
--- /dev/null
+++ b/tests/cli/print-locals-overflow.wat.stdout
@@ -0,0 +1,3 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
\ No newline at end of file
diff --git a/tests/cli/print-memarg-too-big.wat b/tests/cli/print-memarg-too-big.wat
new file mode 100644
index 00000000..ede83106
--- /dev/null
+++ b/tests/cli/print-memarg-too-big.wat
@@ -0,0 +1,15 @@
+;; FAIL: print %
+
+(module binary
+    "\00asm" "\01\00\00\00"     ;; module header
+
+    "\0b"           ;; data section
+    "\07"           ;; size of section
+    "\01"           ;; number of segments
+    "\00"           ;; flags=active
+    "\2e"           ;; i32.load16_s
+    "\3f"           ;; alignment
+    "\00"           ;; offset
+    "\0b"           ;; end
+    "\00"           ;; data size
+)
diff --git a/tests/cli/print-memarg-too-big.wat.stderr b/tests/cli/print-memarg-too-big.wat.stderr
new file mode 100644
index 00000000..e53e7882
--- /dev/null
+++ b/tests/cli/print-memarg-too-big.wat.stderr
@@ -0,0 +1,1 @@
+error: alignment in memarg too large
diff --git a/tests/cli/print-memarg-too-big.wat.stdout b/tests/cli/print-memarg-too-big.wat.stdout
new file mode 100644
index 00000000..ef9290ef
--- /dev/null
+++ b/tests/cli/print-memarg-too-big.wat.stdout
@@ -0,0 +1,2 @@
+(module
+  (data (;0;) (i32.load16_s
\ No newline at end of file
diff --git a/tests/cli/print-no-panic-bad-data-segment.wat b/tests/cli/print-no-panic-bad-data-segment.wat
new file mode 100644
index 00000000..35f44ad0
--- /dev/null
+++ b/tests/cli/print-no-panic-bad-data-segment.wat
@@ -0,0 +1,5 @@
+;; RUN: print %
+
+(module
+    (data (br 4294967295) "")
+)
diff --git a/tests/cli/print-no-panic-bad-data-segment.wat.stdout b/tests/cli/print-no-panic-bad-data-segment.wat.stdout
new file mode 100644
index 00000000..9ceb5d72
--- /dev/null
+++ b/tests/cli/print-no-panic-bad-data-segment.wat.stdout
@@ -0,0 +1,3 @@
+(module
+  (data (;0;) (br 4294967295 (; INVALID ;)) "")
+)
diff --git a/tests/cli/print-no-panic-dangling-else.wat b/tests/cli/print-no-panic-dangling-else.wat
new file mode 100644
index 00000000..7c6307f1
--- /dev/null
+++ b/tests/cli/print-no-panic-dangling-else.wat
@@ -0,0 +1,5 @@
+;; RUN: print %
+
+(module
+    (func else)
+)
diff --git a/tests/cli/print-no-panic-dangling-else.wat.stdout b/tests/cli/print-no-panic-dangling-else.wat.stdout
new file mode 100644
index 00000000..e43ca79f
--- /dev/null
+++ b/tests/cli/print-no-panic-dangling-else.wat.stdout
@@ -0,0 +1,6 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)
+  else
+  )
+)
diff --git a/tests/cli/print-no-panic-double-end.wat b/tests/cli/print-no-panic-double-end.wat
new file mode 100644
index 00000000..4d7b65d4
--- /dev/null
+++ b/tests/cli/print-no-panic-double-end.wat
@@ -0,0 +1,5 @@
+;; RUN: print %
+
+(module
+    (func end)
+)
diff --git a/tests/cli/print-no-panic-double-end.wat.stdout b/tests/cli/print-no-panic-double-end.wat.stdout
new file mode 100644
index 00000000..828cd768
--- /dev/null
+++ b/tests/cli/print-no-panic-double-end.wat.stdout
@@ -0,0 +1,4 @@
+(module
+  (type (;0;) (func))
+  (func (;0;) (type 0)end)
+)
diff --git a/tests/cli/shared_global.wat b/tests/cli/shared_global.wat
new file mode 100644
index 00000000..fa8544f0
--- /dev/null
+++ b/tests/cli/shared_global.wat
@@ -0,0 +1,4 @@
+;; RUN: print %
+(module
+  (global (shared f32))
+)
diff --git a/tests/cli/shared_global.wat.stdout b/tests/cli/shared_global.wat.stdout
new file mode 100644
index 00000000..9a52b283
--- /dev/null
+++ b/tests/cli/shared_global.wat.stdout
@@ -0,0 +1,3 @@
+(module
+  (global (;0;) (shared f32) )
+)
diff --git a/tests/snapshots/local/names.wast/0.print b/tests/snapshots/local/names.wast/0.print
index 32691869..02296974 100644
--- a/tests/snapshots/local/names.wast/0.print
+++ b/tests/snapshots/local/names.wast/0.print
@@ -1,1 +1,1 @@
-(module $#module0<> (@name ""))
+(module $"#module0 " (@name ""))
diff --git a/tests/snapshots/local/names.wast/2.print b/tests/snapshots/local/names.wast/2.print
index 50883023..ec6fb82d 100644
--- a/tests/snapshots/local/names.wast/2.print
+++ b/tests/snapshots/local/names.wast/2.print
@@ -1,6 +1,6 @@
 (module
   (type (;0;) (func))
   (func $foo (;0;) (type 0))
-  (func $#func1<foo> (@name "foo") (;1;) (type 0))
+  (func $"#func1 foo" (@name "foo") (;1;) (type 0))
   (func $foo_1 (;2;) (type 0))
 )
diff --git a/tests/snapshots/local/names.wast/3.print b/tests/snapshots/local/names.wast/3.print
index 4153850d..8e21ace8 100644
--- a/tests/snapshots/local/names.wast/3.print
+++ b/tests/snapshots/local/names.wast/3.print
@@ -1,6 +1,6 @@
 (module
   (type (;0;) (func))
   (func (;0;) (type 0)
-    (local $foo i32) (local $#local1<foo> (@name "foo") i32) (local $foo_1 i32)
+    (local $foo i32) (local $"#local1 foo" (@name "foo") i32) (local $foo_1 i32)
   )
 )
diff --git a/tests/snapshots/local/names.wast/4.print b/tests/snapshots/local/names.wast/4.print
index 6e3b5ed2..5e70567e 100644
--- a/tests/snapshots/local/names.wast/4.print
+++ b/tests/snapshots/local/names.wast/4.print
@@ -1,4 +1,4 @@
 (module
   (type (;0;) (func))
-  (func $#func0<> (@name "") (;0;) (type 0))
+  (func $"#func0 " (@name "") (;0;) (type 0))
 )
diff --git a/tests/snapshots/local/names.wast/5.print b/tests/snapshots/local/names.wast/5.print
index 8d22ad1e..b6d74372 100644
--- a/tests/snapshots/local/names.wast/5.print
+++ b/tests/snapshots/local/names.wast/5.print
@@ -1,6 +1,6 @@
 (module
   (type (;0;) (func))
   (func (;0;) (type 0)
-    (local $#local0<> (@name "") i32)
+    (local $"#local0 " (@name "") i32)
   )
 )
diff --git a/tests/snapshots/testsuite/custom.wast/0.print b/tests/snapshots/testsuite/custom.wast/0.print
index 00e35eae..d0cea5e6 100644
--- a/tests/snapshots/testsuite/custom.wast/0.print
+++ b/tests/snapshots/testsuite/custom.wast/0.print
@@ -4,8 +4,8 @@
   (@custom "a custom section" (before first) "")
   (@custom "" (before first) "this is payload")
   (@custom "" (before first) "")
-  (@custom "\00\00custom sectio\00" (before first) "this is the payload")
-  (@custom "\ef\bb\bfa custom sect" (before first) "this is the payload")
-  (@custom "a custom sect\e2\8c\a3" (before first) "this is the payload")
+  (@custom "\u{0}\u{0}custom sectio\u{0}" (before first) "this is the payload")
+  (@custom "\u{feff}a custom sect" (before first) "this is the payload")
+  (@custom "a custom sect\u{2323}" (before first) "this is the payload")
   (@custom "module within a module" (before first) "\00asm\01\00\00\00")
 )
diff --git a/tests/snapshots/testsuite/names.wast/4.print b/tests/snapshots/testsuite/names.wast/4.print
index bb6d6702..a3290082 100644
--- a/tests/snapshots/testsuite/names.wast/4.print
+++ b/tests/snapshots/testsuite/names.wast/4.print
@@ -1443,7 +1443,7 @@
   (export "_" (func 3))
   (export "$" (func 4))
   (export "@" (func 5))
-  (export "~!@#$%^&*()_+`-={}|[]\5c:\22;'<>?,./ " (func 6))
+  (export "~!@#$%^&*()_+`-={}|[]\u{5c}:\u{22};'<>?,./ " (func 6))
   (export "NaN" (func 7))
   (export "Infinity" (func 8))
   (export "if" (func 9))
@@ -1452,468 +1452,468 @@
   (export "__malloc" (func 12))
   (export "a" (func 13))
   (export "A" (func 14))
-  (export "\ef\bb\bf" (func 15))
-  (export "\c3\85" (func 16))
-  (export "A\cc\8a" (func 17))
-  (export "\e2\84\ab" (func 18))
-  (export "\ef\ac\83" (func 19))
-  (export "f\ef\ac\81" (func 20))
+  (export "\u{feff}" (func 15))
+  (export "\u{c5}" (func 16))
+  (export "A\u{30a}" (func 17))
+  (export "\u{212b}" (func 18))
+  (export "\u{fb03}" (func 19))
+  (export "f\u{fb01}" (func 20))
   (export "ffi" (func 21))
-  (export "\00\01\02\03\04\05\06\07\08\09\0a\0b\0c\0d\0e\0f" (func 22))
-  (export "\10\11\12\13\14\15\16\17\18\19\1a\1b\1c\1d\1e\1f" (func 23))
-  (export " \7f" (func 24))
-  (export "\c2\80\c2\81\c2\82\c2\83\c2\84\c2\85\c2\86\c2\87\c2\88\c2\89\c2\8a\c2\8b\c2\8c\c2\8d\c2\8e\c2\8f" (func 25))
-  (export "\c2\90\c2\91\c2\92\c2\93\c2\94\c2\95\c2\96\c2\97\c2\98\c2\99\c2\9a\c2\9b\c2\9c\c2\9d\c2\9e\c2\9f" (func 26))
-  (export "\ef\bf\b0\ef\bf\b1\ef\bf\b2\ef\bf\b3\ef\bf\b4\ef\bf\b5\ef\bf\b6\ef\bf\b7" (func 27))
-  (export "\ef\bf\b8\ef\bf\b9\ef\bf\ba\ef\bf\bb\ef\bf\bc\ef\bf\bd\ef\bf\be\ef\bf\bf" (func 28))
-  (export "\e2\90\80\e2\90\81\e2\90\82\e2\90\83\e2\90\84\e2\90\85\e2\90\86\e2\90\87\e2\90\88\e2\90\89\e2\90\8a\e2\90\8b\e2\90\8c\e2\90\8d\e2\90\8e\e2\90\8f" (func 29))
-  (export "\e2\90\90\e2\90\91\e2\90\92\e2\90\93\e2\90\94\e2\90\95\e2\90\96\e2\90\97\e2\90\98\e2\90\99\e2\90\9a\e2\90\9b\e2\90\9c\e2\90\9d\e2\90\9e\e2\90\9f" (func 30))
-  (export "\e2\90\a0\e2\90\a1" (func 31))
-  (export "\ef\bf\b0\ef\bf\b1\ef\bf\b2\ef\bf\b3\ef\bf\b4\ef\bf\b5\ef\bf\b6\ef\bf\b7\ef\bf\b8\ef\bf\b9\ef\bf\ba\ef\bf\bb\ef\bf\bc\ef\bf\bd" (func 32))
-  (export "\e2\80\8d" (func 33))
-  (export "\e2\80\8c" (func 34))
-  (export "\cd\8f" (func 35))
-  (export "\e2\81\a0" (func 36))
-  (export "\e2\b5\bf" (func 37))
-  (export "\f0\91\81\bf" (func 38))
-  (export "\e1\a0\8e" (func 39))
-  (export "\ef\bf\af\e2\80\8b\c2\a0\c2\ad\e2\81\a0\e1\9a\80\e2\80\ae\e2\80\ad" (func 40))
-  (export "\e2\80\8e\e2\80\8f\e2\80\91\e2\80\a8\e2\80\a9\e2\80\aa\e2\80\ab\e2\80\ac\e2\80\af\e2\81\a6\e2\81\a7\e2\81\a8\e2\81\a9" (func 41))
-  (export "\e2\81\aa\e2\81\ab\e2\81\ac\e2\81\ad\e2\81\ae\e2\81\af" (func 42))
-  (export "\e2\81\a1\e2\81\a2\e2\81\a3\e2\81\a4" (func 43))
-  (export "\f0\90\80\80\f3\9f\bf\bf\f4\8f\bf\bf" (func 44))
-  (export "Z\cc\8f\cd\86\cc\86\cd\9b\cd\8c\cc\b4\cd\98\cd\9e\cd\87\cc\ab\cc\a5\cc\aa\cd\93\cd\88\cd\94\cd\8e\cc\97\cc\9e\cc\ba\cc\af\cc\b1\cc\9e\cc\99\cc\b1\cc\9c\cc\96\cc\a0a\cd\97\cd\a8\cc\8e\cc\84\cc\86\cd\97\cc\bf\cd\a1\cd\9f\cd\80\cc\b6\cd\81\cc\a5\cc\b0\cc\b3\cc\ad\cd\99\cc\b2\cc\b1\cc\b9\cc\9d\cd\8e\cc\bcl\cd\84\cd\8a\cc\9a\cd\97\cd\a6\cd\84\cd\ab\cc\87\cd\81\cc\b6\cc\b7\cd\89\cc\a9\cc\b9\cc\ab\cc\9d\cd\96\cd\85\cc\99\cc\b2\cc\bc\cd\87\cd\9a\cd\8d\cc\ae\cd\8e\cc\a5\cd\85\cc\9eg\cd\83\cc\90\cc\85\cd\ae\cc\94\cc\90\cc\8e\cc\82\cc\8f\cc\be\cd\8a\cc\8d\cd\8b\cd\8a\cd\a7\cc\81\cc\86\cd\a6\cd\9e\cc\b6\cd\95\cd\94\cd\9a\cc\a9o\cd\8b\cc\94\cd\90\cd\aa\cd\a9\cc\a1\cd\8f\cc\a2\cc\a7\cd\81\cc\ab\cc\99\cc\a4\cc\ae\cd\96\cd\99\cd\93\cc\ba\cc\9c\cc\a9\cc\bc\cc\98\cc\a0" (func 45))
-  (export "\e1\85\9f\e1\85\a0\e3\85\a4\ef\be\a0" (func 46))
-  (export "\ef\b8\80" (func 47))
-  (export "\ef\b8\84" (func 48))
-  (export "\f3\a0\84\80" (func 49))
-  (export "\f3\a0\87\af" (func 50))
-  (export "\cc\88" (func 51))
-  (export "\0a" (func 52))
-  (export "\e2\90\a4" (func 53))
-  (export "\e2\80\a8" (func 54))
-  (export "\0d" (func 55))
-  (export "\0d\0a" (func 56))
-  (export "\0a\0d" (func 57))
-  (export "\1e" (func 58))
-  (export "\0b" (func 59))
-  (export "\0c" (func 60))
-  (export "\c2\85" (func 61))
-  (export "\e2\80\a9" (func 62))
-  (export "\e2\80\a6" (func 63))
-  (export "\e2\8f\8e" (func 64))
-  (export "\c2\8b" (func 65))
-  (export "\c2\8c" (func 66))
-  (export "\c2\8d" (func 67))
-  (export "\e2\86\b5" (func 68))
-  (export "\e2\86\a9" (func 69))
-  (export "\e2\8c\a4" (func 70))
-  (export "\e2\a4\b6" (func 71))
-  (export "\e2\86\b2" (func 72))
-  (export "\e2\ae\a8" (func 73))
-  (export "\e2\ae\b0" (func 74))
-  (export "\ef\bf\bd" (func 75))
-  (export "\ef\b7\90" (func 76))
-  (export "\ef\b7\91" (func 77))
-  (export "\ef\b7\92" (func 78))
-  (export "\ef\b7\93" (func 79))
-  (export "\ef\b7\94" (func 80))
-  (export "\ef\b7\95" (func 81))
-  (export "\ef\b7\96" (func 82))
-  (export "\ef\b7\97" (func 83))
-  (export "\ef\b7\98" (func 84))
-  (export "\ef\b7\99" (func 85))
-  (export "\ef\b7\9a" (func 86))
-  (export "\ef\b7\9b" (func 87))
-  (export "\ef\b7\9c" (func 88))
-  (export "\ef\b7\9d" (func 89))
-  (export "\ef\b7\9e" (func 90))
-  (export "\ef\b7\9f" (func 91))
-  (export "\ef\b7\a0" (func 92))
-  (export "\ef\b7\a1" (func 93))
-  (export "\ef\b7\a2" (func 94))
-  (export "\ef\b7\a3" (func 95))
-  (export "\ef\b7\a4" (func 96))
-  (export "\ef\b7\a5" (func 97))
-  (export "\ef\b7\a6" (func 98))
-  (export "\ef\b7\a7" (func 99))
-  (export "\ef\b7\a8" (func 100))
-  (export "\ef\b7\a9" (func 101))
-  (export "\ef\b7\aa" (func 102))
-  (export "\ef\b7\ab" (func 103))
-  (export "\ef\b7\ac" (func 104))
-  (export "\ef\b7\ad" (func 105))
-  (export "\ef\b7\ae" (func 106))
-  (export "\ef\b7\af" (func 107))
-  (export "\ef\bf\be" (func 108))
-  (export "\ef\bf\bf" (func 109))
-  (export "\f0\9f\bf\be" (func 110))
-  (export "\f0\9f\bf\bf" (func 111))
-  (export "\f0\af\bf\be" (func 112))
-  (export "\f0\af\bf\bf" (func 113))
-  (export "\f0\bf\bf\be" (func 114))
-  (export "\f0\bf\bf\bf" (func 115))
-  (export "\f1\8f\bf\be" (func 116))
-  (export "\f1\8f\bf\bf" (func 117))
-  (export "\f1\9f\bf\be" (func 118))
-  (export "\f1\9f\bf\bf" (func 119))
-  (export "\f1\af\bf\be" (func 120))
-  (export "\f1\af\bf\bf" (func 121))
-  (export "\f1\bf\bf\be" (func 122))
-  (export "\f1\bf\bf\bf" (func 123))
-  (export "\f2\8f\bf\be" (func 124))
-  (export "\f2\8f\bf\bf" (func 125))
-  (export "\f2\9f\bf\be" (func 126))
-  (export "\f2\9f\bf\bf" (func 127))
-  (export "\f2\af\bf\be" (func 128))
-  (export "\f2\af\bf\bf" (func 129))
-  (export "\f2\bf\bf\be" (func 130))
-  (export "\f2\bf\bf\bf" (func 131))
-  (export "\f3\8f\bf\be" (func 132))
-  (export "\f3\8f\bf\bf" (func 133))
-  (export "\f3\9f\bf\be" (func 134))
-  (export "\f3\9f\bf\bf" (func 135))
-  (export "\f3\af\bf\be" (func 136))
-  (export "\f3\af\bf\bf" (func 137))
-  (export "\f3\bf\bf\be" (func 138))
-  (export "\f3\bf\bf\bf" (func 139))
-  (export "\f4\8f\bf\be" (func 140))
-  (export "\f4\8f\bf\bf" (func 141))
-  (export "\cc\88\e2\80\bd\cc\88\cc\89" (func 142))
+  (export "\u{0}\u{1}\u{2}\u{3}\u{4}\u{5}\u{6}\u{7}\u{8}\u{9}\u{a}\u{b}\u{c}\u{d}\u{e}\u{f}" (func 22))
+  (export "\u{10}\u{11}\u{12}\u{13}\u{14}\u{15}\u{16}\u{17}\u{18}\u{19}\u{1a}\u{1b}\u{1c}\u{1d}\u{1e}\u{1f}" (func 23))
+  (export " \u{7f}" (func 24))
+  (export "\u{80}\u{81}\u{82}\u{83}\u{84}\u{85}\u{86}\u{87}\u{88}\u{89}\u{8a}\u{8b}\u{8c}\u{8d}\u{8e}\u{8f}" (func 25))
+  (export "\u{90}\u{91}\u{92}\u{93}\u{94}\u{95}\u{96}\u{97}\u{98}\u{99}\u{9a}\u{9b}\u{9c}\u{9d}\u{9e}\u{9f}" (func 26))
+  (export "\u{fff0}\u{fff1}\u{fff2}\u{fff3}\u{fff4}\u{fff5}\u{fff6}\u{fff7}" (func 27))
+  (export "\u{fff8}\u{fff9}\u{fffa}\u{fffb}\u{fffc}\u{fffd}\u{fffe}\u{ffff}" (func 28))
+  (export "\u{2400}\u{2401}\u{2402}\u{2403}\u{2404}\u{2405}\u{2406}\u{2407}\u{2408}\u{2409}\u{240a}\u{240b}\u{240c}\u{240d}\u{240e}\u{240f}" (func 29))
+  (export "\u{2410}\u{2411}\u{2412}\u{2413}\u{2414}\u{2415}\u{2416}\u{2417}\u{2418}\u{2419}\u{241a}\u{241b}\u{241c}\u{241d}\u{241e}\u{241f}" (func 30))
+  (export "\u{2420}\u{2421}" (func 31))
+  (export "\u{fff0}\u{fff1}\u{fff2}\u{fff3}\u{fff4}\u{fff5}\u{fff6}\u{fff7}\u{fff8}\u{fff9}\u{fffa}\u{fffb}\u{fffc}\u{fffd}" (func 32))
+  (export "\u{200d}" (func 33))
+  (export "\u{200c}" (func 34))
+  (export "\u{34f}" (func 35))
+  (export "\u{2060}" (func 36))
+  (export "\u{2d7f}" (func 37))
+  (export "\u{1107f}" (func 38))
+  (export "\u{180e}" (func 39))
+  (export "\u{ffef}\u{200b}\u{a0}\u{ad}\u{2060}\u{1680}\u{202e}\u{202d}" (func 40))
+  (export "\u{200e}\u{200f}\u{2011}\u{2028}\u{2029}\u{202a}\u{202b}\u{202c}\u{202f}\u{2066}\u{2067}\u{2068}\u{2069}" (func 41))
+  (export "\u{206a}\u{206b}\u{206c}\u{206d}\u{206e}\u{206f}" (func 42))
+  (export "\u{2061}\u{2062}\u{2063}\u{2064}" (func 43))
+  (export "\u{10000}\u{dffff}\u{10ffff}" (func 44))
+  (export "Z\u{30f}\u{346}\u{306}\u{35b}\u{34c}\u{334}\u{358}\u{35e}\u{347}\u{32b}\u{325}\u{32a}\u{353}\u{348}\u{354}\u{34e}\u{317}\u{31e}\u{33a}\u{32f}\u{331}\u{31e}\u{319}\u{331}\u{31c}\u{316}\u{320}a\u{357}\u{368}\u{30e}\u{304}\u{306}\u{357}\u{33f}\u{361}\u{35f}\u{340}\u{336}\u{341}\u{325}\u{330}\u{333}\u{32d}\u{359}\u{332}\u{331}\u{339}\u{31d}\u{34e}\u{33c}l\u{344}\u{34a}\u{31a}\u{357}\u{366}\u{344}\u{36b}\u{307}\u{341}\u{336}\u{337}\u{349}\u{329}\u{339}\u{32b}\u{31d}\u{356}\u{345}\u{319}\u{332}\u{33c}\u{347}\u{35a}\u{34d}\u{32e}\u{34e}\u{325}\u{345}\u{31e}g\u{343}\u{310}\u{305}\u{36e}\u{314}\u{310}\u{30e}\u{302}\u{30f}\u{33e}\u{34a}\u{30d}\u{34b}\u{34a}\u{367}\u{301}\u{306}\u{366}\u{35e}\u{336}\u{355}\u{354}\u{35a}\u{329}o\u{34b}\u{314}\u{350}\u{36a}\u{369}\u{321}\u{34f}\u{322}\u{327}\u{341}\u{32b}\u{319}\u{324}\u{32e}\u{356}\u{359}\u{353}\u{33a}\u{31c}\u{329}\u{33c}\u{318}\u{320}" (func 45))
+  (export "\u{115f}\u{1160}\u{3164}\u{ffa0}" (func 46))
+  (export "\u{fe00}" (func 47))
+  (export "\u{fe04}" (func 48))
+  (export "\u{e0100}" (func 49))
+  (export "\u{e01ef}" (func 50))
+  (export "\u{308}" (func 51))
+  (export "\u{a}" (func 52))
+  (export "\u{2424}" (func 53))
+  (export "\u{2028}" (func 54))
+  (export "\u{d}" (func 55))
+  (export "\u{d}\u{a}" (func 56))
+  (export "\u{a}\u{d}" (func 57))
+  (export "\u{1e}" (func 58))
+  (export "\u{b}" (func 59))
+  (export "\u{c}" (func 60))
+  (export "\u{85}" (func 61))
+  (export "\u{2029}" (func 62))
+  (export "\u{2026}" (func 63))
+  (export "\u{23ce}" (func 64))
+  (export "\u{8b}" (func 65))
+  (export "\u{8c}" (func 66))
+  (export "\u{8d}" (func 67))
+  (export "\u{21b5}" (func 68))
+  (export "\u{21a9}" (func 69))
+  (export "\u{2324}" (func 70))
+  (export "\u{2936}" (func 71))
+  (export "\u{21b2}" (func 72))
+  (export "\u{2ba8}" (func 73))
+  (export "\u{2bb0}" (func 74))
+  (export "\u{fffd}" (func 75))
+  (export "\u{fdd0}" (func 76))
+  (export "\u{fdd1}" (func 77))
+  (export "\u{fdd2}" (func 78))
+  (export "\u{fdd3}" (func 79))
+  (export "\u{fdd4}" (func 80))
+  (export "\u{fdd5}" (func 81))
+  (export "\u{fdd6}" (func 82))
+  (export "\u{fdd7}" (func 83))
+  (export "\u{fdd8}" (func 84))
+  (export "\u{fdd9}" (func 85))
+  (export "\u{fdda}" (func 86))
+  (export "\u{fddb}" (func 87))
+  (export "\u{fddc}" (func 88))
+  (export "\u{fddd}" (func 89))
+  (export "\u{fdde}" (func 90))
+  (export "\u{fddf}" (func 91))
+  (export "\u{fde0}" (func 92))
+  (export "\u{fde1}" (func 93))
+  (export "\u{fde2}" (func 94))
+  (export "\u{fde3}" (func 95))
+  (export "\u{fde4}" (func 96))
+  (export "\u{fde5}" (func 97))
+  (export "\u{fde6}" (func 98))
+  (export "\u{fde7}" (func 99))
+  (export "\u{fde8}" (func 100))
+  (export "\u{fde9}" (func 101))
+  (export "\u{fdea}" (func 102))
+  (export "\u{fdeb}" (func 103))
+  (export "\u{fdec}" (func 104))
+  (export "\u{fded}" (func 105))
+  (export "\u{fdee}" (func 106))
+  (export "\u{fdef}" (func 107))
+  (export "\u{fffe}" (func 108))
+  (export "\u{ffff}" (func 109))
+  (export "\u{1fffe}" (func 110))
+  (export "\u{1ffff}" (func 111))
+  (export "\u{2fffe}" (func 112))
+  (export "\u{2ffff}" (func 113))
+  (export "\u{3fffe}" (func 114))
+  (export "\u{3ffff}" (func 115))
+  (export "\u{4fffe}" (func 116))
+  (export "\u{4ffff}" (func 117))
+  (export "\u{5fffe}" (func 118))
+  (export "\u{5ffff}" (func 119))
+  (export "\u{6fffe}" (func 120))
+  (export "\u{6ffff}" (func 121))
+  (export "\u{7fffe}" (func 122))
+  (export "\u{7ffff}" (func 123))
+  (export "\u{8fffe}" (func 124))
+  (export "\u{8ffff}" (func 125))
+  (export "\u{9fffe}" (func 126))
+  (export "\u{9ffff}" (func 127))
+  (export "\u{afffe}" (func 128))
+  (export "\u{affff}" (func 129))
+  (export "\u{bfffe}" (func 130))
+  (export "\u{bffff}" (func 131))
+  (export "\u{cfffe}" (func 132))
+  (export "\u{cffff}" (func 133))
+  (export "\u{dfffe}" (func 134))
+  (export "\u{dffff}" (func 135))
+  (export "\u{efffe}" (func 136))
+  (export "\u{effff}" (func 137))
+  (export "\u{ffffe}" (func 138))
+  (export "\u{fffff}" (func 139))
+  (export "\u{10fffe}" (func 140))
+  (export "\u{10ffff}" (func 141))
+  (export "\u{308}\u{203d}\u{308}\u{309}" (func 142))
   (export "abc" (func 143))
-  (export "\e2\80\adabc" (func 144))
-  (export "\e2\80\aecba" (func 145))
-  (export "\e2\80\adabc\e2\80\ae" (func 146))
-  (export "\e2\80\aecba\e2\80\ad" (func 147))
-  (export "\f0\9d\91\a8" (func 148))
-  (export "\f0\9d\90\b4" (func 149))
-  (export "\f0\9d\98\88" (func 150))
-  (export "\f0\9d\98\bc" (func 151))
-  (export "\f0\9d\90\80" (func 152))
-  (export "\f0\9d\93\90" (func 153))
-  (export "\f0\9d\95\ac" (func 154))
-  (export "\f0\9d\97\94" (func 155))
-  (export "\f0\9d\92\9c" (func 156))
-  (export "\f0\9d\94\84" (func 157))
-  (export "\f0\9d\94\b8" (func 158))
-  (export "\f0\9d\96\a0" (func 159))
-  (export "\f0\9d\99\b0" (func 160))
-  (export "\e1\b4\80" (func 161))
-  (export "\e1\b4\ac" (func 162))
-  (export "\e2\92\b6" (func 163))
-  (export "\ef\bc\a1" (func 164))
-  (export "\f0\9f\84\90" (func 165))
-  (export "\f0\9f\84\b0" (func 166))
-  (export "\f3\a0\81\81" (func 167))
+  (export "\u{202d}abc" (func 144))
+  (export "\u{202e}cba" (func 145))
+  (export "\u{202d}abc\u{202e}" (func 146))
+  (export "\u{202e}cba\u{202d}" (func 147))
+  (export "\u{1d468}" (func 148))
+  (export "\u{1d434}" (func 149))
+  (export "\u{1d608}" (func 150))
+  (export "\u{1d63c}" (func 151))
+  (export "\u{1d400}" (func 152))
+  (export "\u{1d4d0}" (func 153))
+  (export "\u{1d56c}" (func 154))
+  (export "\u{1d5d4}" (func 155))
+  (export "\u{1d49c}" (func 156))
+  (export "\u{1d504}" (func 157))
+  (export "\u{1d538}" (func 158))
+  (export "\u{1d5a0}" (func 159))
+  (export "\u{1d670}" (func 160))
+  (export "\u{1d00}" (func 161))
+  (export "\u{1d2c}" (func 162))
+  (export "\u{24b6}" (func 163))
+  (export "\u{ff21}" (func 164))
+  (export "\u{1f110}" (func 165))
+  (export "\u{1f130}" (func 166))
+  (export "\u{e0041}" (func 167))
   (export "U+0041" (func 168))
-  (export "A\e2\80\8b" (func 169))
-  (export "\d0\90" (func 170))
-  (export "\ea\99\96" (func 171))
-  (export "\e2\b7\bc" (func 172))
-  (export "\e2\b7\b6" (func 173))
-  (export "\e2\b1\af" (func 174))
-  (export "\f0\9f\85\90" (func 175))
-  (export "\f0\9f\85\b0" (func 176))
-  (export "\e2\b0\ad" (func 177))
-  (export "\f0\90\90\82" (func 178))
-  (export "\f0\90\90\88" (func 179))
-  (export "\f0\90\92\b0" (func 180))
-  (export "\c3\80" (func 181))
-  (export "\c3\81" (func 182))
-  (export "\c3\82" (func 183))
-  (export "\c3\83" (func 184))
-  (export "\c3\84" (func 185))
-  (export "\c4\80" (func 186))
-  (export "\c4\82" (func 187))
-  (export "\c4\84" (func 188))
-  (export "\c7\8d" (func 189))
-  (export "\c7\9e" (func 190))
-  (export "\c7\a0" (func 191))
-  (export "\c7\ba" (func 192))
-  (export "\c8\80" (func 193))
-  (export "\c8\82" (func 194))
-  (export "\c8\a6" (func 195))
-  (export "\c8\ba" (func 196))
-  (export "\d3\90" (func 197))
-  (export "\d3\92" (func 198))
-  (export "\df\8a" (func 199))
-  (export "\e0\a0\a1" (func 200))
-  (export "\e0\a0\a2" (func 201))
-  (export "\e0\a0\a3" (func 202))
-  (export "\e0\a0\a4" (func 203))
-  (export "\e0\a0\a5" (func 204))
-  (export "\e0\a4\84" (func 205))
-  (export "\e0\a4\85" (func 206))
-  (export "\e0\a5\b2" (func 207))
-  (export "\e0\a6\85" (func 208))
-  (export "\e0\a8\85" (func 209))
-  (export "\e0\aa\85" (func 210))
-  (export "\e0\ac\85" (func 211))
-  (export "\e0\ae\85" (func 212))
-  (export "\e0\b0\85" (func 213))
-  (export "\e0\b2\85" (func 214))
-  (export "\e0\b4\85" (func 215))
-  (export "\e0\b8\b0" (func 216))
-  (export "\e0\ba\b0" (func 217))
-  (export "\e0\bc\81" (func 218))
-  (export "\e0\bd\a8" (func 219))
-  (export "\e0\be\b8" (func 220))
-  (export "\e1\80\a1" (func 221))
-  (export "\e1\80\a2" (func 222))
-  (export "\e1\82\9c" (func 223))
-  (export "\e1\85\a1" (func 224))
-  (export "\e1\8a\a0" (func 225))
-  (export "\e1\8b\90" (func 226))
-  (export "\e1\8e\a0" (func 227))
-  (export "\e1\90\8a" (func 228))
-  (export "\e1\96\b3" (func 229))
-  (export "\e1\9a\a8" (func 230))
-  (export "\e1\9a\aa" (func 231))
-  (export "\e1\9b\86" (func 232))
-  (export "\e1\9c\80" (func 233))
-  (export "\e1\9c\a0" (func 234))
-  (export "\e1\9d\80" (func 235))
-  (export "\e1\9d\a0" (func 236))
-  (export "\e1\a0\a0" (func 237))
-  (export "\e1\a2\87" (func 238))
-  (export "\e1\a4\a0" (func 239))
-  (export "\e1\a5\a3" (func 240))
-  (export "\e1\a8\95" (func 241))
-  (export "\e1\a9\8b" (func 242))
-  (export "\e1\a9\a1" (func 243))
-  (export "\e1\ae\83" (func 244))
-  (export "\e1\af\80" (func 245))
-  (export "\e1\af\81" (func 246))
-  (export "\e1\b0\a3" (func 247))
-  (export "\e1\b8\80" (func 248))
-  (export "\e1\ba\a0" (func 249))
-  (export "\e1\ba\a2" (func 250))
-  (export "\e1\ba\a4" (func 251))
-  (export "\e1\ba\a6" (func 252))
-  (export "\e1\ba\a8" (func 253))
-  (export "\e1\ba\aa" (func 254))
-  (export "\e1\ba\ac" (func 255))
-  (export "\e1\ba\ae" (func 256))
-  (export "\e1\ba\b0" (func 257))
-  (export "\e1\ba\b2" (func 258))
-  (export "\e1\ba\b4" (func 259))
-  (export "\e1\ba\b6" (func 260))
-  (export "\e3\81\82" (func 261))
-  (export "\e3\82\a2" (func 262))
-  (export "\e3\84\9a" (func 263))
-  (export "\e3\85\8f" (func 264))
-  (export "\e3\88\8e" (func 265))
-  (export "\e3\88\8f" (func 266))
-  (export "\e3\88\90" (func 267))
-  (export "\e3\88\91" (func 268))
-  (export "\e3\88\92" (func 269))
-  (export "\e3\88\93" (func 270))
-  (export "\e3\88\94" (func 271))
-  (export "\e3\88\95" (func 272))
-  (export "\e3\88\96" (func 273))
-  (export "\e3\88\97" (func 274))
-  (export "\e3\88\98" (func 275))
-  (export "\e3\88\99" (func 276))
-  (export "\e3\88\9a" (func 277))
-  (export "\e3\88\9b" (func 278))
-  (export "\e3\89\ae" (func 279))
-  (export "\e3\89\af" (func 280))
-  (export "\e3\89\b0" (func 281))
-  (export "\e3\89\b1" (func 282))
-  (export "\e3\89\b2" (func 283))
-  (export "\e3\89\b3" (func 284))
-  (export "\e3\89\b4" (func 285))
-  (export "\e3\89\b5" (func 286))
-  (export "\e3\89\b6" (func 287))
-  (export "\e3\89\b7" (func 288))
-  (export "\e3\89\b8" (func 289))
-  (export "\e3\89\b9" (func 290))
-  (export "\e3\89\ba" (func 291))
-  (export "\e3\89\bb" (func 292))
-  (export "\e3\8b\90" (func 293))
-  (export "\ea\80\8a" (func 294))
-  (export "\ea\93\ae" (func 295))
-  (export "\ea\95\89" (func 296))
-  (export "\ea\9a\a0" (func 297))
-  (export "\ea\a0\80" (func 298))
-  (export "\ea\a0\a3" (func 299))
-  (export "\ea\a1\9d" (func 300))
-  (export "\ea\a2\82" (func 301))
-  (export "\ea\a3\aa" (func 302))
-  (export "\ea\a4\a2" (func 303))
-  (export "\ea\a5\86" (func 304))
-  (export "\ea\a6\84" (func 305))
-  (export "\ea\a8\80" (func 306))
-  (export "\ef\bd\b1" (func 307))
-  (export "\ef\bf\82" (func 308))
-  (export "\f0\90\80\80" (func 309))
-  (export "\f0\90\8a\80" (func 310))
-  (export "\f0\90\8a\a0" (func 311))
-  (export "\f0\90\8c\80" (func 312))
-  (export "\f0\90\8e\a0" (func 313))
-  (export "\f0\90\92\96" (func 314))
-  (export "\f0\90\94\80" (func 315))
-  (export "\f0\90\9d\80" (func 316))
-  (export "\f0\90\a0\80" (func 317))
-  (export "\f0\90\a4\a0" (func 318))
-  (export "\f0\90\a6\80" (func 319))
-  (export "\f0\90\a6\a0" (func 320))
-  (export "\f0\90\a8\80" (func 321))
-  (export "\f0\90\ac\80" (func 322))
-  (export "\f0\90\b0\80" (func 323))
-  (export "\f0\90\b0\81" (func 324))
-  (export "\f0\90\b2\80" (func 325))
-  (export "\f0\91\80\85" (func 326))
-  (export "\f0\91\82\83" (func 327))
-  (export "\f0\91\84\a7" (func 328))
-  (export "\f0\91\85\90" (func 329))
-  (export "\f0\91\86\83" (func 330))
-  (export "\f0\91\88\80" (func 331))
-  (export "\f0\91\8a\80" (func 332))
-  (export "\f0\91\8a\b0" (func 333))
-  (export "\f0\91\8c\85" (func 334))
-  (export "\f0\91\8d\b0" (func 335))
-  (export "\f0\91\90\80" (func 336))
-  (export "\f0\91\92\81" (func 337))
-  (export "\f0\91\96\80" (func 338))
-  (export "\f0\91\98\80" (func 339))
-  (export "\f0\91\9a\80" (func 340))
-  (export "\f0\91\9c\92" (func 341))
-  (export "\f0\91\9c\a0" (func 342))
-  (export "\f0\91\a2\a1" (func 343))
-  (export "\f0\91\ab\95" (func 344))
-  (export "\f0\91\b0\80" (func 345))
-  (export "\f0\91\b2\8f" (func 346))
-  (export "\f0\91\b2\af" (func 347))
-  (export "\f0\92\80\80" (func 348))
-  (export "\f0\96\a7\95" (func 349))
-  (export "\f0\96\a9\86" (func 350))
-  (export "\f0\96\ab\a7" (func 351))
-  (export "\f0\96\bd\94" (func 352))
-  (export "\f0\9b\b1\81" (func 353))
-  (export "\f0\9b\b1\a4" (func 354))
-  (export "\f0\9e\a0\a3" (func 355))
-  (export "\f0\9f\87\a6" (func 356))
-  (export "\e2\b1\ad" (func 357))
-  (export "\ce\9b" (func 358))
-  (export "\e2\b1\b0" (func 359))
-  (export "\c2\aa" (func 360))
-  (export "\e2\88\80" (func 361))
-  (export "\e2\82\b3" (func 362))
-  (export "\f0\90\a4\80" (func 363))
-  (export "\e2\b2\80" (func 364))
-  (export "\f0\90\8c\b0" (func 365))
-  (export "\ce\86" (func 366))
-  (export "\ce\91" (func 367))
-  (export "\e1\bc\88" (func 368))
-  (export "\e1\bc\89" (func 369))
-  (export "\e1\bc\8a" (func 370))
-  (export "\e1\bc\8b" (func 371))
-  (export "\e1\bc\8c" (func 372))
-  (export "\e1\bc\8d" (func 373))
-  (export "\e1\bc\8e" (func 374))
-  (export "\e1\bc\8f" (func 375))
-  (export "\e1\be\88" (func 376))
-  (export "\e1\be\89" (func 377))
-  (export "\e1\be\8a" (func 378))
-  (export "\e1\be\8b" (func 379))
-  (export "\e1\be\8c" (func 380))
-  (export "\e1\be\8d" (func 381))
-  (export "\e1\be\8e" (func 382))
-  (export "\e1\be\8f" (func 383))
-  (export "\e1\be\b8" (func 384))
-  (export "\e1\be\b9" (func 385))
-  (export "\e1\be\ba" (func 386))
-  (export "\e1\be\bb" (func 387))
-  (export "\e1\be\bc" (func 388))
-  (export "\f0\9d\9a\a8" (func 389))
-  (export "\f0\9d\9b\a2" (func 390))
-  (export "\f0\9d\9c\9c" (func 391))
-  (export "\f0\9d\9d\96" (func 392))
-  (export "\f0\9d\9e\90" (func 393))
-  (export "\e2\8d\b6" (func 394))
-  (export "\e2\8d\ba" (func 395))
-  (export "\e2\a9\9c" (func 396))
-  (export "\e1\97\85" (func 397))
-  (export "\e1\8e\aa" (func 398))
-  (export ")\cb\ba\cb\bc\f0\94\97\8f\f0\9d\85\b4\f0\9d\85\b6\f0\9d\85\b8\f0\9d\85\ba\e2\81\be\e2\82\8e\e2\9d\a9\e2\9d\ab\e2\9f\af\ef\b4\bf\ef\b8\b6\ef\b9\9a\ef\bc\89\ef\bd\a0\f3\a0\80\a9\e2\9d\b3\e2\9d\b5\e2\9f\a7\e2\9f\a9\e2\9f\ab\e2\9f\ad\e2\a6\88\e2\a6\8a\e2\a6\96\e2\b8\a3\e2\b8\a5\ef\b8\98\ef\b8\b8\ef\b8\ba\ef\b8\bc\ef\b8\be\ef\b9\80\ef\b9\82\ef\b9\84\ef\b9\88\ef\b9\9c\ef\b9\9e\ef\bc\bd\ef\bd\9d\ef\bd\a3\f3\a0\81\9d\f3\a0\81\bd\c2\bb\e2\80\99\e2\80\9d\e2\80\ba\e2\9d\af" (func 399))
-  (export "(\cb\b9\cb\bb\f0\94\97\8e\f0\9d\85\b3\f0\9d\85\b5\f0\9d\85\b7\f0\9d\85\b9\e2\81\bd\e2\82\8d\e2\9d\a8\e2\9d\aa\e2\9f\ae\ef\b4\be\ef\b8\b5\ef\b9\99\ef\bc\88\ef\bd\9f\f3\a0\80\a8\e2\9d\b2\e2\9d\b4\e2\9f\a6\e2\9f\a8\e2\9f\aa\e2\9f\ac\e2\a6\87\e2\a6\89\e2\a6\95\e2\b8\a2\e2\b8\a4\ef\b8\97\ef\b8\b7\ef\b8\b9\ef\b8\bb\ef\b8\bd\ef\b8\bf\ef\b9\81\ef\b9\83\ef\b9\87\ef\b9\9b\ef\b9\9d\ef\bc\bb\ef\bd\9b\ef\bd\a2\f3\a0\81\9b\f3\a0\81\bb\c2\ab\e2\80\98\e2\80\9c\e2\80\b9\e2\9d\ae" (func 400))
-  (export "\f0\9d\aa\8b\f0\9d\aa\a4" (func 401))
-  (export "\f0\9d\aa\8b" (func 402))
-  (export "\c2\bd" (func 403))
-  (export "1\e2\81\842" (func 404))
+  (export "A\u{200b}" (func 169))
+  (export "\u{410}" (func 170))
+  (export "\u{a656}" (func 171))
+  (export "\u{2dfc}" (func 172))
+  (export "\u{2df6}" (func 173))
+  (export "\u{2c6f}" (func 174))
+  (export "\u{1f150}" (func 175))
+  (export "\u{1f170}" (func 176))
+  (export "\u{2c2d}" (func 177))
+  (export "\u{10402}" (func 178))
+  (export "\u{10408}" (func 179))
+  (export "\u{104b0}" (func 180))
+  (export "\u{c0}" (func 181))
+  (export "\u{c1}" (func 182))
+  (export "\u{c2}" (func 183))
+  (export "\u{c3}" (func 184))
+  (export "\u{c4}" (func 185))
+  (export "\u{100}" (func 186))
+  (export "\u{102}" (func 187))
+  (export "\u{104}" (func 188))
+  (export "\u{1cd}" (func 189))
+  (export "\u{1de}" (func 190))
+  (export "\u{1e0}" (func 191))
+  (export "\u{1fa}" (func 192))
+  (export "\u{200}" (func 193))
+  (export "\u{202}" (func 194))
+  (export "\u{226}" (func 195))
+  (export "\u{23a}" (func 196))
+  (export "\u{4d0}" (func 197))
+  (export "\u{4d2}" (func 198))
+  (export "\u{7ca}" (func 199))
+  (export "\u{821}" (func 200))
+  (export "\u{822}" (func 201))
+  (export "\u{823}" (func 202))
+  (export "\u{824}" (func 203))
+  (export "\u{825}" (func 204))
+  (export "\u{904}" (func 205))
+  (export "\u{905}" (func 206))
+  (export "\u{972}" (func 207))
+  (export "\u{985}" (func 208))
+  (export "\u{a05}" (func 209))
+  (export "\u{a85}" (func 210))
+  (export "\u{b05}" (func 211))
+  (export "\u{b85}" (func 212))
+  (export "\u{c05}" (func 213))
+  (export "\u{c85}" (func 214))
+  (export "\u{d05}" (func 215))
+  (export "\u{e30}" (func 216))
+  (export "\u{eb0}" (func 217))
+  (export "\u{f01}" (func 218))
+  (export "\u{f68}" (func 219))
+  (export "\u{fb8}" (func 220))
+  (export "\u{1021}" (func 221))
+  (export "\u{1022}" (func 222))
+  (export "\u{109c}" (func 223))
+  (export "\u{1161}" (func 224))
+  (export "\u{12a0}" (func 225))
+  (export "\u{12d0}" (func 226))
+  (export "\u{13a0}" (func 227))
+  (export "\u{140a}" (func 228))
+  (export "\u{15b3}" (func 229))
+  (export "\u{16a8}" (func 230))
+  (export "\u{16aa}" (func 231))
+  (export "\u{16c6}" (func 232))
+  (export "\u{1700}" (func 233))
+  (export "\u{1720}" (func 234))
+  (export "\u{1740}" (func 235))
+  (export "\u{1760}" (func 236))
+  (export "\u{1820}" (func 237))
+  (export "\u{1887}" (func 238))
+  (export "\u{1920}" (func 239))
+  (export "\u{1963}" (func 240))
+  (export "\u{1a15}" (func 241))
+  (export "\u{1a4b}" (func 242))
+  (export "\u{1a61}" (func 243))
+  (export "\u{1b83}" (func 244))
+  (export "\u{1bc0}" (func 245))
+  (export "\u{1bc1}" (func 246))
+  (export "\u{1c23}" (func 247))
+  (export "\u{1e00}" (func 248))
+  (export "\u{1ea0}" (func 249))
+  (export "\u{1ea2}" (func 250))
+  (export "\u{1ea4}" (func 251))
+  (export "\u{1ea6}" (func 252))
+  (export "\u{1ea8}" (func 253))
+  (export "\u{1eaa}" (func 254))
+  (export "\u{1eac}" (func 255))
+  (export "\u{1eae}" (func 256))
+  (export "\u{1eb0}" (func 257))
+  (export "\u{1eb2}" (func 258))
+  (export "\u{1eb4}" (func 259))
+  (export "\u{1eb6}" (func 260))
+  (export "\u{3042}" (func 261))
+  (export "\u{30a2}" (func 262))
+  (export "\u{311a}" (func 263))
+  (export "\u{314f}" (func 264))
+  (export "\u{320e}" (func 265))
+  (export "\u{320f}" (func 266))
+  (export "\u{3210}" (func 267))
+  (export "\u{3211}" (func 268))
+  (export "\u{3212}" (func 269))
+  (export "\u{3213}" (func 270))
+  (export "\u{3214}" (func 271))
+  (export "\u{3215}" (func 272))
+  (export "\u{3216}" (func 273))
+  (export "\u{3217}" (func 274))
+  (export "\u{3218}" (func 275))
+  (export "\u{3219}" (func 276))
+  (export "\u{321a}" (func 277))
+  (export "\u{321b}" (func 278))
+  (export "\u{326e}" (func 279))
+  (export "\u{326f}" (func 280))
+  (export "\u{3270}" (func 281))
+  (export "\u{3271}" (func 282))
+  (export "\u{3272}" (func 283))
+  (export "\u{3273}" (func 284))
+  (export "\u{3274}" (func 285))
+  (export "\u{3275}" (func 286))
+  (export "\u{3276}" (func 287))
+  (export "\u{3277}" (func 288))
+  (export "\u{3278}" (func 289))
+  (export "\u{3279}" (func 290))
+  (export "\u{327a}" (func 291))
+  (export "\u{327b}" (func 292))
+  (export "\u{32d0}" (func 293))
+  (export "\u{a00a}" (func 294))
+  (export "\u{a4ee}" (func 295))
+  (export "\u{a549}" (func 296))
+  (export "\u{a6a0}" (func 297))
+  (export "\u{a800}" (func 298))
+  (export "\u{a823}" (func 299))
+  (export "\u{a85d}" (func 300))
+  (export "\u{a882}" (func 301))
+  (export "\u{a8ea}" (func 302))
+  (export "\u{a922}" (func 303))
+  (export "\u{a946}" (func 304))
+  (export "\u{a984}" (func 305))
+  (export "\u{aa00}" (func 306))
+  (export "\u{ff71}" (func 307))
+  (export "\u{ffc2}" (func 308))
+  (export "\u{10000}" (func 309))
+  (export "\u{10280}" (func 310))
+  (export "\u{102a0}" (func 311))
+  (export "\u{10300}" (func 312))
+  (export "\u{103a0}" (func 313))
+  (export "\u{10496}" (func 314))
+  (export "\u{10500}" (func 315))
+  (export "\u{10740}" (func 316))
+  (export "\u{10800}" (func 317))
+  (export "\u{10920}" (func 318))
+  (export "\u{10980}" (func 319))
+  (export "\u{109a0}" (func 320))
+  (export "\u{10a00}" (func 321))
+  (export "\u{10b00}" (func 322))
+  (export "\u{10c00}" (func 323))
+  (export "\u{10c01}" (func 324))
+  (export "\u{10c80}" (func 325))
+  (export "\u{11005}" (func 326))
+  (export "\u{11083}" (func 327))
+  (export "\u{11127}" (func 328))
+  (export "\u{11150}" (func 329))
+  (export "\u{11183}" (func 330))
+  (export "\u{11200}" (func 331))
+  (export "\u{11280}" (func 332))
+  (export "\u{112b0}" (func 333))
+  (export "\u{11305}" (func 334))
+  (export "\u{11370}" (func 335))
+  (export "\u{11400}" (func 336))
+  (export "\u{11481}" (func 337))
+  (export "\u{11580}" (func 338))
+  (export "\u{11600}" (func 339))
+  (export "\u{11680}" (func 340))
+  (export "\u{11712}" (func 341))
+  (export "\u{11720}" (func 342))
+  (export "\u{118a1}" (func 343))
+  (export "\u{11ad5}" (func 344))
+  (export "\u{11c00}" (func 345))
+  (export "\u{11c8f}" (func 346))
+  (export "\u{11caf}" (func 347))
+  (export "\u{12000}" (func 348))
+  (export "\u{169d5}" (func 349))
+  (export "\u{16a46}" (func 350))
+  (export "\u{16ae7}" (func 351))
+  (export "\u{16f54}" (func 352))
+  (export "\u{1bc41}" (func 353))
+  (export "\u{1bc64}" (func 354))
+  (export "\u{1e823}" (func 355))
+  (export "\u{1f1e6}" (func 356))
+  (export "\u{2c6d}" (func 357))
+  (export "\u{39b}" (func 358))
+  (export "\u{2c70}" (func 359))
+  (export "\u{aa}" (func 360))
+  (export "\u{2200}" (func 361))
+  (export "\u{20b3}" (func 362))
+  (export "\u{10900}" (func 363))
+  (export "\u{2c80}" (func 364))
+  (export "\u{10330}" (func 365))
+  (export "\u{386}" (func 366))
+  (export "\u{391}" (func 367))
+  (export "\u{1f08}" (func 368))
+  (export "\u{1f09}" (func 369))
+  (export "\u{1f0a}" (func 370))
+  (export "\u{1f0b}" (func 371))
+  (export "\u{1f0c}" (func 372))
+  (export "\u{1f0d}" (func 373))
+  (export "\u{1f0e}" (func 374))
+  (export "\u{1f0f}" (func 375))
+  (export "\u{1f88}" (func 376))
+  (export "\u{1f89}" (func 377))
+  (export "\u{1f8a}" (func 378))
+  (export "\u{1f8b}" (func 379))
+  (export "\u{1f8c}" (func 380))
+  (export "\u{1f8d}" (func 381))
+  (export "\u{1f8e}" (func 382))
+  (export "\u{1f8f}" (func 383))
+  (export "\u{1fb8}" (func 384))
+  (export "\u{1fb9}" (func 385))
+  (export "\u{1fba}" (func 386))
+  (export "\u{1fbb}" (func 387))
+  (export "\u{1fbc}" (func 388))
+  (export "\u{1d6a8}" (func 389))
+  (export "\u{1d6e2}" (func 390))
+  (export "\u{1d71c}" (func 391))
+  (export "\u{1d756}" (func 392))
+  (export "\u{1d790}" (func 393))
+  (export "\u{2376}" (func 394))
+  (export "\u{237a}" (func 395))
+  (export "\u{2a5c}" (func 396))
+  (export "\u{15c5}" (func 397))
+  (export "\u{13aa}" (func 398))
+  (export ")\u{2fa}\u{2fc}\u{145cf}\u{1d174}\u{1d176}\u{1d178}\u{1d17a}\u{207e}\u{208e}\u{2769}\u{276b}\u{27ef}\u{fd3f}\u{fe36}\u{fe5a}\u{ff09}\u{ff60}\u{e0029}\u{2773}\u{2775}\u{27e7}\u{27e9}\u{27eb}\u{27ed}\u{2988}\u{298a}\u{2996}\u{2e23}\u{2e25}\u{fe18}\u{fe38}\u{fe3a}\u{fe3c}\u{fe3e}\u{fe40}\u{fe42}\u{fe44}\u{fe48}\u{fe5c}\u{fe5e}\u{ff3d}\u{ff5d}\u{ff63}\u{e005d}\u{e007d}\u{bb}\u{2019}\u{201d}\u{203a}\u{276f}" (func 399))
+  (export "(\u{2f9}\u{2fb}\u{145ce}\u{1d173}\u{1d175}\u{1d177}\u{1d179}\u{207d}\u{208d}\u{2768}\u{276a}\u{27ee}\u{fd3e}\u{fe35}\u{fe59}\u{ff08}\u{ff5f}\u{e0028}\u{2772}\u{2774}\u{27e6}\u{27e8}\u{27ea}\u{27ec}\u{2987}\u{2989}\u{2995}\u{2e22}\u{2e24}\u{fe17}\u{fe37}\u{fe39}\u{fe3b}\u{fe3d}\u{fe3f}\u{fe41}\u{fe43}\u{fe47}\u{fe5b}\u{fe5d}\u{ff3b}\u{ff5b}\u{ff62}\u{e005b}\u{e007b}\u{ab}\u{2018}\u{201c}\u{2039}\u{276e}" (func 400))
+  (export "\u{1da8b}\u{1daa4}" (func 401))
+  (export "\u{1da8b}" (func 402))
+  (export "\u{bd}" (func 403))
+  (export "1\u{2044}2" (func 404))
   (export "1/2" (func 405))
-  (export "\e0\ad\b3" (func 406))
-  (export "\e0\b5\b4" (func 407))
-  (export "\e2\b3\bd" (func 408))
-  (export "\ea\a0\b1" (func 409))
-  (export "\f0\90\85\81" (func 410))
-  (export "\f0\90\85\b5" (func 411))
-  (export "\f0\90\85\b6" (func 412))
-  (export "\f0\90\a6\bd" (func 413))
-  (export "\f0\90\b9\bb" (func 414))
-  (export "\ef\bc\82" (func 415))
-  (export "\7f" (func 416))
-  (export "\08" (func 417))
-  (export "\e2\8c\ab" (func 418))
-  (export "\e2\8c\a6" (func 419))
-  (export "\e2\90\88" (func 420))
-  (export "\e2\90\a1" (func 421))
-  (export "\e1\b7\bb" (func 422))
-  (export "\0f" (func 423))
-  (export "\e2\86\90" (func 424))
-  (export "\e2\8c\a7" (func 425))
-  (export "\e2\8d\92" (func 426))
-  (export "\e2\8d\94" (func 427))
-  (export "\e2\8d\a2" (func 428))
-  (export "\e2\8d\ab" (func 429))
-  (export "\1a" (func 430))
-  (export "\e2\90\a6" (func 431))
-  (export "\e2\90\9a" (func 432))
-  (export "\ef\bf\bc" (func 433))
+  (export "\u{b73}" (func 406))
+  (export "\u{d74}" (func 407))
+  (export "\u{2cfd}" (func 408))
+  (export "\u{a831}" (func 409))
+  (export "\u{10141}" (func 410))
+  (export "\u{10175}" (func 411))
+  (export "\u{10176}" (func 412))
+  (export "\u{109bd}" (func 413))
+  (export "\u{10e7b}" (func 414))
+  (export "\u{ff02}" (func 415))
+  (export "\u{7f}" (func 416))
+  (export "\u{8}" (func 417))
+  (export "\u{232b}" (func 418))
+  (export "\u{2326}" (func 419))
+  (export "\u{2408}" (func 420))
+  (export "\u{2421}" (func 421))
+  (export "\u{1dfb}" (func 422))
+  (export "\u{f}" (func 423))
+  (export "\u{2190}" (func 424))
+  (export "\u{2327}" (func 425))
+  (export "\u{2352}" (func 426))
+  (export "\u{2354}" (func 427))
+  (export "\u{2362}" (func 428))
+  (export "\u{236b}" (func 429))
+  (export "\u{1a}" (func 430))
+  (export "\u{2426}" (func 431))
+  (export "\u{241a}" (func 432))
+  (export "\u{fffc}" (func 433))
   (export "?" (func 434))
-  (export "\c2\bf" (func 435))
-  (export "\e1\a5\85" (func 436))
-  (export "\cd\be" (func 437))
-  (export "\d5\9e" (func 438))
-  (export "\d8\9f" (func 439))
-  (export "\e1\8d\a7" (func 440))
-  (export "\e2\81\87" (func 441))
-  (export "\e2\8d\b0" (func 442))
-  (export "\e2\9d\93" (func 443))
-  (export "\e2\9d\94" (func 444))
-  (export "\e2\b3\ba" (func 445))
-  (export "\e2\b3\bb" (func 446))
-  (export "\e2\b8\ae" (func 447))
-  (export "\e3\89\84" (func 448))
-  (export "\ea\98\8f" (func 449))
-  (export "\ea\9b\b7" (func 450))
-  (export "\ef\b8\96" (func 451))
-  (export "\ef\b9\96" (func 452))
-  (export "\ef\bc\9f" (func 453))
-  (export "\f0\91\85\83" (func 454))
-  (export "\f0\9e\a5\9f" (func 455))
-  (export "\f3\a0\80\bf" (func 456))
-  (export "\f0\96\a1\84" (func 457))
-  (export "\e2\af\91" (func 458))
-  (export "\c2\b6" (func 459))
-  (export "\e2\81\8b" (func 460))
-  (export "\dc\80" (func 461))
-  (export "\e1\83\bb" (func 462))
-  (export "\e1\8d\a8" (func 463))
-  (export "\e3\80\b7" (func 464))
-  (export "\e2\9d\a1" (func 465))
-  (export "\e2\b8\8f" (func 466))
-  (export "\e2\b8\90" (func 467))
-  (export "\e2\b8\91" (func 468))
-  (export "\e2\b8\8e" (func 469))
-  (export "\14" (func 470))
-  (export "\e2\98\99" (func 471))
-  (export "\e2\b8\bf" (func 472))
-  (export "\e3\80\87" (func 473))
-  (export "\e0\b9\9b" (func 474))
-  (export "\ea\99\ae" (func 475))
-  (export "\cf\93" (func 476))
-  (export "\cf\94" (func 477))
-  (export "\e1\ba\9b" (func 478))
+  (export "\u{bf}" (func 435))
+  (export "\u{1945}" (func 436))
+  (export "\u{37e}" (func 437))
+  (export "\u{55e}" (func 438))
+  (export "\u{61f}" (func 439))
+  (export "\u{1367}" (func 440))
+  (export "\u{2047}" (func 441))
+  (export "\u{2370}" (func 442))
+  (export "\u{2753}" (func 443))
+  (export "\u{2754}" (func 444))
+  (export "\u{2cfa}" (func 445))
+  (export "\u{2cfb}" (func 446))
+  (export "\u{2e2e}" (func 447))
+  (export "\u{3244}" (func 448))
+  (export "\u{a60f}" (func 449))
+  (export "\u{a6f7}" (func 450))
+  (export "\u{fe16}" (func 451))
+  (export "\u{fe56}" (func 452))
+  (export "\u{ff1f}" (func 453))
+  (export "\u{11143}" (func 454))
+  (export "\u{1e95f}" (func 455))
+  (export "\u{e003f}" (func 456))
+  (export "\u{16844}" (func 457))
+  (export "\u{2bd1}" (func 458))
+  (export "\u{b6}" (func 459))
+  (export "\u{204b}" (func 460))
+  (export "\u{700}" (func 461))
+  (export "\u{10fb}" (func 462))
+  (export "\u{1368}" (func 463))
+  (export "\u{3037}" (func 464))
+  (export "\u{2761}" (func 465))
+  (export "\u{2e0f}" (func 466))
+  (export "\u{2e10}" (func 467))
+  (export "\u{2e11}" (func 468))
+  (export "\u{2e0e}" (func 469))
+  (export "\u{14}" (func 470))
+  (export "\u{2619}" (func 471))
+  (export "\u{2e3f}" (func 472))
+  (export "\u{3007}" (func 473))
+  (export "\u{e5b}" (func 474))
+  (export "\u{a66e}" (func 475))
+  (export "\u{3d3}" (func 476))
+  (export "\u{3d4}" (func 477))
+  (export "\u{1e9b}" (func 478))
 )
diff --git a/tests/snapshots/testsuite/proposals/annotations/id.wast/0.print b/tests/snapshots/testsuite/proposals/annotations/id.wast/0.print
index 4ef0bab6..fbd64f61 100644
--- a/tests/snapshots/testsuite/proposals/annotations/id.wast/0.print
+++ b/tests/snapshots/testsuite/proposals/annotations/id.wast/0.print
@@ -12,13 +12,13 @@
   (func (;5;) (type 0)
     call $!?@#a$%^&*b-+_.:9'`|/\<=>~
   )
-  (func $#func6<_random_____stuff_> (@name " random \t \n stuff ") (;6;) (type 0))
+  (func $" random \u{9} \u{a} stuff " (;6;) (type 0))
   (func (;7;) (type 0)
-    call $#func6<_random_____stuff_>
+    call $" random \u{9} \u{a} stuff "
   )
-  (func $#func8<___> (@name " ") (;8;) (type 0))
+  (func $" \u{f61a}\u{f4a9}" (;8;) (type 0))
   (func (;9;) (type 0)
-    call $#func8<___>
+    call $" \u{f61a}\u{f4a9}"
   )
   (func $fh (;10;) (type 0))
   (func (;11;) (type 0)
@@ -39,15 +39,15 @@
     call $AB
     call $AB
   )
-  (func $#func18<_> (@name "\t") (;18;) (type 0))
+  (func $"\u{9}" (;18;) (type 0))
   (func (;19;) (type 0)
-    call $#func18<_>
-    call $#func18<_>
+    call $"\u{9}"
+    call $"\u{9}"
   )
-  (func $#func20<__> (@name "") (;20;) (type 0))
+  (func $"\u{f61a}\u{f4a9}" (;20;) (type 0))
   (func (;21;) (type 0)
-    call $#func20<__>
-    call $#func20<__>
+    call $"\u{f61a}\u{f4a9}"
+    call $"\u{f61a}\u{f4a9}"
   )
   (func (;22;) (type 0)
     block $l1
@@ -64,11 +64,11 @@
     else
     end
     i32.const 0
-    if $#label4<_> (@name "\t")
+    if $"\u{9}"
     else
     end
     i32.const 0
-    if $#label5<___> (@name " ")
+    if $"\u{f61a}\u{f4a9} "
     else
     end
   )
diff --git a/tests/snapshots/testsuite/proposals/function-references/custom.wast/0.print b/tests/snapshots/testsuite/proposals/function-references/custom.wast/0.print
index 00e35eae..d0cea5e6 100644
--- a/tests/snapshots/testsuite/proposals/function-references/custom.wast/0.print
+++ b/tests/snapshots/testsuite/proposals/function-references/custom.wast/0.print
@@ -4,8 +4,8 @@
   (@custom "a custom section" (before first) "")
   (@custom "" (before first) "this is payload")
   (@custom "" (before first) "")
-  (@custom "\00\00custom sectio\00" (before first) "this is the payload")
-  (@custom "\ef\bb\bfa custom sect" (before first) "this is the payload")
-  (@custom "a custom sect\e2\8c\a3" (before first) "this is the payload")
+  (@custom "\u{0}\u{0}custom sectio\u{0}" (before first) "this is the payload")
+  (@custom "\u{feff}a custom sect" (before first) "this is the payload")
+  (@custom "a custom sect\u{2323}" (before first) "this is the payload")
   (@custom "module within a module" (before first) "\00asm\01\00\00\00")
 )