package runtime

import (
	
	
	
)

type SliceHeader struct {
	Data unsafe.Pointer
	Len  int
	Cap  int
}

const (
	maxAcceptableTypeAddrRange = 1024 * 1024 * 2 // 2 Mib
)

type TypeAddr struct {
	BaseTypeAddr uintptr
	MaxTypeAddr  uintptr
	AddrRange    uintptr
	AddrShift    uintptr
}

var (
	typeAddr *TypeAddr
	once     sync.Once
)

//go:linkname typelinks reflect.typelinks
func typelinks() ([]unsafe.Pointer, [][]int32)

//go:linkname rtypeOff reflect.rtypeOff
func rtypeOff(unsafe.Pointer, int32) unsafe.Pointer

func () *TypeAddr {
	once.Do(func() {
		,  := typelinks()
		if len() != 1 {
			return
		}
		if len() != 1 {
			return
		}
		 := [0]
		 := [0]
		var (
			         uintptr = uintptr(^uint(0))
			         uintptr = 0
			         = true
			         = true
		)
		for  := 0;  < len(); ++ {
			 := (*Type)(rtypeOff(, []))
			 := uintptr(unsafe.Pointer())
			if  >  {
				 = 
			}
			if  <  {
				 = 
			}
			if .Kind() == reflect.Ptr {
				 = uintptr(unsafe.Pointer(.Elem()))
				if  >  {
					 = 
				}
				if  <  {
					 = 
				}
			}
			 =  && (-)&63 == 0
			 =  && (-)&31 == 0
		}
		 :=  - 
		if  == 0 {
			return
		}
		var  uintptr
		if  {
			 = 6
		} else if  {
			 = 5
		}
		 :=  >> 
		if  > maxAcceptableTypeAddrRange {
			return
		}
		typeAddr = &TypeAddr{
			BaseTypeAddr: ,
			MaxTypeAddr:  ,
			AddrRange:    ,
			AddrShift:    ,
		}
	})

	return typeAddr
}