// File: zakimjz[P]SLEUTH/calcdb.cpp
// Function: Dbase_Ctrl_Blk::Dbase_Ctrl_Blk(char const*, int)
Dbase_Ctrl_Blk::Dbase_Ctrl_Blk(const char *infile, const int buf_sz)
{
   if (binary_input){
      fd.open(infile, ios::in|ios::binary);
      if (!fd){
         cerr << "cannot open infile" << infile << endl;
         exit(1);
      }
   }
   else{
      fd.open(infile, ios::in);
      if (!fd){
         cerr << "cannot open infile" << infile << endl;
         exit(1);
      }
   }
   
   buf_size = buf_sz;
   buf = new int [buf_sz];
   cur_buf_pos = 0;
   cur_blk_size = 0;
   readall = 0;
   fd.seekg(0,ios::end);
   endpos = fd.tellg();
   fd.seekg(0,ios::beg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x21b0
movq -0x48(%rbp), %rdi
addq $0x228, %rdi            # imm = 0x228
movq %rdi, -0x40(%rbp)
callq 0x3500
testb $0x1, 0x1bbaa(%rip)     # 0x1e228
je 0x274b
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x3520
movl %eax, -0x4c(%rbp)
jmp 0x26a8
movl -0x4c(%rbp), %edx
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdi
callq 0x2120
jmp 0x26ba
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x20d0
movb %al, -0x61(%rbp)
jmp 0x26d2
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x26db
jmp 0x2746
movq 0x1b90e(%rip), %rdi     # 0x1dff0
leaq 0x1191b(%rip), %rsi     # 0x14004
callq 0x2160
movq %rax, -0x70(%rbp)
jmp 0x26f4
movq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2160
movq %rax, -0x78(%rbp)
jmp 0x2707
movq -0x78(%rbp), %rdi
movq 0x1b8a6(%rip), %rsi     # 0x1dfb8
callq 0x2190
jmp 0x2719
movl $0x1, %edi
callq 0x21c0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x3560
movq -0x48(%rbp), %rdi
callq 0x2080
jmp 0x28ae
jmp 0x27d6
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x8, %edx
callq 0x2120
jmp 0x275f
movq -0x48(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x20d0
movb %al, -0x79(%rbp)
jmp 0x2777
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x2780
jmp 0x27d4
movq 0x1b869(%rip), %rdi     # 0x1dff0
leaq 0x11876(%rip), %rsi     # 0x14004
callq 0x2160
movq %rax, -0x88(%rbp)
jmp 0x279c
movq -0x88(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2160
movq %rax, -0x90(%rbp)
jmp 0x27b5
movq -0x90(%rbp), %rdi
movq 0x1b7f5(%rip), %rsi     # 0x1dfb8
callq 0x2190
jmp 0x27ca
movl $0x1, %edi
callq 0x21c0
jmp 0x27d6
movq -0x48(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, 0x208(%rax)
movslq -0x14(%rbp), %rax
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
movq $-0x1, %rax
cmovoq %rax, %rdi
callq 0x2030
movq %rax, -0x98(%rbp)
jmp 0x280b
movq -0x48(%rbp), %rdi
movq -0x98(%rbp), %rax
movq %rax, 0x210(%rdi)
movl $0x0, 0x21c(%rdi)
movl $0x0, 0x218(%rdi)
movb $0x0, 0x224(%rdi)
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x2200
jmp 0x2848
movq -0x48(%rbp), %rdi
callq 0x22c0
movq %rdx, -0xa8(%rbp)
movq %rax, -0xa0(%rbp)
jmp 0x2861
movq -0xa8(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3540
movq %rax, -0xb0(%rbp)
jmp 0x2889
movq -0x48(%rbp), %rdi
movq -0xb0(%rbp), %rax
movl %eax, 0x220(%rdi)
xorl %edx, %edx
movl %edx, %esi
callq 0x2200
jmp 0x28a5
addq $0xb0, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x22d0
nopw (%rax,%rax)