codegen: generalize extract_args for nested sexprs