contract MakerFunctions {
	// KEYDONIX: Renamed from `rmul` for clarity
	// KEYDONIX: Changed ONE to 10**27 for clarity
	function safeMul27(uint x, uint y) internal pure returns (uint z) {
		z = safeMul(x, y) / 10 ** 27;
	}

	function rpow(uint x, uint n, uint base) internal pure returns (uint z) {
		assembly {
			switch x case 0 {switch n case 0 {z := base} default {z := 0}}
			default {
				switch mod(n, 2) case 0 { z := base } default { z := x }
				let half := div(base, 2)  // for rounding.
				for { n := div(n, 2) } n { n := div(n,2) } {
				let xx := mul(x, x)
				if iszero(eq(div(xx, x), x)) { revert(0,0) }
				let xxRound := add(xx, half)
				if lt(xxRound, xx) { revert(0,0) }
				x := div(xxRound, base)
				if mod(n,2) {
					let zx := mul(z, x)
					if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
					let zxRound := add(zx, half)
					if lt(zxRound, zx) { revert(0,0) }
					z := div(zxRound, base)
				}
			}
			}
		}
	}

	// KEYDONIX: Renamed from `mul` due to shadowing warning from Solidity
	function safeMul(uint x, uint y) internal pure returns (uint z) {
		require(y == 0 || (z = x * y) / y == x);
	}
}
function safeMul(uint x, uint y) internal pure returns (uint z) {
	require(y == 0 || (z = x * y) / y == x);
}

// KEYDONIX: Renamed from `mul` due to shadowing warning from Solidity