// Code generated by msgpackgen. DO NOT EDIT.

package shamaton

import (
	"fmt"
	msgpack "github.com/shamaton/msgpackgen/msgpack"
	dec "github.com/shamaton/msgpackgen/msgpack/dec"
	enc "github.com/shamaton/msgpackgen/msgpack/enc"
	"time"
)

// RegisterGeneratedResolver registers generated resolver.
func RegisterGeneratedResolver() {
	msgpack.SetResolver(___encodeAsMap, ___encodeAsArray, ___decodeAsMap, ___decodeAsArray)
}

// encode
func ___encode(i interface{}) ([]byte, error) {
	if msgpack.StructAsArray() {
		return ___encodeAsArray(i)
	} else {
		return ___encodeAsMap(i)
	}
}

// encodeAsArray
func ___encodeAsArray(i interface{}) ([]byte, error) {
	switch v := i.(type) {
	case A:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "A", size, offset)
		}
		return b, err
	case *A:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "A", size, offset)
		}
		return b, err
	case NoTimeA:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeA", size, offset)
		}
		return b, err
	case *NoTimeA:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeA", size, offset)
		}
		return b, err
	case NoTimeNoStringNoFloatA:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeNoStringNoFloatA", size, offset)
		}
		return b, err
	case *NoTimeNoStringNoFloatA:
		encoder := enc.NewEncoder()
		size, err := ___calcArraySizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeNoStringNoFloatA", size, offset)
		}
		return b, err
	}
	return nil, fmt.Errorf("use strict option : undefined type")
}

// encodeAsMap
func ___encodeAsMap(i interface{}) ([]byte, error) {
	switch v := i.(type) {
	case A:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "A", size, offset)
		}
		return b, err
	case *A:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "A", size, offset)
		}
		return b, err
	case NoTimeA:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeA", size, offset)
		}
		return b, err
	case *NoTimeA:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeA", size, offset)
		}
		return b, err
	case NoTimeNoStringNoFloatA:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeNoStringNoFloatA", size, offset)
		}
		return b, err
	case *NoTimeNoStringNoFloatA:
		encoder := enc.NewEncoder()
		size, err := ___calcMapSizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder)
		if err != nil {
			return nil, err
		}
		encoder.MakeBytes(size)
		b, offset, err := ___encodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, encoder, 0)
		if err != nil {
			return nil, err
		}
		if size != offset {
			return nil, fmt.Errorf("%s size / offset different %d : %d", "NoTimeNoStringNoFloatA", size, offset)
		}
		return b, err
	}
	return nil, fmt.Errorf("use strict option : undefined type")
}

// decode
func ___decode(data []byte, i interface{}) (bool, error) {
	if msgpack.StructAsArray() {
		return ___decodeAsArray(data, i)
	} else {
		return ___decodeAsMap(data, i)
	}
}

// decodeAsArray
func ___decodeAsArray(data []byte, i interface{}) (bool, error) {
	switch v := i.(type) {
	case *A:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **A:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case *NoTimeA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **NoTimeA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case *NoTimeNoStringNoFloatA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **NoTimeNoStringNoFloatA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	}
	return false, fmt.Errorf("use strict option : undefined type")
}

// decodeAsMap
func ___decodeAsMap(data []byte, i interface{}) (bool, error) {
	switch v := i.(type) {
	case *A:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **A:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case *NoTimeA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **NoTimeA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case *NoTimeNoStringNoFloatA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	case **NoTimeNoStringNoFloatA:
		decoder := dec.NewDecoder(data)
		offset, err := ___decodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(*v, decoder, 0)
		if err == nil && offset != decoder.Len() {
			return true, fmt.Errorf("read length is different [%d] [%d] ", offset, decoder.Len())
		}
		return true, err
	}
	return false, fmt.Errorf("use strict option : undefined type")
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.A
func ___calcArraySizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v A, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	size += encoder.CalcString(v.Name)
	size += encoder.CalcTime(v.BirthDay)
	size += encoder.CalcString(v.Phone)
	size += encoder.CalcInt(v.Siblings)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcFloat64(v.Money)
	return size, nil
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.A
func ___calcMapSizeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v A, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	size += encoder.CalcStringFix(4)
	size += encoder.CalcString(v.Name)
	size += encoder.CalcStringFix(8)
	size += encoder.CalcTime(v.BirthDay)
	size += encoder.CalcStringFix(5)
	size += encoder.CalcString(v.Phone)
	size += encoder.CalcStringFix(8)
	size += encoder.CalcInt(v.Siblings)
	size += encoder.CalcStringFix(6)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcStringFix(5)
	size += encoder.CalcFloat64(v.Money)
	return size, nil
}

