codegen: refactor box_value a bit to make llval flow