// File: eryxcc[P]lois/tests/autotest.cpp
// Function: drawTree(std::vector<lois::term, std::allocator<lois::term>>&, int)
void drawTree(vector<term>& v, int from) {
  cout << v[from];
  int children = 0;

  for(size_t i=0; i<v.size(); i++) if(i>from && strindex[i][i] == from)
    cout << "=" << v[i];
    
  for(size_t i=0; i<v.size(); i++) 
    if(strindex[from][i] == from && strindex[i][i] != from && strindex[from][from] != i) {
      bool direct = true;
      for(size_t j=0; j<v.size(); j++) 
        if(i!=j && j != from && strindex[from][j] == from && strindex[i][j] == j)
          direct = false;
      if(direct) {
        if(!children) cout << "["; else cout << ", ";
        children++;
        drawTree(v, i);
        }
      }

  if(children) cout << "]";
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x11190
movq %rax, %rsi
movq 0x9ba52(%rip), %rdi     # 0xa4fd8
callq 0x11140
movl $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x111b0
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x9625
movq -0x18(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x9612
movq -0x18(%rbp), %rcx
leaq 0x9bdf1(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x9612
movq 0x9b9ef(%rip), %rdi     # 0xa4fd8
leaq 0x6a05f(%rip), %rsi     # 0x7364f
callq 0x82b0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11190
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x11140
jmp 0x9614
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x959a
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x111b0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x97ac
movslq -0xc(%rbp), %rcx
leaq 0x9bd67(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x9799
movq -0x20(%rbp), %rcx
leaq 0x9bd45(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
je 0x9799
movslq -0xc(%rbp), %rcx
leaq 0x9bd23(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0x20(%rbp), %rax
je 0x9799
movb $0x1, -0x21(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x111b0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x974b
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x9738
movq -0x30(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
je 0x9738
movslq -0xc(%rbp), %rcx
leaq 0x9bcbf(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x9738
movq -0x20(%rbp), %rcx
leaq 0x9bca1(%rip), %rax     # 0xa53c0
shlq $0x6, %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq -0x30(%rbp), %rax
jne 0x9738
movb $0x0, -0x21(%rbp)
jmp 0x973a
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x96c2
testb $0x1, -0x21(%rbp)
je 0x9797
cmpl $0x0, -0x10(%rbp)
jne 0x976c
movq 0x9b87a(%rip), %rdi     # 0xa4fd8
leaq 0x6a298(%rip), %rsi     # 0x739fd
callq 0x82b0
jmp 0x977f
movq 0x9b865(%rip), %rdi     # 0xa4fd8
leaq 0x6a2d1(%rip), %rsi     # 0x73a4b
callq 0x82b0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl %eax, %esi
callq 0x9560
jmp 0x9799
jmp 0x979b
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x962d
cmpl $0x0, -0x10(%rbp)
je 0x97c5
movq 0x9b81f(%rip), %rdi     # 0xa4fd8
leaq 0x6ab27(%rip), %rsi     # 0x742e7
callq 0x82b0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)