// autogenerated from gen/dec.rules: do not edit!
// generated with: cd gen; go run *.go

package ssa

import "math"

var _ = math.MinInt8 // in case not otherwise used
func rewriteValuedec(v *Value, config *Config) bool {
	switch v.Op {
	case OpSliceCap:
		return rewriteValuedec_OpSliceCap(v, config)
	case OpSliceLen:
		return rewriteValuedec_OpSliceLen(v, config)
	case OpSlicePtr:
		return rewriteValuedec_OpSlicePtr(v, config)
	case OpStringLen:
		return rewriteValuedec_OpStringLen(v, config)
	case OpStringPtr:
		return rewriteValuedec_OpStringPtr(v, config)
	}
	return false
}
func rewriteValuedec_OpSliceCap(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SliceCap (SliceMake _ _ cap))
	// cond:
	// result: cap
	for {
		if v.Args[0].Op != OpSliceMake {
			break
		}
		cap := v.Args[0].Args[2]
		v.reset(OpCopy)
		v.Type = cap.Type
		v.AddArg(cap)
		return true
	}
	return false
}
func rewriteValuedec_OpSliceLen(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SliceLen (SliceMake _ len _))
	// cond:
	// result: len
	for {
		if v.Args[0].Op != OpSliceMake {
			break
		}
		len := v.Args[0].Args[1]
		v.reset(OpCopy)
		v.Type = len.Type
		v.AddArg(len)
		return true
	}
	return false
}
func rewriteValuedec_OpSlicePtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (SlicePtr (SliceMake ptr _ _ ))
	// cond:
	// result: ptr
	for {
		if v.Args[0].Op != OpSliceMake {
			break
		}
		ptr := v.Args[0].Args[0]
		v.reset(OpCopy)
		v.Type = ptr.Type
		v.AddArg(ptr)
		return true
	}
	return false
}
func rewriteValuedec_OpStringLen(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (StringLen (StringMake _ len))
	// cond:
	// result: len
	for {
		if v.Args[0].Op != OpStringMake {
			break
		}
		len := v.Args[0].Args[1]
		v.reset(OpCopy)
		v.Type = len.Type
		v.AddArg(len)
		return true
	}
	return false
}
func rewriteValuedec_OpStringPtr(v *Value, config *Config) bool {
	b := v.Block
	_ = b
	// match: (StringPtr (StringMake ptr _))
	// cond:
	// result: ptr
	for {
		if v.Args[0].Op != OpStringMake {
			break
		}
		ptr := v.Args[0].Args[0]
		v.reset(OpCopy)
		v.Type = ptr.Type
		v.AddArg(ptr)
		return true
	}
	return false
}
func rewriteBlockdec(b *Block) bool {
	switch b.Kind {
	}
	return false
}
