//go:build amd64 && !purego
// +build amd64,!purego

package base64

import (
	

	
	
)

const (
	encLutSize   = 32
	decLutSize   = 48
	minEncodeLen = 28
	minDecodeLen = 45
)

func ( string) *Encoding {
	 := &Encoding{base: base64.NewEncoding()}
	if cpu.X86.Has(x86.AVX2) {
		.enableEncodeAVX2()
		.enableDecodeAVX2()
	}
	return 
}

func ( *Encoding) ( string) {
	// Translate values 0..63 to the Base64 alphabet. There are five sets:
	//
	// From      To         Add    Index  Example
	// [0..25]   [65..90]   +65        0  ABCDEFGHIJKLMNOPQRSTUVWXYZ
	// [26..51]  [97..122]  +71        1  abcdefghijklmnopqrstuvwxyz
	// [52..61]  [48..57]    -4  [2..11]  0123456789
	// [62]      [43]       -19       12  +
	// [63]      [47]       -16       13  /
	 := [encLutSize]int8{int8([0]), int8([letterRange]) - letterRange}
	for ,  := range [2*letterRange:] {
		[2+] = int8() - 2*letterRange - int8()
	}

	.enc = encodeAVX2
	.enclut = 
}

func ( *Encoding) ( string) {
	,  := int8([62]), int8([63])
	 :=  == '_'
	if  {
		 = '/'
	}

	// Translate values from the Base64 alphabet using five sets. Values outside
	// of these ranges are considered invalid:
	//
	// From       To        Add    Index  Example
	// [47]       [63]      +16        1  /
	// [43]       [62]      +19        2  +
	// [48..57]   [52..61]   +4        3  0123456789
	// [65..90]   [0..25]   -65      4,5  ABCDEFGHIJKLMNOPQRSTUVWXYZ
	// [97..122]  [26..51]  -71      6,7  abcdefghijklmnopqrstuvwxyz
	 := [decLutSize]int8{
		0, 63 - , 62 - , 4, -65, -65, -71, -71,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x15, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
		0x11, 0x11, 0x13, 0x1B, 0x1B, 0x1B, 0x1B, 0x1B,
	}
	[(&15)+16] = 0x1A
	[(&15)+16] = 0x1A

	if  {
		.dec = decodeAVX2URI
	} else {
		.dec = decodeAVX2
	}
	.declut = 
}