code: function assemble(tree, options, api) {
    return Object.entries(tree.modules).reduce((opcodes, [filepath, mod]) => {
      // There are two cases when we should generate a DATA section for module,
      // it has statics OR it imports a memory. As then it needs to share the
      // same information about the memory layout as the rest of the application.
      let statics = mod.ast.meta.AST_METADATA.statics;
      if (Object.keys(statics).length > 0 || mod.hasMemory) {
        // Use global statics object
        statics = options.linker.statics;
      }
  
      const code = api.generator(
        mod.ast,
        Object.assign({}, options, { filename: mod.filepath.split('/').slice(-1)[0], linker: { statics } })
      );
      const wasm = api.emitter(code, options).buffer();
  
      return Object.assign({}, opcodes, {
        [filepath]: wasm,
      });
    }, {});
  }
docs: Assemble all AST into opcodes/instructions