Before:
(module
)
Keeping: <none>
After:
(module
)
Secondary:
(module
)


Before:
(module
 (type $i32_=>_none (func (param i32)))
 (global $glob (mut i32) (i32.const 7))
 (memory $mem (shared 3 42))
 (table $tab 3 42 funcref)
 (tag $e (param i32))
)
Keeping: <none>
After:
(module
 (type $i32_=>_none (func (param i32)))
 (global $glob (mut i32) (i32.const 7))
 (memory $mem (shared 3 42))
 (table $tab 3 42 funcref)
 (tag $e (param i32))
 (export "%memory" (memory $mem))
 (export "%table" (table $tab))
 (export "%global" (global $glob))
 (export "%tag" (tag $e))
)
Secondary:
(module
 (type $i32_=>_none (func (param i32)))
 (import "primary" "%memory" (memory $mem (shared 3 42)))
 (import "primary" "%table" (table $tab 3 42 funcref))
 (import "primary" "%global" (global $glob (mut i32)))
 (import "primary" "%tag" (tag $e (param i32)))
)


Before:
(module
 (type $i32_=>_none (func (param i32)))
 (import "env" "mem" (memory $mem (shared 3 42)))
 (import "env" "tab" (table $tab 3 42 funcref))
 (import "env" "glob" (global $glob (mut i32)))
 (import "env" "e" (tag $e (param i32)))
)
Keeping: <none>
After:
(module
 (type $i32_=>_none (func (param i32)))
 (import "env" "mem" (memory $mem (shared 3 42)))
 (import "env" "tab" (table $tab 3 42 funcref))
 (import "env" "glob" (global $glob (mut i32)))
 (import "env" "e" (tag $e (param i32)))
 (export "%memory" (memory $mem))
 (export "%table" (table $tab))
 (export "%global" (global $glob))
 (export "%tag" (tag $e))
)
Secondary:
(module
 (type $i32_=>_none (func (param i32)))
 (import "primary" "%memory" (memory $mem (shared 3 42)))
 (import "primary" "%table" (table $tab 3 42 funcref))
 (import "primary" "%global" (global $glob (mut i32)))
 (import "primary" "%tag" (tag $e (param i32)))
)


