code: func byteswapreg(ctxt *liblink.Link, a *liblink.Addr) int {
  	var cana int
  	var canb int
  	var canc int
  	var cand int
  	cand = 1
  	canc = cand
  	canb = canc
  	cana = canb
  	switch a.Typ {
  	case D_NONE:
  		cand = 0
  		cana = cand
  	case D_AX,
  		D_AL,
  		D_AH,
  		D_INDIR + D_AX:
  		cana = 0
  	case D_BX,
  		D_BL,
  		D_BH,
  		D_INDIR + D_BX:
  		canb = 0
  	case D_CX,
  		D_CL,
  		D_CH,
  		D_INDIR + D_CX:
  		canc = 0
  	case D_DX,
  		D_DL,
  		D_DH,
  		D_INDIR + D_DX:
  		cand = 0
  		break
  	}
  	switch a.Index {
  	case D_AX:
  		cana = 0
  	case D_BX:
  		canb = 0
  	case D_CX:
  		canc = 0
  	case D_DX:
  		cand = 0
  		break
  	}
  	if cana != 0 {
  		return D_AX
  	}
  	if canb != 0 {
  		return D_BX
  	}
  	if canc != 0 {
  		return D_CX
  	}
  	if cand != 0 {
  		return D_DX
  	}
  	ctxt.Diag("impossible byte register")
  	log.Fatalf("bad code")
  	return 0
  }
docs: // byteswapreg returns a byte-addressable register (AX, BX, CX, DX)
  // which is not referenced in a->type.
  // If a is empty, it returns BX to account for MULB-like instructions
  // that might use DX and AX.