HLS-Based Optimization and Design Space Exploration for Applications with Variable Loop Bounds