// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package bpf

import 

// Assemble converts insts into raw instructions suitable for loading
// into a BPF virtual machine.
//
// Currently, no optimization is attempted, the assembled program flow
// is exactly as provided.
func ( []Instruction) ([]RawInstruction, error) {
	 := make([]RawInstruction, len())
	var  error
	for ,  := range  {
		[],  = .Assemble()
		if  != nil {
			return nil, fmt.Errorf("assembling instruction %d: %s", +1, )
		}
	}
	return , nil
}

// Disassemble attempts to parse raw back into
// Instructions. Unrecognized RawInstructions are assumed to be an
// extension not implemented by this package, and are passed through
// unchanged to the output. The allDecoded value reports whether insts
// contains no RawInstructions.
func ( []RawInstruction) ( []Instruction,  bool) {
	 = make([]Instruction, len())
	 = true
	for ,  := range  {
		[] = .Disassemble()
		if ,  := [].(RawInstruction);  {
			 = false
		}
	}
	return , 
}