Before:
(module
 (type $i32_=>_none (func (param i32)))
 (global $glob (mut i32) (i32.const 7))
 (memory $mem (shared 3 42))
 (table $tab 3 42 funcref)
 (tag $e (param i32))
 (export "mem" (memory $mem))
 (export "tab" (table $tab))
 (export "glob" (global $glob))
 (export "e" (tag $e))
)
Keeping: <none>
After:
(module
 (type $i32_=>_none (func (param i32)))
 (global $glob (mut i32) (i32.const 7))
 (memory $mem (shared 3 42))
 (table $tab 3 42 funcref)
 (tag $e (param i32))
 (export "mem" (memory $mem))
 (export "tab" (table $tab))
 (export "glob" (global $glob))
 (export "e" (tag $e))
)
Secondary:
(module
 (type $i32_=>_none (func (param i32)))
 (import "primary" "mem" (memory $mem (shared 3 42)))
 (import "primary" "tab" (table $tab 3 42 funcref))
 (import "primary" "glob" (global $glob (mut i32)))
 (import "primary" "e" (tag $e (param i32)))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 1 funcref)
 (elem (i32.const 0) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 1 funcref)
 (elem (i32.const 0) $foo)
 (export "%table" (table $table))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
 (import "primary" "%table" (table $table 1 funcref))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 2 funcref)
 (elem (i32.const 0) $foo $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 2 funcref)
 (elem (i32.const 0) $foo $foo)
 (export "%table" (table $table))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
 (import "primary" "%table" (table $table 2 funcref))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 1 funcref)
 (elem (global.get $base) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 1 funcref)
 (elem (global.get $base) $foo)
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
 (import "primary" "%table" (table $table 1 funcref))
 (import "primary" "%global" (global $base i32))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 2 funcref)
 (elem (global.get $base) $foo $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 2 funcref)
 (elem (global.get $base) $foo $foo)
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Secondary:
(module
 (import "primary" "%table" (table $table 2 funcref))
 (import "primary" "%global" (global $base i32))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "foo" (func $foo (param i32) (result i32)))
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "foo" (func $foo (param i32) (result i32)))
)
Secondary:
(module
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "foo" (func $foo (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (i32.const 42) $foo)
 (export "foo" (func $foo))
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "foo" (func $foo (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (i32.const 42) $foo)
 (export "foo" (func $foo))
 (export "%table" (table $table))
)
Secondary:
(module
 (import "primary" "%table" (table $table 1000 funcref))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (import "env" "foo" (func $foo (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (global.get $base) $foo)
 (export "foo" (func $foo))
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (import "env" "foo" (func $foo (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (global.get $base) $foo)
 (export "foo" (func $foo))
 (export "%table" (table $table))
 (export "%global" (global $base))
)
Secondary:
(module
 (import "primary" "%table" (table $table 1000 funcref))
 (import "primary" "%global" (global $base i32))
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
 (table $0 1 funcref)
 (elem (i32.const 0) $placeholder_0)
 (export "foo" (func $foo))
 (export "%table" (table $0))
 (func $foo (param $0 i32) (result i32)
  (call_indirect $0 (type $i32_=>_i32)
   (local.get $0)
   (i32.const 0)
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $0 1 funcref))
 (elem (i32.const 0) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 1 funcref)
 (elem (i32.const 0) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
 (table $table 1 funcref)
 (elem (i32.const 0) $placeholder_0)
 (export "%table" (table $table))
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 1 funcref))
 (elem (i32.const 0) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 2 funcref)
 (elem (i32.const 0) $foo $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
 (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32)))
 (table $table 2 funcref)
 (elem (i32.const 0) $placeholder_0 $placeholder_1)
 (export "%table" (table $table))
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 2 funcref))
 (elem (i32.const 0) $foo $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (i32.const 42) $foo)
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "placeholder" "42" (func $placeholder_42 (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (i32.const 42) $placeholder_42)
 (export "foo" (func $foo))
 (export "%table" (table $table))
 (func $foo (param $0 i32) (result i32)
  (call_indirect $table (type $i32_=>_i32)
   (local.get $0)
   (i32.const 42)
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 1000 funcref))
 (elem (i32.const 42) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 1000 funcref)
 (elem (global.get $base) $foo)
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (global.get $base) $placeholder_0)
 (export "foo" (func $foo))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $foo (param $0 i32) (result i32)
  (call_indirect $table (type $i32_=>_i32)
   (local.get $0)
   (global.get $base)
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 1000 funcref))
 (import "primary" "%global" (global $base i32))
 (elem (global.get $base) $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 1000 funcref)
 (elem (global.get $base) $foo $foo)
 (export "foo" (func $foo))
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: <none>
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (import "placeholder" "0" (func $placeholder_0 (param i32) (result i32)))
 (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (global.get $base) $placeholder_0 $placeholder_1)
 (export "foo" (func $foo))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $foo (param $0 i32) (result i32)
  (call_indirect $table (type $i32_=>_i32)
   (local.get $0)
   (global.get $base)
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 1000 funcref))
 (import "primary" "%global" (global $base i32))
 (elem (global.get $base) $foo $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "env" "base" (global $base i32))
 (table $table 1000 funcref)
 (elem (global.get $base) $null $foo)
 (export "foo" (func $foo))
 (func $null
  (nop)
 )
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)
Keeping: null
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32)))
 (table $table 1000 funcref)
 (elem (global.get $base) $null $placeholder_1)
 (export "foo" (func $foo))
 (export "%null" (func $null))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $null
  (nop)
 )
 (func $foo (param $0 i32) (result i32)
  (call_indirect $table (type $i32_=>_i32)
   (local.get $0)
   (i32.add
    (global.get $base)
    (i32.const 1)
   )
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 1000 funcref))
 (import "primary" "%global" (global $base i32))
 (import "primary" "%null" (func $null))
 (elem (global.get $base) $null $foo)
 (func $foo (param $0 i32) (result i32)
  (local.get $0)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (func $foo
  (call $bar)
 )
 (func $bar
  (nop)
 )
)
Keeping: bar, foo
After:
(module
 (type $none_=>_none (func))
 (func $foo
  (call $bar)
 )
 (func $bar
  (nop)
 )
)
Secondary:
(module
)


