// Copyright 2025 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 strconv

import (
	
)

// Atoi64 parses an int64 from a string s.
// The bool result reports whether s is a number
// representable by a value of type int64.
func ( string) (int64, bool) {
	if  == "" {
		return 0, false
	}

	 := false
	if [0] == '-' {
		 = true
		 = [1:]
	}

	 := uint64(0)
	for  := 0;  < len(); ++ {
		 := []
		if  < '0' ||  > '9' {
			return 0, false
		}
		if  > math.MaxUint64/10 {
			// overflow
			return 0, false
		}
		 *= 10
		 :=  + uint64() - '0'
		if  <  {
			// overflow
			return 0, false
		}
		 = 
	}

	if ! &&  > uint64(math.MaxInt64) {
		return 0, false
	}
	if  &&  > uint64(math.MaxInt64)+1 {
		return 0, false
	}

	 := int64()
	if  {
		 = -
	}

	return , true
}

// Atoi is like Atoi64 but for integers
// that fit into an int.
func ( string) (int, bool) {
	if ,  := Atoi64();  == int64(int()) {
		return int(), 
	}
	return 0, false
}

// Atoi32 is like Atoi but for integers
// that fit into an int32.
func ( string) (int32, bool) {
	if ,  := Atoi64();  == int64(int32()) {
		return int32(), 
	}
	return 0, false
}