Ab initio study of the O4 molecule