// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/docarray.cpp
// Function: CSA::STNode::setNext()
void
STNode::setNext()
{
  std::stack<STNode*> nodestack;
  std::vector<STNode*> previous;
  for(STNode* temp = this; temp != 0; temp = temp->child) { nodestack.push(temp); }
  this->next = 0;

  while(nodestack.top() != this)
  {
    STNode* curr = nodestack.top(); nodestack.pop();
    for(STNode* temp = curr->sibling; temp != 0; temp = temp->child) { nodestack.push(temp); }

    if(curr->child == 0)
    {
      for(std::vector<STNode*>::iterator iter = previous.begin(); iter != previous.end(); ++iter)
      {
        (*iter)->next = curr;
      }
      previous.clear();
    }
    curr->next = 0; previous.push_back(curr);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r14
movaps %xmm0, 0x40(%r14)
movaps %xmm0, 0x30(%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %r14, %rdi
xorl %esi, %esi
callq 0x65ce
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x8(%rsp), %r15
movq %rbx, (%r15)
movq %rbx, %rax
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x11a7b
movq %rax, (%rcx)
addq $0x8, 0x60(%rsp)
jmp 0x11a86
movq %r14, %rdi
movq %r15, %rsi
callq 0x69a6
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x11a5d
movq $0x0, 0x28(%rbx)
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x28(%rsp), %r13
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rdi
cmpq %rdi, %rcx
je 0x11adc
movq -0x8(%rcx), %rax
cmpq %rbx, %rax
je 0x11bec
addq $-0x8, %rcx
movq %rax, 0x8(%rsp)
jmp 0x11b33
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movq 0x1f8(%rax), %rax
cmpq %rbx, %rax
je 0x11bec
movq %rax, 0x8(%rsp)
movl $0x200, %esi            # imm = 0x200
callq 0x3270
movq 0x78(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x78(%rsp)
movq -0x8(%rax), %rcx
movq %rcx, 0x68(%rsp)
leaq 0x200(%rcx), %rax
movq %rax, 0x70(%rsp)
addq $0x1f8, %rcx            # imm = 0x1F8
movq 0x8(%rsp), %rax
movq %rcx, 0x60(%rsp)
movq 0x20(%rax), %rcx
movq %rcx, 0x28(%rsp)
testq %rcx, %rcx
je 0x11b87
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rax
je 0x11b64
movq %rcx, (%rax)
addq $0x8, 0x60(%rsp)
jmp 0x11b6f
movq %r12, %rdi
movq %r13, %rsi
callq 0x69a6
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rcx
movq %rcx, 0x28(%rsp)
testq %rcx, %rcx
jne 0x11b46
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
movq 0x18(%rsp), %rsi
je 0x11bb0
movq $0x0, 0x28(%rax)
cmpq 0x20(%rsp), %rsi
je 0x11bdc
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x11ab5
movq 0x10(%rsp), %rcx
movq %rcx, %rdx
cmpq %rsi, %rcx
je 0x11b93
movq (%rdx), %rdi
movq %rax, 0x28(%rdi)
addq $0x8, %rdx
cmpq %rsi, %rdx
jne 0x11bbd
cmpq %rsi, %rcx
je 0x11b93
movq %rcx, 0x18(%rsp)
movq %rcx, %rsi
jmp 0x11b93
movq %r14, %rdi
movq %r15, %rdx
callq 0x15184
jmp 0x11ab5
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x11c03
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x30(%rsp), %rdi
callq 0x644a
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x11c22
jmp 0x11c22
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x11c3c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x30(%rsp), %rdi
callq 0x644a
movq %rbx, %rdi
callq 0x3460