func (m *marshalGen) rawbytes(bts []byte) {
	m.p.print("\no = append(o, ")
	for _, b := range bts {
		m.p.printf("0x%x,", b)
	}
	m.p.print(")")
}
append raw data
package gen
import (
	"fmt"
	"io"
	"github.com/dchenk/msgp/msgp"
)
func marshal(w io.Writer) *marshalGen {
	return &marshalGen{
		p: printer{w: w},
	}
}
type marshalGen struct {
	passes
	p    printer
	fuse []byte
}
func (m *marshalGen) Method() Method { return Marshal }
func (m *marshalGen) Apply(dirs []string) error {
	return nil
}
func (m *marshalGen) Execute(p Elem) error {
	if !m.p.ok() {
		return m.p.err
	}
	p = m.applyAll(p)
	if p == nil {
		return nil
	}
	if !isPrintable(p) {
		return nil
	}
	m.p.comment("MarshalMsg implements msgp.Marshaler")
	c := p.Varname()
	m.p.printf("\nfunc (%s %s) MarshalMsg(b []byte) (o []byte, err error) {", p.Varname(), imutMethodReceiver(p))
	m.p.printf("\no = msgp.Require(b, %s.Msgsize())", c)
	next(m, p)
	m.p.nakedReturn()
	return m.p.err
}
func (m *marshalGen) rawAppend(typ string, argfmt string, arg interface{}) {
	m.p.printf("\no = msgp.Append%s(o, %s)", typ, fmt.Sprintf(argfmt, arg))
}
func (m *marshalGen) fuseHook() {
	if len(m.fuse) > 0 {
		m.rawbytes(m.fuse)
		m.fuse = m.fuse[:0]
	}
}
func (m *marshalGen) Fuse(b []byte) {
	if len(m.fuse) == 0 {
		m.fuse = b
	} else {
		m.fuse = append(m.fuse, b...)
	}
}
func (m *marshalGen) gStruct(s *Struct) {
	if !m.p.ok() {
		return
	}
	if s.AsTuple {
		m.tuple(s)
	} else {
		m.mapstruct(s)
	}
}
func (m *marshalGen) tuple(s *Struct) {
	data := make([]byte, 0, 5)
	data = msgp.AppendArrayHeader(data, uint32(len(s.Fields)))
	m.p.printf("\n// array header, size %d", len(s.Fields))
	m.Fuse(data)
	if len(s.Fields) == 0 {
		m.fuseHook()
	}
	for i := range s.Fields {
		if !m.p.ok() {
			return
		}
		next(m, s.Fields[i].fieldElem)
	}
}
func (m *marshalGen) mapstruct(s *Struct) {
	data := make([]byte, 0, 64)
	data = msgp.AppendMapHeader(data, uint32(len(s.Fields)))
	m.p.printf("\n// map header, size %d", len(s.Fields))
	m.Fuse(data)
	if len(s.Fields) == 0 {
		m.fuseHook()
	}
	for i := range s.Fields {
		if !m.p.ok() {
			return
		}
		data = msgp.AppendString(nil, s.Fields[i].fieldTag)
		m.p.printf("\n// string %q", s.Fields[i].fieldTag)
		m.Fuse(data)
		next(m, s.Fields[i].fieldElem)
	}
}