// encode from github.com/alecthomas/go_serialization_benchmarks.A
func ___encodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v A, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsArray(6, offset)
	offset = encoder.WriteString(v.Name, offset)
	offset = encoder.WriteTime(v.BirthDay, offset)
	offset = encoder.WriteString(v.Phone, offset)
	offset = encoder.WriteInt(v.Siblings, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteFloat64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// encode from github.com/alecthomas/go_serialization_benchmarks.A
func ___encodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v A, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsMap(6, offset)
	offset = encoder.WriteStringFix("Name", 4, offset)
	offset = encoder.WriteString(v.Name, offset)
	offset = encoder.WriteStringFix("BirthDay", 8, offset)
	offset = encoder.WriteTime(v.BirthDay, offset)
	offset = encoder.WriteStringFix("Phone", 5, offset)
	offset = encoder.WriteString(v.Phone, offset)
	offset = encoder.WriteStringFix("Siblings", 8, offset)
	offset = encoder.WriteInt(v.Siblings, offset)
	offset = encoder.WriteStringFix("Spouse", 6, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteStringFix("Money", 5, offset)
	offset = encoder.WriteFloat64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.A
func ___decodeArrayA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *A, decoder *dec.Decoder, offset int) (int, error) {
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	{
		var vv string
		vv, offset, err = decoder.AsString(offset)
		if err != nil {
			return 0, err
		}
		v.Name = vv
	}
	{
		var vv time.Time
		vv, offset, err = decoder.AsDateTime(offset)
		if err != nil {
			return 0, err
		}
		v.BirthDay = vv
	}
	{
		var vv string
		vv, offset, err = decoder.AsString(offset)
		if err != nil {
			return 0, err
		}
		v.Phone = vv
	}
	{
		var vv int
		vv, offset, err = decoder.AsInt(offset)
		if err != nil {
			return 0, err
		}
		v.Siblings = vv
	}
	{
		var vv bool
		vv, offset, err = decoder.AsBool(offset)
		if err != nil {
			return 0, err
		}
		v.Spouse = vv
	}
	{
		var vv float64
		vv, offset, err = decoder.AsFloat64(offset)
		if err != nil {
			return 0, err
		}
		v.Money = vv
	}
	return offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.A
func ___decodeMapA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *A, decoder *dec.Decoder, offset int) (int, error) {
	keys := [][]byte{
		{uint8(0x4e), uint8(0x61), uint8(0x6d), uint8(0x65)},                                                     // Name
		{uint8(0x42), uint8(0x69), uint8(0x72), uint8(0x74), uint8(0x68), uint8(0x44), uint8(0x61), uint8(0x79)}, // BirthDay
		{uint8(0x50), uint8(0x68), uint8(0x6f), uint8(0x6e), uint8(0x65)},                                        // Phone
		{uint8(0x53), uint8(0x69), uint8(0x62), uint8(0x6c), uint8(0x69), uint8(0x6e), uint8(0x67), uint8(0x73)}, // Siblings
		{uint8(0x53), uint8(0x70), uint8(0x6f), uint8(0x75), uint8(0x73), uint8(0x65)},                           // Spouse
		{uint8(0x4d), uint8(0x6f), uint8(0x6e), uint8(0x65), uint8(0x79)},                                        // Money
	}
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	count := 0
	for count < 6 {
		var dataKey []byte
		dataKey, offset, err = decoder.AsStringBytes(offset)
		if err != nil {
			return 0, err
		}
		fieldIndex := -1
		for i, key := range keys {
			if len(dataKey) != len(key) {
				continue
			}
			fieldIndex = i
			for dataKeyIndex := range dataKey {
				if dataKey[dataKeyIndex] != key[dataKeyIndex] {
					fieldIndex = -1
					break
				}
			}
			if fieldIndex >= 0 {
				break
			}
		}
		switch fieldIndex {
		case 0:
			{
				var vv string
				vv, offset, err = decoder.AsString(offset)
				if err != nil {
					return 0, err
				}
				v.Name = vv
			}
			count++
		case 1:
			{
				var vv time.Time
				vv, offset, err = decoder.AsDateTime(offset)
				if err != nil {
					return 0, err
				}
				v.BirthDay = vv
			}
			count++
		case 2:
			{
				var vv string
				vv, offset, err = decoder.AsString(offset)
				if err != nil {
					return 0, err
				}
				v.Phone = vv
			}
			count++
		case 3:
			{
				var vv int
				vv, offset, err = decoder.AsInt(offset)
				if err != nil {
					return 0, err
				}
				v.Siblings = vv
			}
			count++
		case 4:
			{
				var vv bool
				vv, offset, err = decoder.AsBool(offset)
				if err != nil {
					return 0, err
				}
				v.Spouse = vv
			}
			count++
		case 5:
			{
				var vv float64
				vv, offset, err = decoder.AsFloat64(offset)
				if err != nil {
					return 0, err
				}
				v.Money = vv
			}
			count++
		default:
			return 0, fmt.Errorf("unknown key[%s] found", string(dataKey))
		}
	}
	return offset, err
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___calcArraySizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeA, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	size += encoder.CalcString(v.Name)
	size += encoder.CalcInt64(v.BirthDay)
	size += encoder.CalcString(v.Phone)
	size += encoder.CalcInt(v.Siblings)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcFloat64(v.Money)
	return size, nil
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___calcMapSizeNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeA, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	size += encoder.CalcStringFix(4)
	size += encoder.CalcString(v.Name)
	size += encoder.CalcStringFix(8)
	size += encoder.CalcInt64(v.BirthDay)
	size += encoder.CalcStringFix(5)
	size += encoder.CalcString(v.Phone)
	size += encoder.CalcStringFix(8)
	size += encoder.CalcInt(v.Siblings)
	size += encoder.CalcStringFix(6)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcStringFix(5)
	size += encoder.CalcFloat64(v.Money)
	return size, nil
}

// encode from github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___encodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeA, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsArray(6, offset)
	offset = encoder.WriteString(v.Name, offset)
	offset = encoder.WriteInt64(v.BirthDay, offset)
	offset = encoder.WriteString(v.Phone, offset)
	offset = encoder.WriteInt(v.Siblings, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteFloat64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// encode from github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___encodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeA, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsMap(6, offset)
	offset = encoder.WriteStringFix("Name", 4, offset)
	offset = encoder.WriteString(v.Name, offset)
	offset = encoder.WriteStringFix("BirthDay", 8, offset)
	offset = encoder.WriteInt64(v.BirthDay, offset)
	offset = encoder.WriteStringFix("Phone", 5, offset)
	offset = encoder.WriteString(v.Phone, offset)
	offset = encoder.WriteStringFix("Siblings", 8, offset)
	offset = encoder.WriteInt(v.Siblings, offset)
	offset = encoder.WriteStringFix("Spouse", 6, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteStringFix("Money", 5, offset)
	offset = encoder.WriteFloat64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___decodeArrayNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *NoTimeA, decoder *dec.Decoder, offset int) (int, error) {
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	{
		var vv string
		vv, offset, err = decoder.AsString(offset)
		if err != nil {
			return 0, err
		}
		v.Name = vv
	}
	{
		var vv int64
		vv, offset, err = decoder.AsInt64(offset)
		if err != nil {
			return 0, err
		}
		v.BirthDay = vv
	}
	{
		var vv string
		vv, offset, err = decoder.AsString(offset)
		if err != nil {
			return 0, err
		}
		v.Phone = vv
	}
	{
		var vv int
		vv, offset, err = decoder.AsInt(offset)
		if err != nil {
			return 0, err
		}
		v.Siblings = vv
	}
	{
		var vv bool
		vv, offset, err = decoder.AsBool(offset)
		if err != nil {
			return 0, err
		}
		v.Spouse = vv
	}
	{
		var vv float64
		vv, offset, err = decoder.AsFloat64(offset)
		if err != nil {
			return 0, err
		}
		v.Money = vv
	}
	return offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.NoTimeA
func ___decodeMapNoTimeA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *NoTimeA, decoder *dec.Decoder, offset int) (int, error) {
	keys := [][]byte{
		{uint8(0x4e), uint8(0x61), uint8(0x6d), uint8(0x65)},                                                     // Name
		{uint8(0x42), uint8(0x69), uint8(0x72), uint8(0x74), uint8(0x68), uint8(0x44), uint8(0x61), uint8(0x79)}, // BirthDay
		{uint8(0x50), uint8(0x68), uint8(0x6f), uint8(0x6e), uint8(0x65)},                                        // Phone
		{uint8(0x53), uint8(0x69), uint8(0x62), uint8(0x6c), uint8(0x69), uint8(0x6e), uint8(0x67), uint8(0x73)}, // Siblings
		{uint8(0x53), uint8(0x70), uint8(0x6f), uint8(0x75), uint8(0x73), uint8(0x65)},                           // Spouse
		{uint8(0x4d), uint8(0x6f), uint8(0x6e), uint8(0x65), uint8(0x79)},                                        // Money
	}
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	count := 0
	for count < 6 {
		var dataKey []byte
		dataKey, offset, err = decoder.AsStringBytes(offset)
		if err != nil {
			return 0, err
		}
		fieldIndex := -1
		for i, key := range keys {
			if len(dataKey) != len(key) {
				continue
			}
			fieldIndex = i
			for dataKeyIndex := range dataKey {
				if dataKey[dataKeyIndex] != key[dataKeyIndex] {
					fieldIndex = -1
					break
				}
			}
			if fieldIndex >= 0 {
				break
			}
		}
		switch fieldIndex {
		case 0:
			{
				var vv string
				vv, offset, err = decoder.AsString(offset)
				if err != nil {
					return 0, err
				}
				v.Name = vv
			}
			count++
		case 1:
			{
				var vv int64
				vv, offset, err = decoder.AsInt64(offset)
				if err != nil {
					return 0, err
				}
				v.BirthDay = vv
			}
			count++
		case 2:
			{
				var vv string
				vv, offset, err = decoder.AsString(offset)
				if err != nil {
					return 0, err
				}
				v.Phone = vv
			}
			count++
		case 3:
			{
				var vv int
				vv, offset, err = decoder.AsInt(offset)
				if err != nil {
					return 0, err
				}
				v.Siblings = vv
			}
			count++
		case 4:
			{
				var vv bool
				vv, offset, err = decoder.AsBool(offset)
				if err != nil {
					return 0, err
				}
				v.Spouse = vv
			}
			count++
		case 5:
			{
				var vv float64
				vv, offset, err = decoder.AsFloat64(offset)
				if err != nil {
					return 0, err
				}
				v.Money = vv
			}
			count++
		default:
			return 0, fmt.Errorf("unknown key[%s] found", string(dataKey))
		}
	}
	return offset, err
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___calcArraySizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeNoStringNoFloatA, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	if v.Name != nil {
		s, err := encoder.CalcSliceLength(len(v.Name), true)
		if err != nil {
			return 0, err
		}
		size += s
		for _, vv := range v.Name {
			size += encoder.CalcByte(vv)
		}
	} else {
		size += encoder.CalcNil()
	}
	size += encoder.CalcUint64(v.BirthDay)
	if v.Phone != nil {
		s, err := encoder.CalcSliceLength(len(v.Phone), true)
		if err != nil {
			return 0, err
		}
		size += s
		for _, vv := range v.Phone {
			size += encoder.CalcByte(vv)
		}
	} else {
		size += encoder.CalcNil()
	}
	size += encoder.CalcUint32(v.Siblings)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcUint64(v.Money)
	return size, nil
}

// calculate size from github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___calcMapSizeNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeNoStringNoFloatA, encoder *enc.Encoder) (int, error) {
	size := 0
	size += encoder.CalcStructHeaderFix(6)
	size += encoder.CalcStringFix(4)
	if v.Name != nil {
		s, err := encoder.CalcSliceLength(len(v.Name), true)
		if err != nil {
			return 0, err
		}
		size += s
		for _, vv := range v.Name {
			size += encoder.CalcByte(vv)
		}
	} else {
		size += encoder.CalcNil()
	}
	size += encoder.CalcStringFix(8)
	size += encoder.CalcUint64(v.BirthDay)
	size += encoder.CalcStringFix(5)
	if v.Phone != nil {
		s, err := encoder.CalcSliceLength(len(v.Phone), true)
		if err != nil {
			return 0, err
		}
		size += s
		for _, vv := range v.Phone {
			size += encoder.CalcByte(vv)
		}
	} else {
		size += encoder.CalcNil()
	}
	size += encoder.CalcStringFix(8)
	size += encoder.CalcUint32(v.Siblings)
	size += encoder.CalcStringFix(6)
	size += encoder.CalcBool(v.Spouse)
	size += encoder.CalcStringFix(5)
	size += encoder.CalcUint64(v.Money)
	return size, nil
}

// encode from github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___encodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeNoStringNoFloatA, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsArray(6, offset)
	if v.Name != nil {
		offset = encoder.WriteSliceLength(len(v.Name), offset, true)
		for _, vv := range v.Name {
			offset = encoder.WriteByte(vv, offset)
		}
	} else {
		offset = encoder.WriteNil(offset)
	}
	offset = encoder.WriteUint64(v.BirthDay, offset)
	if v.Phone != nil {
		offset = encoder.WriteSliceLength(len(v.Phone), offset, true)
		for _, vv := range v.Phone {
			offset = encoder.WriteByte(vv, offset)
		}
	} else {
		offset = encoder.WriteNil(offset)
	}
	offset = encoder.WriteUint32(v.Siblings, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteUint64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// encode from github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___encodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v NoTimeNoStringNoFloatA, encoder *enc.Encoder, offset int) ([]byte, int, error) {
	var err error
	offset = encoder.WriteStructHeaderFixAsMap(6, offset)
	offset = encoder.WriteStringFix("Name", 4, offset)
	if v.Name != nil {
		offset = encoder.WriteSliceLength(len(v.Name), offset, true)
		for _, vv := range v.Name {
			offset = encoder.WriteByte(vv, offset)
		}
	} else {
		offset = encoder.WriteNil(offset)
	}
	offset = encoder.WriteStringFix("BirthDay", 8, offset)
	offset = encoder.WriteUint64(v.BirthDay, offset)
	offset = encoder.WriteStringFix("Phone", 5, offset)
	if v.Phone != nil {
		offset = encoder.WriteSliceLength(len(v.Phone), offset, true)
		for _, vv := range v.Phone {
			offset = encoder.WriteByte(vv, offset)
		}
	} else {
		offset = encoder.WriteNil(offset)
	}
	offset = encoder.WriteStringFix("Siblings", 8, offset)
	offset = encoder.WriteUint32(v.Siblings, offset)
	offset = encoder.WriteStringFix("Spouse", 6, offset)
	offset = encoder.WriteBool(v.Spouse, offset)
	offset = encoder.WriteStringFix("Money", 5, offset)
	offset = encoder.WriteUint64(v.Money, offset)
	return encoder.EncodedBytes(), offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___decodeArrayNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *NoTimeNoStringNoFloatA, decoder *dec.Decoder, offset int) (int, error) {
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	if !decoder.IsCodeNil(offset) {
		var vv []byte
		var vvl int
		vvl, offset, err = decoder.SliceLength(offset)
		if err != nil {
			return 0, err
		}
		vv = make([]byte, vvl)
		for vvi := range vv {
			var vvv byte
			vvv, offset, err = decoder.AsByte(offset)
			if err != nil {
				return 0, err
			}
			vv[vvi] = vvv
		}
		v.Name = vv
	} else {
		offset++
	}
	{
		var vv uint64
		vv, offset, err = decoder.AsUint64(offset)
		if err != nil {
			return 0, err
		}
		v.BirthDay = vv
	}
	if !decoder.IsCodeNil(offset) {
		var vv []byte
		var vvl int
		vvl, offset, err = decoder.SliceLength(offset)
		if err != nil {
			return 0, err
		}
		vv = make([]byte, vvl)
		for vvi := range vv {
			var vvv byte
			vvv, offset, err = decoder.AsByte(offset)
			if err != nil {
				return 0, err
			}
			vv[vvi] = vvv
		}
		v.Phone = vv
	} else {
		offset++
	}
	{
		var vv uint32
		vv, offset, err = decoder.AsUint32(offset)
		if err != nil {
			return 0, err
		}
		v.Siblings = vv
	}
	{
		var vv bool
		vv, offset, err = decoder.AsBool(offset)
		if err != nil {
			return 0, err
		}
		v.Spouse = vv
	}
	{
		var vv uint64
		vv, offset, err = decoder.AsUint64(offset)
		if err != nil {
			return 0, err
		}
		v.Money = vv
	}
	return offset, err
}

// decode to github.com/alecthomas/go_serialization_benchmarks.NoTimeNoStringNoFloatA
func ___decodeMapNoTimeNoStringNoFloatA_dd450b3568aeca1e592f09df9c4397c3c202e4bf15bc89215d4b28d1b990d189(v *NoTimeNoStringNoFloatA, decoder *dec.Decoder, offset int) (int, error) {
	keys := [][]byte{
		{uint8(0x4e), uint8(0x61), uint8(0x6d), uint8(0x65)},                                                     // Name
		{uint8(0x42), uint8(0x69), uint8(0x72), uint8(0x74), uint8(0x68), uint8(0x44), uint8(0x61), uint8(0x79)}, // BirthDay
		{uint8(0x50), uint8(0x68), uint8(0x6f), uint8(0x6e), uint8(0x65)},                                        // Phone
		{uint8(0x53), uint8(0x69), uint8(0x62), uint8(0x6c), uint8(0x69), uint8(0x6e), uint8(0x67), uint8(0x73)}, // Siblings
		{uint8(0x53), uint8(0x70), uint8(0x6f), uint8(0x75), uint8(0x73), uint8(0x65)},                           // Spouse
		{uint8(0x4d), uint8(0x6f), uint8(0x6e), uint8(0x65), uint8(0x79)},                                        // Money
	}
	offset, err := decoder.CheckStructHeader(6, offset)
	if err != nil {
		return 0, err
	}
	count := 0
	for count < 6 {
		var dataKey []byte
		dataKey, offset, err = decoder.AsStringBytes(offset)
		if err != nil {
			return 0, err
		}
		fieldIndex := -1
		for i, key := range keys {
			if len(dataKey) != len(key) {
				continue
			}
			fieldIndex = i
			for dataKeyIndex := range dataKey {
				if dataKey[dataKeyIndex] != key[dataKeyIndex] {
					fieldIndex = -1
					break
				}
			}
			if fieldIndex >= 0 {
				break
			}
		}
		switch fieldIndex {
		case 0:
			if !decoder.IsCodeNil(offset) {
				var vv []byte
				var vvl int
				vvl, offset, err = decoder.SliceLength(offset)
				if err != nil {
					return 0, err
				}
				vv = make([]byte, vvl)
				for vvi := range vv {
					var vvv byte
					vvv, offset, err = decoder.AsByte(offset)
					if err != nil {
						return 0, err
					}
					vv[vvi] = vvv
				}
				v.Name = vv
			} else {
				offset++
			}
			count++
		case 1:
			{
				var vv uint64
				vv, offset, err = decoder.AsUint64(offset)
				if err != nil {
					return 0, err
				}
				v.BirthDay = vv
			}
			count++
		case 2:
			if !decoder.IsCodeNil(offset) {
				var vv []byte
				var vvl int
				vvl, offset, err = decoder.SliceLength(offset)
				if err != nil {
					return 0, err
				}
				vv = make([]byte, vvl)
				for vvi := range vv {
					var vvv byte
					vvv, offset, err = decoder.AsByte(offset)
					if err != nil {
						return 0, err
					}
					vv[vvi] = vvv
				}
				v.Phone = vv
			} else {
				offset++
			}
			count++
		case 3:
			{
				var vv uint32
				vv, offset, err = decoder.AsUint32(offset)
				if err != nil {
					return 0, err
				}
				v.Siblings = vv
			}
			count++
		case 4:
			{
				var vv bool
				vv, offset, err = decoder.AsBool(offset)
				if err != nil {
					return 0, err
				}
				v.Spouse = vv
			}
			count++
		case 5:
			{
				var vv uint64
				vv, offset, err = decoder.AsUint64(offset)
				if err != nil {
					return 0, err
				}
				v.Money = vv
			}
			count++
		default:
			return 0, fmt.Errorf("unknown key[%s] found", string(dataKey))
		}
	}
	return offset, err
}
