// File: jstaursky[P]hutch/src/Sleigh/slgh_compile.cc
// Function: SleighCompile::buildConstructor(Constructor*, PatternEquation*, std::vector<ContextChange*, std::allocator<ContextChange*>>*, SectionVector*)
void SleighCompile::buildConstructor(Constructor *big,PatternEquation *pateq,vector<ContextChange *> *contvec,SectionVector *vec)

{ // Take all the different parse pieces for a Constructor and build the Constructor object
  bool noerrors = true;
  if (vec != (SectionVector *)0) { // If the sections were implemented
    noerrors = finalizeSections(big,vec);
    if (noerrors) {		// Attach the sections to the Constructor
      big->setMainSection(vec->getMainSection());
      int4 max = vec->getMaxId();
      for(int4 i=0;i<max;++i) {
	ConstructTpl *section = vec->getNamedSection(i);
	if (section != (ConstructTpl *)0)
	  big->setNamedSection(section,i);
      }
    }
    delete vec;
  }
  if (noerrors) {
    pateq = WithBlock::collectAndPrependPattern(withstack, pateq);
    contvec = WithBlock::collectAndPrependContext(withstack, contvec);
    big->addEquation(pateq);
    big->removeTrailingSpace();
    if (contvec != (vector<ContextChange *> *)0) {
      big->addContext(*contvec);
      delete contvec;
    }
  }
  symtab.popScope();		// In all cases pop scope
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movb $0x1, -0x29(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x67f14
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x66f70
andb $0x1, %al
movb %al, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
je 0x67eed
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
callq 0x6cb30
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x6cb10
movq -0x28(%rbp), %rdi
callq 0x6c8b0
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x67eeb
movq -0x28(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x6cb50
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x67ede
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x34(%rbp), %edx
callq 0xaa850
jmp 0x67ee0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x67eaf
jmp 0x67eed
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x67f12
movq -0x58(%rbp), %rdi
callq 0x6cb80
movq -0x58(%rbp), %rdi
movl $0x30, %esi
callq 0x11450
jmp 0x67f14
testb $0x1, -0x29(%rbp)
je 0x67fa1
movq -0x48(%rbp), %rdi
addq $0x2b8, %rdi            # imm = 0x2B8
movq -0x18(%rbp), %rsi
callq 0x5a850
movq -0x48(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x2b8, %rdi            # imm = 0x2B8
movq -0x20(%rbp), %rsi
callq 0x5a930
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xaa820
movq -0x10(%rbp), %rdi
callq 0xaacb0
cmpq $0x0, -0x20(%rbp)
je 0x67f9f
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x6cba0
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x67f9d
movq -0x60(%rbp), %rdi
callq 0x6a300
movq -0x60(%rbp), %rdi
movl $0x18, %esi
callq 0x11450
jmp 0x67f9f
jmp 0x67fa1
movq -0x48(%rbp), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0xa2c00
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)