OptimUS: Optimization-Based Unlimited Sampling Algorithm