Lab4. Code optimization