You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: racewalk.go
    path of file: ./repos/under-the-hood/gosrc/cmd/compile/internal/gc
    
    the code of the file until where you have to start completion: // Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package gc

import (
	"cmd/compile/internal/types"
	"cmd/internal/src"
	"cmd/internal/sys"
)

// The racewalk pass is currently handled in three parts.
//
// First, 
    
func instrument(fn *Node) {
	if fn.Func.Pragma&Norace != 0 {
		return
	}

	if !flag_race || !ispkgin(norace_inst_pkgs) {
		fn.Func.SetInstrumentBody(true)
	}

	if flag_race {
		lno := lineno
		lineno = src.NoXPos

		if thearch.LinkArch.Arch.Family != sys.AMD64 {
			fn.Func.Enter.Prepend(mkcall("racefuncenterfp", nil, nil))
			fn.Func.Exit.Append(mkcall("racefuncexit", nil, nil))
		} else {

			// nodpc is the PC of the caller as extracted by
			// getcallerpc. We use -widthptr(FP) for x86.
			// This only works for amd64. This will not
			// work on arm or others that might support
			// race in the future.
			nodpc := nodfp.copy()
			nodpc.Type = types.Types[TUINTPTR]
			nodpc.Xoffset = int64(-Widthptr)
			fn.Func.Dcl = append(fn.Func.Dcl, nodpc)
			fn.Func.Enter.Prepend(mkcall("racefuncenter", nil, nil, nodpc))
			fn.Func.Exit.Append(mkcall("racefuncexit", nil, nil))
		}
		lineno = lno
	}
}