// File: jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: SleighCompile::createMacro(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)
MacroSymbol *SleighCompile::createMacro(string *name,vector<string> *params)

{				// create a macro symbol (with parameter names)
  curct = (Constructor *)0;	// Not currently defining a Constructor
  curmacro = new MacroSymbol(*name,macrotable.size());
  delete name;
  addSymbol(curmacro);
  symtab.addScope();		// New scope for the body of the macro definition
  pcode.resetLabelCount();	// Macros have their own labels
  for(int4 i=0;i<params->size();++i) {
    OperandSymbol *oper = new OperandSymbol((*params)[i],i,(Constructor *)0);
    addSymbol(oper);
    curmacro->addOperand(oper);
  }
  delete params;
  return curmacro;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, 0x2d0(%rax)
movl $0x58, %edi
callq 0x11440
movq -0x50(%rbp), %rdi
movq %rax, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
addq $0x258, %rdi            # imm = 0x258
callq 0x6c460
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl %eax, %edx
callq 0x6c480
jmp 0x65fc5
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x2d8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x65ff9
movq -0x58(%rbp), %rdi
callq 0x11300
movq -0x58(%rbp), %rdi
movl $0x20, %esi
callq 0x11450
movq -0x50(%rbp), %rdi
movq 0x2d8(%rdi), %rsi
callq 0x60f90
movq -0x50(%rbp), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0xa2b60
movq -0x50(%rbp), %rdi
addq $0x1e0, %rdi            # imm = 0x1E0
callq 0x48050
movl $0x0, -0x28(%rbp)
movslq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x15090
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
jae 0x660f4
movl $0x60, %edi
callq 0x11440
movq %rax, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x28(%rbp), %rsi
callq 0x1bb40
movq -0x68(%rbp), %rdi
movq %rax, %rsi
movl -0x28(%rbp), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0xa81d0
jmp 0x66085
movq -0x50(%rbp), %rdi
movq -0x70(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
callq 0x60f90
movq -0x50(%rbp), %rax
movq 0x2d8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x6c4e0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x66030
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x58, %esi
callq 0x11450
jmp 0x6612d
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x60, %esi
callq 0x11450
jmp 0x6612d
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x66119
movq -0x78(%rbp), %rdi
callq 0x1bc40
movq -0x78(%rbp), %rdi
movl $0x18, %esi
callq 0x11450
movq -0x50(%rbp), %rax
movq 0x2d8(%rax), %rax
addq $0x80, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x118b0
nopw %cs:(%rax,%rax)