// File: zakimjz[P]SLEUTH/calcdb.cpp
// Function: Dbase_Ctrl_Blk::make_vertical()
void Dbase_Ctrl_Blk::make_vertical(){
   int i, j; //track the position in trans, counting BranchIt
   int pi, pj; //track the position in trans, not counting BranchIt
   int scope;
   int depth = 0;
   //convert current transaction into vertical format
   
   for (i=0, pi=0; i < TransSz; i++){

      if (TransAry[i] == BranchIt){
         depth--;
         continue;
      }
      else if (TransAry[i] == InvalidIt){
	 depth++;
	 pi++;
	 continue;
      }
      
      scope=0;
      for (j=i+1, pj=pi; scope >= 0 && j < TransSz; j++){
         if (TransAry[j] == BranchIt) scope--;
         else{
            scope++;
            pj++;
         }
      }
      
      idnode nn(Cid, pi,pj, depth, true);
      //cout << "push " << TransAry[i] << " " <<  pi << " " << pj << endl;
      Idlists[TransAry[i]]->push_back(nn);
      pi++;
      depth++;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x14(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x1af2f(%rip), %eax     # 0x1e204
jge 0x3446
movq 0x1af26(%rip), %rax     # 0x1e208
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x1aecf(%rip), %rcx     # 0x1e1c0
cmpq (%rcx), %rax
jne 0x3304
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3421
movq 0x1aefd(%rip), %rax     # 0x1e208
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x1aeae(%rip), %rcx     # 0x1e1c8
cmpq (%rcx), %rax
jne 0x3336
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3421
jmp 0x3338
movl $0x0, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x69(%rbp)
jl 0x3368
movl -0x10(%rbp), %eax
cmpl 0x1aea2(%rip), %eax     # 0x1e204
setl %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0x3371
jmp 0x33b6
movq 0x1ae90(%rip), %rax     # 0x1e208
movslq -0x10(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
leaq 0x1ae39(%rip), %rcx     # 0x1e1c0
cmpq (%rcx), %rax
jne 0x3397
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x33a9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x33ab
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x334e
movl 0x1ae58(%rip), %esi     # 0x1e214
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %r8d
leaq -0x50(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movl $0x1, %r9d
callq 0x36c0
movq -0x68(%rbp), %rdi
addq $0x228, %rdi            # imm = 0x228
movq 0x1ae1d(%rip), %rax     # 0x1e208
movslq -0xc(%rbp), %rcx
movslq (%rax,%rcx,4), %rsi
callq 0x36a0
movq -0x78(%rbp), %rsi
movq (%rax), %rdi
callq 0x3730
jmp 0x3406
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x37a0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x32cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x37a0
jmp 0x344f
addq $0x80, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x22d0
nopl (%rax,%rax)