In-game, while killing zombified piglins (used Looting 3, Sharpness 4, Unbreaking 3, Mending 1, Knockback 2 sword), 3 golden swords were dropped. One is enchanted with sharp 2 (swordB), the two others are not enchanted (swordA and swordC). swordA and swordB both have durabilities 0/32 (shown in screenshots "swordA"&"swordB"), which is not correct since the tool breaks at 0 durability. swordC had durability 1/32 (screenshot "swordC"). I renamed the swords from "Golden Sword" to the corresponding names on an anvil, and proceeded to experiment.
Experiments:
Shown in attached screenshots, indicated by png name (ex. screenshot "a+b_crafting" is swordA and swordB being combined in a crafting table; screenshot "a+c_anvil" is swordA and swordC being combined on an anvil). Results are not what I have expected (combining durabilities, the numbers doesn't add up correctly).
Note: My client is modded with mainly optomization mods. If mod names and versions needed, please comment and I will add screenshots.