func read(fd FD) (uint8, uint64) {
	rd := 0
	var buf [9]byte
	for rd != len(buf) {
		n, err := fd.read(buf[rd:])
		if err == syscall.EINTR {
			continue
		}
		if n == 0 {
			syscall.Exit(1)
		}
		if err != nil {
			println("failed to read fd =", fd, "errno =", err.(syscall.Errno))
			syscall.Exit(1)
		}
		rd += n
	}
	return buf[0], deserialize64(buf[1:])
}
read reads little-endian-encoded uint8+uint64 from fd.
package gofuzzdep
import (
	"runtime"
	"sync/atomic"
	"syscall"
	"time"
	"unsafe"
	. "github.com/dvyukov/go-fuzz/go-fuzz-defs"
)
func Main(fns []func([]byte) int) {
	mem, inFD, outFD := setupCommFile()
	CoverTab = (*[CoverSize]byte)(unsafe.Pointer(&mem[0]))
	input := mem[CoverSize : CoverSize+MaxInputSize]
	sonarRegion = mem[CoverSize+MaxInputSize:]
	runtime.GOMAXPROCS(1)  
	for {
		fnidx, n := read(inFD)
		if n > uint64(len(input)) {
			println("invalid input length")
			syscall.Exit(1)
		}
		for i := range CoverTab {
			CoverTab[i] = 0
		}
		atomic.StoreUint32(&sonarPos, 0)
		t0 := time.Now()
		res := fns[fnidx](input[:n:n])
		ns := time.Since(t0)
		write(outFD, uint64(res), uint64(ns), uint64(atomic.LoadUint32(&sonarPos)))
	}
}