// Generated by Lisette bindgen
// Source: math/bits (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.20

/// Add returns the sum with carry of x, y and carry: sum = x + y + carry.
/// The carry input must be 0 or 1; otherwise the behavior is undefined.
/// The carryOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Add(x: uint, y: uint, carry: uint) -> (uint, uint)

/// Add32 returns the sum with carry of x, y and carry: sum = x + y + carry.
/// The carry input must be 0 or 1; otherwise the behavior is undefined.
/// The carryOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Add32(x: uint32, y: uint32, carry: uint32) -> (uint32, uint32)

/// Add64 returns the sum with carry of x, y and carry: sum = x + y + carry.
/// The carry input must be 0 or 1; otherwise the behavior is undefined.
/// The carryOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Add64(x: uint64, y: uint64, carry: uint64) -> (uint64, uint64)

/// Div returns the quotient and remainder of (hi, lo) divided by y:
/// quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper
/// half in parameter hi and the lower half in parameter lo.
/// Div panics for y == 0 (division by zero) or y <= hi (quotient overflow).
pub fn Div(hi: uint, lo: uint, y: uint) -> (uint, uint)

/// Div32 returns the quotient and remainder of (hi, lo) divided by y:
/// quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper
/// half in parameter hi and the lower half in parameter lo.
/// Div32 panics for y == 0 (division by zero) or y <= hi (quotient overflow).
pub fn Div32(hi: uint32, lo: uint32, y: uint32) -> (uint32, uint32)

/// Div64 returns the quotient and remainder of (hi, lo) divided by y:
/// quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper
/// half in parameter hi and the lower half in parameter lo.
/// Div64 panics for y == 0 (division by zero) or y <= hi (quotient overflow).
pub fn Div64(hi: uint64, lo: uint64, y: uint64) -> (uint64, uint64)

/// LeadingZeros returns the number of leading zero bits in x; the result is [UintSize] for x == 0.
pub fn LeadingZeros(x: uint) -> int

/// LeadingZeros16 returns the number of leading zero bits in x; the result is 16 for x == 0.
pub fn LeadingZeros16(x: uint16) -> int

/// LeadingZeros32 returns the number of leading zero bits in x; the result is 32 for x == 0.
pub fn LeadingZeros32(x: uint32) -> int

/// LeadingZeros64 returns the number of leading zero bits in x; the result is 64 for x == 0.
pub fn LeadingZeros64(x: uint64) -> int

/// LeadingZeros8 returns the number of leading zero bits in x; the result is 8 for x == 0.
pub fn LeadingZeros8(x: uint8) -> int

/// Len returns the minimum number of bits required to represent x; the result is 0 for x == 0.
pub fn Len(x: uint) -> int

/// Len16 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
pub fn Len16(x: uint16) -> int

/// Len32 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
pub fn Len32(x: uint32) -> int

/// Len64 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
pub fn Len64(x: uint64) -> int

/// Len8 returns the minimum number of bits required to represent x; the result is 0 for x == 0.
pub fn Len8(x: uint8) -> int

/// Mul returns the full-width product of x and y: (hi, lo) = x * y
/// with the product bits' upper half returned in hi and the lower
/// half returned in lo.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Mul(x: uint, y: uint) -> (uint, uint)

/// Mul32 returns the 64-bit product of x and y: (hi, lo) = x * y
/// with the product bits' upper half returned in hi and the lower
/// half returned in lo.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Mul32(x: uint32, y: uint32) -> (uint32, uint32)

/// Mul64 returns the 128-bit product of x and y: (hi, lo) = x * y
/// with the product bits' upper half returned in hi and the lower
/// half returned in lo.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Mul64(x: uint64, y: uint64) -> (uint64, uint64)

/// OnesCount returns the number of one bits ("population count") in x.
pub fn OnesCount(x: uint) -> int

/// OnesCount16 returns the number of one bits ("population count") in x.
pub fn OnesCount16(x: uint16) -> int

/// OnesCount32 returns the number of one bits ("population count") in x.
pub fn OnesCount32(x: uint32) -> int

/// OnesCount64 returns the number of one bits ("population count") in x.
pub fn OnesCount64(x: uint64) -> int

/// OnesCount8 returns the number of one bits ("population count") in x.
pub fn OnesCount8(x: uint8) -> int

/// Rem returns the remainder of (hi, lo) divided by y. Rem panics for
/// y == 0 (division by zero) but, unlike Div, it doesn't panic on a
/// quotient overflow.
pub fn Rem(hi: uint, lo: uint, y: uint) -> uint

/// Rem32 returns the remainder of (hi, lo) divided by y. Rem32 panics
/// for y == 0 (division by zero) but, unlike [Div32], it doesn't panic
/// on a quotient overflow.
pub fn Rem32(hi: uint32, lo: uint32, y: uint32) -> uint32

