Run these commands to compare the compiled bytecodes:
solc --bin-runtime --via-ir --optimize --optimize-runs 999999 --metadata-hash none src/Casting.sol
solc --bin-runtime --via-ir --optimize --optimize-runs 999999 --metadata-hash none src/Casting2.sol