code: func annotateAssembly(insns []plugin.Inst, samples nodes, base uint64) nodes {
  	// Add end marker to simplify printing loop.
  	insns = append(insns, plugin.Inst{^uint64(0), "", "", 0})
  
  	// Ensure samples are sorted by address.
  	samples.sort(addressOrder)
  
  	var s int
  	var asm nodes
  	for ix, in := range insns[:len(insns)-1] {
  		n := node{
  			info: nodeInfo{
  				address: in.Addr,
  				name:    in.Text,
  				file:    trimPath(in.File),
  				lineno:  in.Line,
  			},
  		}
  
  		// Sum all the samples until the next instruction (to account
  		// for samples attributed to the middle of an instruction).
  		for next := insns[ix+1].Addr; s < len(samples) && samples[s].info.address-base < next; s++ {
  			n.flat += samples[s].flat
  			n.cum += samples[s].cum
  			if samples[s].info.file != "" {
  				n.info.file = trimPath(samples[s].info.file)
  				n.info.lineno = samples[s].info.lineno
  			}
  		}
  		asm = append(asm, &n)
  	}
  
  	return asm
  }
docs: // annotateAssembly annotates a set of assembly instructions with a
  // set of samples. It returns a set of nodes to display.  base is an
  // offset to adjust the sample addresses.