prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `FunctionNodeVisitor` visits twice `sqrt` body
  ### Version Information
  
  * vyper Version (output of `vyper --version`): 0.3.8+commit.d76c6ed2
  * OS: OSX
  * Python Version (output of `python --version`): 3.8.0
  
  ### What's your issue about?
  
  The `FunctionNodeVisitor` seems to visit twice the body of `sqrt` builtin, the first time is in the `__init__` function of the `FunctionNodeVisitor` and the second time after its creation using a `for` loop over its body.
  https://github.com/vyperlang/vyper/blob/187ab0eec8efbe19ed5046e4e947249e9d43141c/vyper/builtins/_utils.py#L28-L30
  
  https://github.com/vyperlang/vyper/blob/187ab0eec8efbe19ed5046e4e947249e9d43141c/vyper/semantics/analysis/local.py#L178-L179
  
  
  </issue>
  <code>
  [start of vyper/builtins/_utils.py]
  1 from vyper.ast import parse_to_ast
  2 from vyper.codegen.context import Context
  3 from vyper.codegen.global_context import GlobalContext
  4 from vyper.codegen.stmt import parse_body
  5 from vyper.semantics.analysis.local import FunctionNodeVisitor
  6 from vyper.semantics.namespace import Namespace, override_global_namespace
  7 from vyper.semantics.types.function import ContractFunctionT, FunctionVisibility, StateMutability
  8 
  9 
  10 def _strip_source_pos(ir_node):
  11     ir_node.source_pos = None
  12     for x in ir_node.args:
  13         _strip_source_pos(x)
  14 
  15 
  16 def generate_inline_function(code, variables, variables_2, memory_allocator):
  17     ast_code = parse_to_ast(code, add_fn_node="dummy_fn")
  18     # Annotate the AST with a temporary old (i.e. typecheck) namespace
  19     namespace = Namespace()
  20     namespace.update(variables_2)
  21     with override_global_namespace(namespace):
  22         # Initialise a placeholder `FunctionDef` AST node and corresponding
  23         # `ContractFunctionT` type to rely on the annotation visitors in semantics
  24         # module.
  25         ast_code.body[0]._metadata["type"] = ContractFunctionT(
  26             "sqrt_builtin", {}, 0, 0, None, FunctionVisibility.INTERNAL, StateMutability.NONPAYABLE
  27         )
  28         sv = FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)
  29         for n in ast_code.body[0].body:
  30             sv.visit(n)
  31 
  32     new_context = Context(
  33         vars_=variables, global_ctx=GlobalContext(), memory_allocator=memory_allocator
  34     )
  35     generated_ir = parse_body(ast_code.body[0].body, new_context)
  36     # strip source position info from the generated_ir since
  37     # it doesn't make any sense (e.g. the line numbers will start from 0
  38     # instead of where we are in the code)
  39     # NOTE if we ever use this for inlining user-code, it would make
  40     # sense to fix the offsets of the source positions in the generated
  41     # code instead of stripping them.
  42     _strip_source_pos(generated_ir)
  43     return new_context, generated_ir
  44
  [end of vyper/builtins/_utils.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/vyper/builtins/_utils.py b/vyper/builtins/_utils.py
  --- a/vyper/builtins/_utils.py
  +++ b/vyper/builtins/_utils.py
  @@ -25,9 +25,9 @@
           ast_code.body[0]._metadata["type"] = ContractFunctionT(
               "sqrt_builtin", {}, 0, 0, None, FunctionVisibility.INTERNAL, StateMutability.NONPAYABLE
           )
  -        sv = FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)
  -        for n in ast_code.body[0].body:
  -            sv.visit(n)
  +        # The FunctionNodeVisitor's constructor performs semantic checks
  +        # annotate the AST as side effects.
  +        FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)
   
       new_context = Context(
           vars_=variables, global_ctx=GlobalContext(), memory_allocator=memory_allocator
  
verification_info: {"golden_diff": "diff --git a/vyper/builtins/_utils.py b/vyper/builtins/_utils.py\n--- a/vyper/builtins/_utils.py\n+++ b/vyper/builtins/_utils.py\n@@ -25,9 +25,9 @@\n         ast_code.body[0]._metadata[\"type\"] = ContractFunctionT(\n             \"sqrt_builtin\", {}, 0, 0, None, FunctionVisibility.INTERNAL, StateMutability.NONPAYABLE\n         )\n-        sv = FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)\n-        for n in ast_code.body[0].body:\n-            sv.visit(n)\n+        # The FunctionNodeVisitor's constructor performs semantic checks\n+        # annotate the AST as side effects.\n+        FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)\n \n     new_context = Context(\n         vars_=variables, global_ctx=GlobalContext(), memory_allocator=memory_allocator\n", "issue": "`FunctionNodeVisitor` visits twice `sqrt` body\n### Version Information\r\n\r\n* vyper Version (output of `vyper --version`): 0.3.8+commit.d76c6ed2\r\n* OS: OSX\r\n* Python Version (output of `python --version`): 3.8.0\r\n\r\n### What's your issue about?\r\n\r\nThe `FunctionNodeVisitor` seems to visit twice the body of `sqrt` builtin, the first time is in the `__init__` function of the `FunctionNodeVisitor` and the second time after its creation using a `for` loop over its body.\r\nhttps://github.com/vyperlang/vyper/blob/187ab0eec8efbe19ed5046e4e947249e9d43141c/vyper/builtins/_utils.py#L28-L30\r\n\r\nhttps://github.com/vyperlang/vyper/blob/187ab0eec8efbe19ed5046e4e947249e9d43141c/vyper/semantics/analysis/local.py#L178-L179\r\n\n", "before_files": [{"content": "from vyper.ast import parse_to_ast\nfrom vyper.codegen.context import Context\nfrom vyper.codegen.global_context import GlobalContext\nfrom vyper.codegen.stmt import parse_body\nfrom vyper.semantics.analysis.local import FunctionNodeVisitor\nfrom vyper.semantics.namespace import Namespace, override_global_namespace\nfrom vyper.semantics.types.function import ContractFunctionT, FunctionVisibility, StateMutability\n\n\ndef _strip_source_pos(ir_node):\n    ir_node.source_pos = None\n    for x in ir_node.args:\n        _strip_source_pos(x)\n\n\ndef generate_inline_function(code, variables, variables_2, memory_allocator):\n    ast_code = parse_to_ast(code, add_fn_node=\"dummy_fn\")\n    # Annotate the AST with a temporary old (i.e. typecheck) namespace\n    namespace = Namespace()\n    namespace.update(variables_2)\n    with override_global_namespace(namespace):\n        # Initialise a placeholder `FunctionDef` AST node and corresponding\n        # `ContractFunctionT` type to rely on the annotation visitors in semantics\n        # module.\n        ast_code.body[0]._metadata[\"type\"] = ContractFunctionT(\n            \"sqrt_builtin\", {}, 0, 0, None, FunctionVisibility.INTERNAL, StateMutability.NONPAYABLE\n        )\n        sv = FunctionNodeVisitor(ast_code, ast_code.body[0], namespace)\n        for n in ast_code.body[0].body:\n            sv.visit(n)\n\n    new_context = Context(\n        vars_=variables, global_ctx=GlobalContext(), memory_allocator=memory_allocator\n    )\n    generated_ir = parse_body(ast_code.body[0].body, new_context)\n    # strip source position info from the generated_ir since\n    # it doesn't make any sense (e.g. the line numbers will start from 0\n    # instead of where we are in the code)\n    # NOTE if we ever use this for inlining user-code, it would make\n    # sense to fix the offsets of the source positions in the generated\n    # code instead of stripping them.\n    _strip_source_pos(generated_ir)\n    return new_context, generated_ir\n", "path": "vyper/builtins/_utils.py"}]}