/// Rem64 returns the remainder of (hi, lo) divided by y. Rem64 panics
/// for y == 0 (division by zero) but, unlike [Div64], it doesn't panic
/// on a quotient overflow.
pub fn Rem64(hi: uint64, lo: uint64, y: uint64) -> uint64

/// Reverse returns the value of x with its bits in reversed order.
pub fn Reverse(x: uint) -> uint

/// Reverse16 returns the value of x with its bits in reversed order.
pub fn Reverse16(x: uint16) -> uint16

/// Reverse32 returns the value of x with its bits in reversed order.
pub fn Reverse32(x: uint32) -> uint32

/// Reverse64 returns the value of x with its bits in reversed order.
pub fn Reverse64(x: uint64) -> uint64

/// Reverse8 returns the value of x with its bits in reversed order.
pub fn Reverse8(x: uint8) -> uint8

/// ReverseBytes returns the value of x with its bytes in reversed order.
/// 
/// This function's execution time does not depend on the inputs.
pub fn ReverseBytes(x: uint) -> uint

/// ReverseBytes16 returns the value of x with its bytes in reversed order.
/// 
/// This function's execution time does not depend on the inputs.
pub fn ReverseBytes16(x: uint16) -> uint16

/// ReverseBytes32 returns the value of x with its bytes in reversed order.
/// 
/// This function's execution time does not depend on the inputs.
pub fn ReverseBytes32(x: uint32) -> uint32

/// ReverseBytes64 returns the value of x with its bytes in reversed order.
/// 
/// This function's execution time does not depend on the inputs.
pub fn ReverseBytes64(x: uint64) -> uint64

/// RotateLeft returns the value of x rotated left by (k mod [UintSize]) bits.
/// To rotate x right by k bits, call RotateLeft(x, -k).
/// 
/// This function's execution time does not depend on the inputs.
pub fn RotateLeft(x: uint, k: int) -> uint

/// RotateLeft16 returns the value of x rotated left by (k mod 16) bits.
/// To rotate x right by k bits, call RotateLeft16(x, -k).
/// 
/// This function's execution time does not depend on the inputs.
pub fn RotateLeft16(x: uint16, k: int) -> uint16

/// RotateLeft32 returns the value of x rotated left by (k mod 32) bits.
/// To rotate x right by k bits, call RotateLeft32(x, -k).
/// 
/// This function's execution time does not depend on the inputs.
pub fn RotateLeft32(x: uint32, k: int) -> uint32

/// RotateLeft64 returns the value of x rotated left by (k mod 64) bits.
/// To rotate x right by k bits, call RotateLeft64(x, -k).
/// 
/// This function's execution time does not depend on the inputs.
pub fn RotateLeft64(x: uint64, k: int) -> uint64

/// RotateLeft8 returns the value of x rotated left by (k mod 8) bits.
/// To rotate x right by k bits, call RotateLeft8(x, -k).
/// 
/// This function's execution time does not depend on the inputs.
pub fn RotateLeft8(x: uint8, k: int) -> uint8

/// Sub returns the difference of x, y and borrow: diff = x - y - borrow.
/// The borrow input must be 0 or 1; otherwise the behavior is undefined.
/// The borrowOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Sub(x: uint, y: uint, borrow: uint) -> (uint, uint)

/// Sub32 returns the difference of x, y and borrow, diff = x - y - borrow.
/// The borrow input must be 0 or 1; otherwise the behavior is undefined.
/// The borrowOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Sub32(x: uint32, y: uint32, borrow: uint32) -> (uint32, uint32)

/// Sub64 returns the difference of x, y and borrow: diff = x - y - borrow.
/// The borrow input must be 0 or 1; otherwise the behavior is undefined.
/// The borrowOut output is guaranteed to be 0 or 1.
/// 
/// This function's execution time does not depend on the inputs.
pub fn Sub64(x: uint64, y: uint64, borrow: uint64) -> (uint64, uint64)

/// TrailingZeros returns the number of trailing zero bits in x; the result is [UintSize] for x == 0.
pub fn TrailingZeros(x: uint) -> int

/// TrailingZeros16 returns the number of trailing zero bits in x; the result is 16 for x == 0.
pub fn TrailingZeros16(x: uint16) -> int

/// TrailingZeros32 returns the number of trailing zero bits in x; the result is 32 for x == 0.
pub fn TrailingZeros32(x: uint32) -> int

/// TrailingZeros64 returns the number of trailing zero bits in x; the result is 64 for x == 0.
pub fn TrailingZeros64(x: uint64) -> int

/// TrailingZeros8 returns the number of trailing zero bits in x; the result is 8 for x == 0.
pub fn TrailingZeros8(x: uint8) -> int

/// UintSize is the size of a uint in bits.
const UintSize = 64
