You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: uint64.go
    path of file: ./repos/cosmos-sdk/orm/encoding/ormfield
    
    the code of the file until where you have to start completion: package ormfield

import (
	"encoding/binary"
	"fmt"
	"io"

	"google.golang.org/protobuf/reflect/protoreflect"
)

// FixedUint64Codec encodes uint64 values as 8-byte big-endian integers.
type FixedUint64Codec struct{}

func (u FixedUint64Codec) FixedBufferSize() int {
	return 8
}

func (u FixedUint64Codec) ComputeBufferSize(protoreflect.Value) (int, error) {
	return u.FixedBufferSize(), nil
}

func (u FixedUint64Codec) IsOrdered() bool {
	return true
}

func (u FixedUint64Codec) Compare(v1, v2 protoreflect.Value) int {
	return compareUint(v1, v2)
}

func (u FixedUint64Codec) Decode(r Reader) (protoreflect.Value, error) {
	var x uint64
	err := binary.Read(r, binary.BigEndian, &x)
	return protoreflect.ValueOfUint64(x), err
}

func (u FixedUint64Codec) Encode(value protoreflect.Value, w io.Writer) error {
	var x uint64
	if value.IsValid() {
		x = value.Uint()
	}
	return binary.Write(w, binary.BigEndian, x)
}

func compareUint(v1, v2 protoreflect.Value) int {
	var x, y uint64
	if v1.IsValid() {
		x = v1.Uint()
	}
	if v2.IsValid() {
		y = v2.Uint()
	}
	switch {
	case
    
func DecodeCompactUint64(reader io.Reader) (uint64, error) {
	var buf [9]byte
	n, err := reader.Read(buf[:1])
	if err != nil {
		return 0, err
	}
	if n < 1 {
		return 0, io.ErrUnexpectedEOF
	}

	switch buf[0] >> 6 {
	case 0:
		n, err := reader.Read(buf[1:2])
		if err != nil {
			return 0, err
		}
		if n < 1 {
			return 0, io.ErrUnexpectedEOF
		}

		x := uint64(buf[0]) << 8
		x |= uint64(buf[1])
		return x, nil
	case 1:
		n, err := reader.Read(buf[1:4])
		if err != nil {
			return 0, err
		}
		if n < 3 {
			return 0, io.ErrUnexpectedEOF
		}

		x := (uint64(buf[0]) & 0x3F) << 24
		x |= uint64(buf[1]) << 16
		x |= uint64(buf[2]) << 8
		x |= uint64(buf[3])
		return x, nil
	case 2:
		n, err := reader.Read(buf[1:6])
		if err != nil {
			return 0, err
		}
		if n < 5 {
			return 0, io.ErrUnexpectedEOF
		}

		x := (uint64(buf[0]) & 0x3F) << 40
		x |= uint64(buf[1]) << 32
		x |= uint64(buf[2]) << 24
		x |= uint64(buf[3]) << 16
		x |= uint64(buf[4]) << 8
		x |= uint64(buf[5])
		return x, nil
	case 3:
		n, err := reader.Read(buf[1:9])
		if err != nil {
			return 0, err
		}
		if n < 8 {
			return 0, io.ErrUnexpectedEOF
		}

		x := (uint64(buf[0]) & 0x3F) << 58
		x |= uint64(buf[1]) << 50
		x |= uint64(buf[2]) << 42
		x |= uint64(buf[3]) << 34
		x |= uint64(buf[4]) << 26
		x |= uint64(buf[5]) << 18
		x |= uint64(buf[6]) << 10
		x |= uint64(buf[7]) << 2
		x |= uint64(buf[8])
		return x, nil
	default:
		return 0, fmt.Errorf("unexpected case")
	}
}