// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %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 0x6694
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 0x117c8
movq %rax, (%rcx)
addq $0x8, 0x60(%rsp)
jmp 0x117d3
movq %r14, %rdi
movq %r15, %rsi
callq 0x6a66
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x117aa
movq $0x0, 0x28(%rbx)
movl $0x200, %ebp            # imm = 0x200
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x30(%rsp), %r12
leaq 0x28(%rsp), %r13
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rdi
movq %rax, %rcx
cmpq %rdi, %rax
jne 0x11825
movq 0x78(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %rbp, %rcx
cmpq %rbx, -0x8(%rcx)
je 0x11943
cmpq %rdi, %rax
je 0x11843
movq -0x8(%rax), %rcx
addq $-0x8, %rax
movq %rcx, 0x8(%rsp)
jmp 0x1188d
movq 0x78(%rsp), %rax
movq -0x8(%rax), %rax
movq 0x1f8(%rax), %rax
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), %rax
movq %rax, 0x68(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x70(%rsp)
movl $0x1f8, %ecx            # imm = 0x1F8
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x118d9
movq 0x60(%rsp), %rcx
movq 0x70(%rsp), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x118c3
movq %rax, (%rcx)
addq $0x8, 0x60(%rsp)
jmp 0x118ce
movq %r12, %rdi
movq %r13, %rsi
callq 0x6a66
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
jmp 0x1189b
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x11911
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
movq %rcx, %rsi
cmpq %rdx, %rcx
je 0x11907
movq (%rsi), %rdi
movq %rax, 0x28(%rdi)
addq $0x8, %rsi
cmpq %rdx, %rsi
jne 0x118f7
cmpq %rcx, %rdx
je 0x11911
movq %rcx, 0x18(%rsp)
movq $0x0, 0x28(%rax)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x11933
movq %rax, (%rsi)
addq $0x8, 0x18(%rsp)
jmp 0x11807
movq %r14, %rdi
movq %r15, %rdx
callq 0x14f36
jmp 0x11807
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1195a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x30(%rsp), %rdi
callq 0x6524
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1197a
jmp 0x1197a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x11994
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3270
leaq 0x30(%rsp), %rdi
callq 0x6524
movq %rbx, %rdi
callq 0x3460