You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: level3float64.go
    path of file: ./repos/gonum/blas/gonum
    
    the code of the file until where you have to start completion: // Copyright ©2014 The Gonum 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 gonum

import (
	"gonum.org/v1/gonum/blas"
	"gonum.org/v1/gonum/internal/asm/f64"
)

var _ blas.Float64Level3 = Implementation{}

// Dtrsm solves one of the matrix equations
//
//	A * X = alpha * B   if tA == blas.NoTrans and side == blas.Left
//	Aᵀ * X = alpha * B  if tA == blas.Trans or blas.ConjTrans, and side == blas.Left
//	X * A = alpha * B   if tA == blas.NoTrans and side == blas.Right
//	X * Aᵀ = alpha * B  if tA == blas.Trans or blas.ConjTrans, and side == blas.Right
//
// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a
// scalar.
//
// At entry to the function, X contains the values of B, and the result is
// stored in-place into X.
//
// No check is made that A is invertible.
func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) {
	if s != blas.Left && s != blas.Right {
		panic(badSide)
	}
	if ul != blas.Lower && ul != blas.Upper {
		panic(badUplo)
	}
	if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans {
		panic(badTranspose)
	}
	if d != blas.NonUnit && d != blas.Unit {
		panic(badDiag)
	}
	if m < 0 {
		panic(mLT0)
	}
	if n < 0 {
		panic(nLT0)
	}
	k := n
	if s == blas.Left {
		k = m
	}
	if lda < max(1, k) {
		panic(badLdA)
	}
	if ldb < max(1, n) {
		panic(badLdB)
	}

	// Quick return if possible.
	if m == 0 || n == 0 {
		return
	}

	// For zero matrix size the following slice length checks are trivially satisfied.
	if len(a) < lda*(k-1)+k {
		panic(shortA)
	}
	if len(b) < ldb*(m-1)+n {
		panic(shortB)
	}

	if alpha == 0 {
		for i := 0; i < m; i++ {
			btmp := b[i*ldb : i*ldb+n]
			for j := range btmp {
				btmp[j] = 0
			}
		}
		return
	}
	nonUnit := d == blas.NonUnit
	if s == blas.Left {
		if tA == blas.NoTrans {
			if ul == blas.Upper {
				for i := m - 1; i >= 0; i-- {
					btmp := b[i*ldb : i*ldb+n]
					if alpha != 1 {
						f64.ScalUnitary(alpha, btmp)
					}
					for ka, va := range a[i*lda+i+1 : i*lda+m] {
						if va != 0 {
							k := ka + i + 1
							f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp)
						}
					}
					if nonUnit {
						tmp := 1 / a[i*lda+i]
						f64.ScalUnitary(tmp, btmp)
					}
				}
				return
			}
			for i := 0; i < m; i++ {
				btmp := b[i*ldb : i*ldb+n]
				if alpha != 1 {
					f64.ScalUnitary(alpha, btmp)
				}
				for k, va := range a[i*lda : i*lda+i] {
					if va != 0 {
						f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp)
					}
				}
				if nonUnit {
					tmp := 1 / a[i*lda+i]
					f64.ScalUnitary(tmp, btmp)
				}
			}
			return
		}
		// Cases where a is transposed
		if ul == blas.Upper {
			for k := 0; k < m; k++ {
				btmpk := b[k*ldb : k*ldb+n]
				if nonUnit {
					tmp := 1 / a[k*lda+k]
					f64.ScalUnitary(tmp, btmpk)
				}
				for ia, va := range a[k*lda+k+1 : k*lda+m] {
					if va != 0 {
						i := ia + k + 1
						f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n])
					}
				}
				if alpha != 1 {
					f64.ScalUnitary(alpha, btmpk)
				}
			}
			return
		}
		for k := m - 1; k >= 0; k-- {
			btmpk := b[k*ldb : k*ldb+n]
			if nonUnit {
				tmp := 1 / a[k*lda+k]
				f64.ScalUnitary(tmp, btmpk)
			}
			for i, va := range a[k*lda : k*lda+k] {
				if va != 0 {
					f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n])
				}
			}
			if alpha != 1 {
				f64.ScalUnitary(alpha, btmpk)
			}
		}
		return
	}
	// Cases where a is to the right of X.
	if tA == blas.NoTrans {
		if ul == blas.Upper {
			for i := 0; i < m; i++ {
				btmp := b[i*ldb : 
    
func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) {
	if s != blas.Left && s != blas.Right {
		panic(badSide)
	}
	if ul != blas.Lower && ul != blas.Upper {
		panic(badUplo)
	}
	if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans {
		panic(badTranspose)
	}
	if d != blas.NonUnit && d != blas.Unit {
		panic(badDiag)
	}
	if m < 0 {
		panic(mLT0)
	}
	if n < 0 {
		panic(nLT0)
	}
	k := n
	if s == blas.Left {
		k = m
	}
	if lda < max(1, k) {
		panic(badLdA)
	}
	if ldb < max(1, n) {
		panic(badLdB)
	}

	// Quick return if possible.
	if m == 0 || n == 0 {
		return
	}

	// For zero matrix size the following slice length checks are trivially satisfied.
	if len(a) < lda*(k-1)+k {
		panic(shortA)
	}
	if len(b) < ldb*(m-1)+n {
		panic(shortB)
	}

	if alpha == 0 {
		for i := 0; i < m; i++ {
			btmp := b[i*ldb : i*ldb+n]
			for j := range btmp {
				btmp[j] = 0
			}
		}
		return
	}
	nonUnit := d == blas.NonUnit
	if s == blas.Left {
		if tA == blas.NoTrans {
			if ul == blas.Upper {
				for i := m - 1; i >= 0; i-- {
					btmp := b[i*ldb : i*ldb+n]
					if alpha != 1 {
						f64.ScalUnitary(alpha, btmp)
					}
					for ka, va := range a[i*lda+i+1 : i*lda+m] {
						if va != 0 {
							k := ka + i + 1
							f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp)
						}
					}
					if nonUnit {
						tmp := 1 / a[i*lda+i]
						f64.ScalUnitary(tmp, btmp)
					}
				}
				return
			}
			for i := 0; i < m; i++ {
				btmp := b[i*ldb : i*ldb+n]
				if alpha != 1 {
					f64.ScalUnitary(alpha, btmp)
				}
				for k, va := range a[i*lda : i*lda+i] {
					if va != 0 {
						f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp)
					}
				}
				if nonUnit {
					tmp := 1 / a[i*lda+i]
					f64.ScalUnitary(tmp, btmp)
				}
			}
			return
		}
		// Cases where a is transposed
		if ul == blas.Upper {
			for k := 0; k < m; k++ {
				btmpk := b[k*ldb : k*ldb+n]
				if nonUnit {
					tmp := 1 / a[k*lda+k]
					f64.ScalUnitary(tmp, btmpk)
				}
				for ia, va := range a[k*lda+k+1 : k*lda+m] {
					if va != 0 {
						i := ia + k + 1
						f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n])
					}
				}
				if alpha != 1 {
					f64.ScalUnitary(alpha, btmpk)
				}
			}
			return
		}
		for k := m - 1; k >= 0; k-- {
			btmpk := b[k*ldb : k*ldb+n]
			if nonUnit {
				tmp := 1 / a[k*lda+k]
				f64.ScalUnitary(tmp, btmpk)
			}
			for i, va := range a[k*lda : k*lda+k] {
				if va != 0 {
					f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n])
				}
			}
			if alpha != 1 {
				f64.ScalUnitary(alpha, btmpk)
			}
		}
		return
	}
	// Cases where a is to the right of X.
	if tA == blas.NoTrans {
		if ul == blas.Upper {
			for i := 0; i < m; i++ {
				btmp := b[i*ldb : i*ldb+n]
				if alpha != 1 {
					f64.ScalUnitary(alpha, btmp)
				}
				for k, vb := range btmp {
					if vb == 0 {
						continue
					}
					if nonUnit {
						btmp[k] /= a[k*lda+k]
					}
					f64.AxpyUnitary(-btmp[k], a[k*lda+k+1:k*lda+n], btmp[k+1:n])
				}
			}
			return
		}
		for i := 0; i < m; i++ {
			btmp := b[i*ldb : i*ldb+n]
			if alpha != 1 {
				f64.ScalUnitary(alpha, btmp)
			}
			for k := n - 1; k >= 0; k-- {
				if btmp[k] == 0 {
					continue
				}
				if nonUnit {
					btmp[k] /= a[k*lda+k]
				}
				f64.AxpyUnitary(-btmp[k], a[k*lda:k*lda+k], btmp[:k])
			}
		}
		return
	}
	// Cases where a is transposed.
	if ul == blas.Upper {
		for i := 0; i < m; i++ {
			btmp := b[i*ldb : i*ldb+n]
			for j := n - 1; j >= 0; j-- {
				tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:])
				if nonUnit {
					tmp /= a[j*lda+j]
				}
				btmp[j] = tmp
			}
		}
		return
	}
	for i := 0; i < m; i++ {
		btmp := b[i*ldb : i*ldb+n]
		for j := 0; j < n; j++ {
			tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda:j*lda+j], btmp[:j])
			if nonUnit {
				tmp /= a[j*lda+j]
			}
			btmp[j] = tmp
		}
	}
}