Enhancing Software Security Through Code Diversification Verification, Control-Flow Restriction, And Automatic Compartmentalization