input: 
  def optimize_code(given_code: str) -> str:
      """
      Optimize a given Python code snippet based on predefined rules.
      
      >>> optimize_code("def getResult(a, b, c): return a + b + c")
      "from dataclasses import dataclass\n@dataclass\nclass Params: a: int; b: int; c: int\ndef get_result(params: Params) -> int: return params.a + params.b + params.c"
      """
  
output:     import ast
      import astor
  
      class CodeOptimizer(ast.NodeTransformer):
          def visit_FunctionDef(self, node):
              if len(node.args.args) > 1:
                  params = [ast.arg(arg=arg.arg, annotation=arg.annotation) for arg in node.args.args]
                  params_class = ast.ClassDef(
                      name='Params',
                      bases=[],
                      keywords=[],
                      body=[ast.AnnAssign(target=ast.Name(id=param.arg, ctx=ast.Store()), annotation=param.annotation, simple=1) for param in params],
                      decorator_list=[ast.parse('dataclasses.dataclass').body[0].value]
                  )
                  new_func_args = [ast.arg(arg='params', annotation=ast.Name(id='Params', ctx=ast.Load()))]
                  new_func_body = [ast.Return(value=ast.BinOp(
                      left=ast.Attribute(value=ast.Name(id='params', ctx=ast.Load()), attr=params[0].arg, ctx=ast.Load()),
                      op=ast.Add(),
                      right=ast.BinOp(
                          left=ast.Attribute(value=ast.Name(id='params', ctx=ast.Load()), attr=params[1].arg, ctx=ast.Load()),
                          op=ast.Add(),
                          right=ast.Attribute(value=ast.Name(id='params', ctx=ast.Load()), attr=params[2].arg, ctx=ast.Load())
                      )
                  ))]
                  new_func = ast.FunctionDef(
                      name='get_result',
                      args=ast.arguments(args=new_func_args, vararg=None, kwonlyargs=[], kw_defaults=[], kwarg=None, defaults=[]),
                      body=new_func_body,
                      decorator_list=[],
                      returns=ast.Name(id='int', ctx=ast.Load())
                  )
                  return [params_class, new_func]
              return node
  
      tree = ast.parse(given_code)
      optimizer = CodeOptimizer()
      optimized_tree = optimizer.visit(tree)
      ast.fix_missing_locations(optimized_tree)
      return astor.to_source(optimized_tree).strip()