code: func (p *Profile) setMain() {
  	for i := 0; i < len(p.Mapping); i++ {
  		file := strings.TrimSpace(strings.Replace(p.Mapping[i].File, "(deleted)", "", -1))
  		if len(file) == 0 {
  			continue
  		}
  		if len(libRx.FindStringSubmatch(file)) > 0 {
  			continue
  		}
  		if strings.HasPrefix(file, "[") {
  			continue
  		}
  		// Swap what we guess is main to position 0.
  		tmp := p.Mapping[i]
  		p.Mapping[i] = p.Mapping[0]
  		p.Mapping[0] = tmp
  		break
  	}
  }
docs: // setMain scans Mapping entries and guesses which entry is main
  // because legacy profiles don't obey the convention of putting main
  // first.