A man found by police in his car losing consciousness had to have part of his penis glued back together after he was attacked by another man during a heated confrontation, a court has been told.