// Copyright 2023 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 runtime

import 

func strmin(,  string) string {
	if  <  {
		return 
	}
	return 
}

func strmax(,  string) string {
	if  >  {
		return 
	}
	return 
}

func fmin32(,  float32) float32 { return fmin(, ) }
func fmin64(,  float64) float64 { return fmin(, ) }
func fmax32(,  float32) float32 { return fmax(, ) }
func fmax64(,  float64) float64 { return fmax(, ) }

type floaty interface{ ~float32 | ~float64 }

func fmin[ floaty](,  )  {
	if  !=  ||  <  {
		return 
	}
	if  !=  ||  <  ||  != 0 {
		return 
	}
	// x and y are both ±0
	// if either is -0, return -0; else return +0
	return forbits(, )
}

func fmax[ floaty](,  )  {
	if  !=  ||  >  {
		return 
	}
	if  !=  ||  >  ||  != 0 {
		return 
	}
	// x and y are both ±0
	// if both are -0, return -0; else return +0
	return fandbits(, )
}

func forbits[ floaty](,  )  {
	switch unsafe.Sizeof() {
	case 4:
		*(*uint32)(unsafe.Pointer(&)) |= *(*uint32)(unsafe.Pointer(&))
	case 8:
		*(*uint64)(unsafe.Pointer(&)) |= *(*uint64)(unsafe.Pointer(&))
	}
	return 
}

func fandbits[ floaty](,  )  {
	switch unsafe.Sizeof() {
	case 4:
		*(*uint32)(unsafe.Pointer(&)) &= *(*uint32)(unsafe.Pointer(&))
	case 8:
		*(*uint64)(unsafe.Pointer(&)) &= *(*uint64)(unsafe.Pointer(&))
	}
	return 
}