// File: /workspace/github_cpp_makefile_star2_O3/jstaursky[P]hutch/src/Sleigh/slghsymbol.cc
// Function: Constructor::orderOperands()
void Constructor::orderOperands(void)

{
  OperandSymbol *sym;
  vector<OperandSymbol *> patternorder;
  vector<OperandSymbol *> newops; // New order of the operands
  int4 lastsize;

  pateq->operandOrder(this,patternorder);
  for(int4 i=0;i<operands.size();++i) { // Make sure patternorder contains all operands
    sym = operands[i];
    if (!sym->isMarked()) {
      patternorder.push_back(sym);
      sym->setMark();		// Make sure all operands are marked
    }
  }
  do {
    lastsize = newops.size();
    for(int4 i=0;i<patternorder.size();++i) {
      sym = patternorder[i];
      if (!sym->isMarked()) continue; // "unmarked" means it is already in newops
      if (sym->isOffsetIrrelevant()) continue; // expression Operands come last
      if ((sym->offsetbase == -1)||(!operands[sym->offsetbase]->isMarked())) {
	newops.push_back(sym);
	sym->clearMark();
      }
    }
  } while(newops.size() != lastsize);
  for(int4 i=0;i<patternorder.size();++i) { // Tack on expression Operands
    sym = patternorder[i];
    if (sym->isOffsetIrrelevant()) {
      newops.push_back(sym);
      sym->clearMark();
    }
  }

  if (newops.size() != operands.size())
    throw SleighError("Circular offset dependency between operands");


  for(int4 i=0;i<newops.size();++i) { // Fix up operand indices
    newops[i]->hand = i;
    newops[i]->localexp->changeIndex(i);
  }
  vector<int4> handmap;		// Create index translation map
  for(int4 i=0;i<operands.size();++i)
    handmap.push_back(operands[i]->hand);

				// Fix up offsetbase
  for(int4 i=0;i<newops.size();++i) {
    sym = newops[i];
    if (sym->offsetbase == -1) continue;
    sym->offsetbase = handmap[sym->offsetbase];
  }

  if (templ != (ConstructTpl *)0) // Fix up templates
    templ->changeHandleIndex(handmap);
  for(int4 i=0;i<namedtempl.size();++i) {
    ConstructTpl *ntempl = namedtempl[i];
    if (ntempl != (ConstructTpl *)0)
      ntempl->changeHandleIndex(handmap);
  }

				// Fix up printpiece operand refs
  for(int4 i=0;i<printpiece.size();++i) {
    if (printpiece[i][0] == '\n') {
      int4 index = printpiece[i][1]-'A';
      index = handmap[index];
      printpiece[i][1] = 'A'+index;
    }
  }
  operands = newops;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x30(%rsp), %rdx
movq %rax, 0x10(%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdx)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x10(%rdi), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x20(%rax)
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
cmpq %rax, %rcx
je 0x6a797
xorl %r12d, %r12d
leaq 0x30(%rsp), %r14
leaq 0x8(%rsp), %r15
movq (%rax,%r12,8), %rdx
movq %rdx, 0x8(%rsp)
testb $0x8, 0x58(%rdx)
jne 0x6a779
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0x6a75d
movq %rdx, (%rsi)
addq $0x8, 0x38(%rsp)
jmp 0x6a768
movq %r14, %rdi
movq %r15, %rdx
callq 0x41ba0
movq 0x8(%rsp), %rax
orl $0x8, 0x58(%rax)
movq 0x18(%rbx), %rax
movq 0x20(%rbx), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
ja 0x6a737
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rsi
jmp 0x6a79b
xorl %eax, %eax
xorl %esi, %esi
leaq 0x18(%rbx), %r14
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rdx, %r8
movq %rsi, %r13
subq %rax, %r13
cmpq %rcx, %r8
je 0x6a84e
xorl %ebp, %ebp
movq (%rcx,%rbp,8), %rax
movq %rax, 0x8(%rsp)
movl 0x58(%rax), %esi
andl $0xa, %esi
cmpl $0x8, %esi
jne 0x6a827
movslq 0x34(%rax), %rsi
cmpq $-0x1, %rsi
je 0x6a7f2
movq (%r14), %rdi
movq (%rdi,%rsi,8), %rsi
testb $0x8, 0x58(%rsi)
jne 0x6a827
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x6a809
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x6a814
movq %r15, %rdi
movq %r12, %rdx
callq 0x41ba0
movq 0x8(%rsp), %rax
andl $-0x9, 0x58(%rax)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
incq %rbp
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %rbp, %rax
ja 0x6a7c7
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rsi
movq %rsi, %r9
subq %rax, %r9
movq %rdx, %r8
jmp 0x6a854
movq %r13, %r9
movq %rcx, %r8
movq %r9, %rdi
sarq $0x3, %rdi
shrq $0x3, %r13
movslq %r13d, %r10
cmpq %r10, %rdi
jne 0x6a7b6
cmpq %rcx, %rdx
je 0x6a8ea
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq (%rcx,%r13,8), %rax
movq %rax, 0x8(%rsp)
testb $0x2, 0x58(%rax)
je 0x6a8c1
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x6a8a3
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x6a8ae
movq %r15, %rdi
movq %r12, %rdx
callq 0x41ba0
movq 0x8(%rsp), %rax
andl $-0x9, 0x58(%rax)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
incq %r13
movq %rdx, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %r13, %rax
ja 0x6a87d
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rsi
movq %rsi, %r9
subq %rax, %r9
movq %r9, %rdi
sarq $0x3, %rdi
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %r8
movq %r8, %rdx
subq %rcx, %rdx
cmpq %rdx, %r9
jne 0x6aadd
cmpq %rax, %rsi
je 0x6a92c
cmpq $0x1, %rdi
movq %rdi, %rdx
adcq $0x0, %rdx
xorl %r9d, %r9d
movq (%rax,%r9,8), %r10
movl %r9d, 0x3c(%r10)
movq 0x40(%r10), %r10
movl %r9d, 0xc(%r10)
incq %r9
cmpq %r9, %rdx
jne 0x6a914
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
cmpq %rcx, %r8
je 0x6a9a3
xorl %r12d, %r12d
leaq 0x50(%rsp), %r15
movq (%rcx,%r12,8), %rdx
addq $0x3c, %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x6a96d
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x6a97d
movq %r15, %rdi
callq 0x3f860
movq 0x18(%rbx), %rcx
movq 0x20(%rbx), %r8
incq %r12
movq %r8, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %r12, %rax
ja 0x6a94a
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rsi
movq %rsi, %rdi
subq %rax, %rdi
sarq $0x3, %rdi
cmpq %rax, %rsi
je 0x6a9da
movq 0x50(%rsp), %rcx
cmpq $0x1, %rdi
adcq $0x0, %rdi
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rsi, 0x8(%rsp)
movslq 0x34(%rsi), %r8
cmpq $-0x1, %r8
je 0x6a9d2
movl (%rcx,%r8,4), %r8d
movl %r8d, 0x34(%rsi)
incq %rdx
cmpq %rdx, %rdi
jne 0x6a9b7
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x6a9ed
leaq 0x50(%rsp), %rsi
callq 0x41110
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
cmpq %rax, %rcx
je 0x6aa2d
xorl %r12d, %r12d
leaq 0x50(%rsp), %r15
movq (%rax,%r12,8), %rdi
testq %rdi, %rdi
je 0x6aa1b
movq %r15, %rsi
callq 0x41110
movq 0x68(%rbx), %rax
movq 0x70(%rbx), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
ja 0x6aa02
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
cmpq %rcx, %rdx
je 0x6aa7c
xorl %eax, %eax
xorl %esi, %esi
movq (%rcx,%rax), %rdi
cmpb $0xa, (%rdi)
jne 0x6aa66
movsbq 0x1(%rdi), %rcx
movq 0x50(%rsp), %rdx
movb -0x104(%rdx,%rcx,4), %cl
addb $0x41, %cl
movb %cl, 0x1(%rdi)
movq 0x30(%rbx), %rcx
movq 0x38(%rbx), %rdx
incq %rsi
movq %rdx, %rdi
subq %rcx, %rdi
sarq $0x5, %rdi
addq $0x20, %rax
cmpq %rsi, %rdi
ja 0x6aa3e
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x40350
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x6aaa0
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6aab7
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6aace
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x20, %edi
callq 0x3fb00
movq %rax, %r14
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x16a4c(%rip), %rsi     # 0x81546
leaq 0x16a70(%rip), %rdx     # 0x81571
leaq 0x50(%rsp), %rdi
callq 0x3f8a0
movb $0x1, %bpl
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x3f890
xorl %ebp, %ebp
movq 0x3836c(%rip), %rsi     # 0xa2e90
movq 0x3810d(%rip), %rdx     # 0xa2c38
movq %r14, %rdi
callq 0x41d70
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x6ab4d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x40880
testb %bpl, %bpl
jne 0x6ab57
jmp 0x6ab8a
movq %rax, %rbx
movq %r14, %rdi
callq 0x40090
jmp 0x6ab8a
jmp 0x6ab87
jmp 0x6ab6b
jmp 0x6ab87
jmp 0x6ab87
jmp 0x6ab6b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x6ab8a
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
jmp 0x6ab8a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6aba1
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x6abb8
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x40880
movq %rbx, %rdi
callq 0x41f10