func (s Stack) StackPointerOffsetForC() uint {
	return s.untouchedSpace + s.freeSpace
}
Get offset to adjust Stack Pointer appropriately for C code
package main
import (
	"fmt"
	"regexp"
	"strconv"
)
type Epilogue struct {
	Pops             []string  
	SetRbpInstr      bool      
	StackSize        uint      
	AlignedStack     bool      
	AlignValue       uint      
	VZeroUpper       bool      
	Start, End       int       
	_missingPops     int       
	_stackGrowthSign int       
}
var regexpAddRsp = regexp.MustCompile(`^\s*add\s*rsp, ([0-9]+)$`)
var regexpAndRsp = regexp.MustCompile(`^\s*and\s*rsp, \-([0-9]+)$`)
var regexpSubRsp = regexp.MustCompile(`^\s*sub\s*rsp, ([0-9]+)$`)
var regexpLeaRsp = regexp.MustCompile(`^\s*lea\s*rsp, `)
var regexpPop = regexp.MustCompile(`^\s*pop\s*([a-z0-9]+)$`)
var regexpPush = regexp.MustCompile(`^\s*push\s*([a-z0-9]+)$`)
var regexpMov = regexp.MustCompile(`^\s*mov\s*([a-z0-9]+), ([a-z0-9]+)$`)
var regexpVZeroUpper = regexp.MustCompile(`^\s*vzeroupper\s*$`)
var regexpReturn = regexp.MustCompile(`^\s*ret\s*$`)
type Stack struct {
	alignedStack bool  
	goSavedSP      uint  
	goArgCopies    uint  
	localSpace     uint  
	freeSpace      uint  
	untouchedSpace uint  
}
func NewStack(epilogue Epilogue, arguments int, stackSpaceForCalls uint) Stack {
	s := Stack{localSpace: epilogue.StackSize, alignedStack: epilogue.AlignedStack, freeSpace: stackSpaceForCalls}
	if arguments-len(registers) > 0 {
		s.goArgCopies = uint(8 * (arguments - len(registers)))
	}
	if s.alignedStack {
		s.goSavedSP = originalStackPointer
		s.freeSpace = (s.freeSpace + epilogue.AlignValue - 1) & ^(epilogue.AlignValue - 1)
		s.untouchedSpace = epilogue.AlignValue
	} else {
		if s.freeSpace+s.localSpace+s.goArgCopies+s.goSavedSP > 0 {
			s.untouchedSpace = 8
		}
	}
	return s
}
func (s Stack) GolangLocalStackFrameSize() uint {
	return s.untouchedSpace + s.freeSpace + s.localSpace + s.goArgCopies + s.goSavedSP
}