Before:
(module
 (type $none_=>_none (func))
 (func $foo
  (call $bar)
 )
 (func $bar
  (nop)
 )
)
Keeping: bar
After:
(module
 (type $none_=>_none (func))
 (export "%bar" (func $bar))
 (func $bar
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%bar" (func $bar))
 (func $foo
  (call $bar)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (func $foo
  (call $bar)
 )
 (func $bar
  (nop)
 )
)
Keeping: foo
After:
(module
 (type $none_=>_none (func))
 (import "placeholder" "0" (func $placeholder_0))
 (table $0 1 funcref)
 (elem (i32.const 0) $placeholder_0)
 (export "%table" (table $0))
 (func $foo
  (call_indirect $0 (type $none_=>_none)
   (i32.const 0)
  )
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $0 1 funcref))
 (elem (i32.const 0) $bar)
 (func $bar
  (nop)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (func $foo
  (call $bar)
 )
 (func $bar
  (nop)
 )
)
Keeping: <none>
After:
(module
)
Secondary:
(module
 (type $none_=>_none (func))
 (func $bar
  (nop)
 )
 (func $foo
  (call $bar)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (export "%foo" (func $bar))
 (func $foo
  (nop)
 )
 (func $bar
  (call $foo)
 )
)
Keeping: foo
After:
(module
 (type $none_=>_none (func))
 (import "placeholder" "0" (func $placeholder_0))
 (table $0 1 funcref)
 (elem (i32.const 0) $placeholder_0)
 (export "%foo" (func $bar))
 (export "%foo_0" (func $foo))
 (export "%table" (table $0))
 (func $foo
  (nop)
 )
 (func $bar
  (call_indirect $0 (type $none_=>_none)
   (i32.const 0)
  )
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $0 1 funcref))
 (import "primary" "%foo_0" (func $foo))
 (elem (i32.const 0) $bar)
 (func $bar
  (call $foo)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (table $table 4 funcref)
 (elem (i32.const 0) $foo $bar $baz $quux)
 (func $foo
  (nop)
 )
 (func $bar
  (nop)
 )
 (func $baz
  (nop)
 )
 (func $quux
  (nop)
 )
)
Keeping: bar, quux
After:
(module
 (type $none_=>_none (func))
 (import "placeholder" "0" (func $placeholder_0))
 (import "placeholder" "2" (func $placeholder_2))
 (table $table 4 funcref)
 (elem (i32.const 0) $placeholder_0 $bar $placeholder_2 $quux)
 (export "%table" (table $table))
 (func $bar
  (nop)
 )
 (func $quux
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 4 funcref))
 (elem $0 (i32.const 0) $foo)
 (elem $1 (i32.const 2) $baz)
 (func $baz
  (nop)
 )
 (func $foo
  (nop)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (table $table 4 funcref)
 (elem (global.get $base) $foo $bar $baz $quux)
 (func $foo
  (nop)
 )
 (func $bar
  (nop)
 )
 (func $baz
  (nop)
 )
 (func $quux
  (nop)
 )
)
Keeping: bar, quux
After:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (import "placeholder" "0" (func $placeholder_0))
 (import "placeholder" "2" (func $placeholder_2))
 (table $table 4 funcref)
 (elem (global.get $base) $placeholder_0 $bar $placeholder_2 $quux)
 (export "%bar" (func $bar))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $bar
  (nop)
 )
 (func $quux
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 4 funcref))
 (import "primary" "%global" (global $base i32))
 (import "primary" "%bar" (func $bar))
 (elem (global.get $base) $foo $bar $baz)
 (func $baz
  (nop)
 )
 (func $foo
  (nop)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (table $table 4 funcref)
 (elem (i32.const 0) $foo $bar $baz $quux)
 (func $foo
  (nop)
 )
 (func $bar
  (nop)
 )
 (func $baz
  (nop)
 )
 (func $quux
  (nop)
 )
)
Keeping: baz
After:
(module
 (type $none_=>_none (func))
 (import "placeholder" "0" (func $placeholder_0))
 (import "placeholder" "1" (func $placeholder_1))
 (import "placeholder" "3" (func $placeholder_3))
 (table $table 4 funcref)
 (elem (i32.const 0) $placeholder_0 $placeholder_1 $baz $placeholder_3)
 (export "%table" (table $table))
 (func $baz
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 4 funcref))
 (elem $0 (i32.const 0) $foo $bar)
 (elem $1 (i32.const 3) $quux)
 (func $bar
  (nop)
 )
 (func $foo
  (nop)
 )
 (func $quux
  (nop)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (table $table 4 funcref)
 (elem (global.get $base) $foo $bar $baz $quux)
 (func $foo
  (nop)
 )
 (func $bar
  (nop)
 )
 (func $baz
  (nop)
 )
 (func $quux
  (nop)
 )
)
Keeping: baz
After:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (import "placeholder" "0" (func $placeholder_0))
 (import "placeholder" "1" (func $placeholder_1))
 (import "placeholder" "3" (func $placeholder_3))
 (table $table 4 funcref)
 (elem (global.get $base) $placeholder_0 $placeholder_1 $baz $placeholder_3)
 (export "%baz" (func $baz))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $baz
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 4 funcref))
 (import "primary" "%global" (global $base i32))
 (import "primary" "%baz" (func $baz))
 (elem (global.get $base) $foo $bar $baz $quux)
 (func $bar
  (nop)
 )
 (func $foo
  (nop)
 )
 (func $quux
  (nop)
 )
)


