initialize val, close buffer boundary
add -Os to CFLAGS