Before:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (table $table 2 funcref)
 (elem (global.get $base) $foo $bar)
 (func $foo
  (nop)
 )
 (func $bar
  (call $foo)
 )
)
Keeping: foo
After:
(module
 (type $none_=>_none (func))
 (import "env" "base" (global $base i32))
 (import "placeholder" "1" (func $placeholder_1))
 (table $table 2 funcref)
 (elem (global.get $base) $foo $placeholder_1)
 (export "%foo" (func $foo))
 (export "%table" (table $table))
 (export "%global" (global $base))
 (func $foo
  (nop)
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $table 2 funcref))
 (import "primary" "%global" (global $base i32))
 (import "primary" "%foo" (func $foo))
 (elem (global.get $base) $foo $bar)
 (func $bar
  (call $foo)
 )
)


Before:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (table $table 1 1 funcref)
 (elem (i32.const 0) $foo)
 (func $foo (param $0 i32) (result i32)
  (call $bar
   (i32.const 0)
  )
 )
 (func $bar (param $0 i32) (result i32)
  (call $foo
   (i32.const 1)
  )
 )
)
Keeping: foo
After:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "placeholder" "1" (func $placeholder_1 (param i32) (result i32)))
 (table $table 2 2 funcref)
 (elem (i32.const 0) $foo $placeholder_1)
 (export "%foo" (func $foo))
 (export "%table" (table $table))
 (func $foo (param $0 i32) (result i32)
  (call_indirect $table (type $i32_=>_i32)
   (i32.const 0)
   (i32.const 1)
  )
 )
)
Secondary:
(module
 (type $i32_=>_i32 (func (param i32) (result i32)))
 (import "primary" "%table" (table $table 2 2 funcref))
 (import "primary" "%foo" (func $foo (param i32) (result i32)))
 (elem (i32.const 1) $bar)
 (func $bar (param $0 i32) (result i32)
  (call $foo
   (i32.const 1)
  )
 )
)


Before:
(module
 (type $none_=>_none (func))
 (export "foo1" (func $foo))
 (export "foo2" (func $foo))
 (func $foo
  (nop)
 )
)
Keeping: <none>
After:
(module
 (type $none_=>_none (func))
 (import "placeholder" "0" (func $placeholder_0))
 (table $0 1 funcref)
 (elem (i32.const 0) $placeholder_0)
 (export "foo1" (func $foo))
 (export "foo2" (func $foo))
 (export "%table" (table $0))
 (func $foo
  (call_indirect $0 (type $none_=>_none)
   (i32.const 0)
  )
 )
)
Secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%table" (table $0 1 funcref))
 (elem (i32.const 0) $foo)
 (func $foo
  (nop)
 )
)


Minimized names primary:
(module
 (type $none_=>_none (func))
 (export "already_exported" (func $3))
 (export "%b" (func $7))
 (export "%a" (func $0))
 (export "%c" (func $1))
 (export "%d" (func $2))
 (export "%e" (func $4))
 (export "%f" (func $5))
 (export "%g" (func $6))
 (export "%h" (func $8))
 (export "%i" (func $9))
 (func $0
  (nop)
 )
 (func $1
  (nop)
 )
 (func $2
  (nop)
 )
 (func $3
  (nop)
 )
 (func $4
  (nop)
 )
 (func $5
  (nop)
 )
 (func $6
  (nop)
 )
 (func $7
  (nop)
 )
 (func $8
  (nop)
 )
 (func $9
  (nop)
 )
)

Minimized names secondary:
(module
 (type $none_=>_none (func))
 (import "primary" "%a" (func $0))
 (import "primary" "%c" (func $1))
 (import "primary" "%d" (func $2))
 (import "primary" "already_exported" (func $3))
 (import "primary" "%e" (func $4))
 (import "primary" "%f" (func $5))
 (import "primary" "%g" (func $6))
 (import "primary" "%b" (func $7))
 (import "primary" "%h" (func $8))
 (import "primary" "%i" (func $9))
 (func $call
  (call $0)
  (call $1)
  (call $2)
  (call $3)
  (call $4)
  (call $5)
  (call $6)
  (call $7)
  (call $8)
  (call $9)
 )
)

