// File: /workspace/github_cpp_makefile_star2_O1/UBOdin[P]jitd-cpp/src/cog_tester.cpp
// Function: cog_test(std::istream&)
void cog_test(istream &input)
{
  stack<CogHandle<Record> > stack;
  string line;
  
  while(getline(input, line)){
    istringstream toks(line);
    string op;
    
    toks >> op;
    
    ///////////////// COG LOADERS /////////////////
    if(string("array") == op){
      string fill;
      toks >> fill;
      
      if(string("random") == fill) {
        int len, max;
        toks >> len >> max;
        stack.push(build_random_array(len,max));        
      } else if(string("explicit") == fill) {
        stack.push(array_for_buffer(load_buffer(toks)));
      } else {
        cerr << "Invalid ArrayCog Fill Mode: " << fill << endl;
        exit(-1);
      }
      
    } else if(string("concat") == op) {
      CogHandle<Record> a = stack.top(); stack.pop();
      CogHandle<Record> b = stack.top(); stack.pop();
      
      stack.push(CogHandle<Record>(new CogHandleBase<Record>(CogPtr<Record>(
                    new ConcatCog<Record>(a, b)))));
      
    } else if(string("btree") == op) {
      Record sep;
      toks >> sep.key;
      sep.value = NULL;
      
      CogHandle<Record> b = stack.top(); stack.pop();
      CogHandle<Record> a = stack.top(); stack.pop();

      stack.push(CogHandle<Record>(new CogHandleBase<Record>(CogPtr<Record>(
                    new BTreeCog<Record>(a, b, sep)))));
    
    ///////////////// SIMPLE QUERIES /////////////////
    } else if(string("size") == op) {
      cout << "Size: " << stack.top()->size() << " records" << endl; 
    } else if(string("dump") == op) {
      cout << "gROOT" << endl;
      stack.top()->printDebug(1);
    } else if(string("scan") == op) {
      CogHandle<Record> root = stack.top();
      Iterator<Record> iter = root->iterator();
      int row = 1;
      cout << "---------------" << endl;
      while(!iter->atEnd()){
        cout << row << " -> " << iter->get()->key << endl;
        iter->next();
        row++;
      }
      cout << "---------------" << endl;
    } else if(string("time_scan") == op) {
      CogHandle<Record> root = stack.top();
      timeval start, end;
      gettimeofday(&start, NULL);
      Iterator<Record> iter = root->iterator();
      int row = 1;
      while(!iter->atEnd()){ iter->next(); row++; }
      gettimeofday(&end, NULL);
      float totalTime = 
        (end.tv_sec - start.tv_sec) * 1000000.0 +
        (end.tv_usec - start.tv_usec);
      cout << "---------------" << endl;
      cout << "Records Scanned: " << (row-1) << endl;
      cout << "Time Taken: " << totalTime << " us" << endl;
      if(row > 1){
        cout << "Time/Record: " << totalTime/(row-1) << " us" << endl;
      }
      cout << "---------------" << endl;
      
    ///////////////// OOOPS /////////////////
    } else {
      cerr << "Invalid Test Operation: " << op << endl;
      exit(-1);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, %rbx
xorpd %xmm0, %xmm0
leaq -0x100(%rbp), %rdi
movapd %xmm0, 0x40(%rdi)
movapd %xmm0, 0x30(%rdi)
movapd %xmm0, 0x20(%rdi)
movapd %xmm0, 0x10(%rdi)
movapd %xmm0, (%rdi)
xorl %esi, %esi
callq 0x7a92
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x88(%rbp), %r13
movq %rbx, -0x60(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6379
leaq -0x320(%rbp), %rbx
movq %rbx, %rdi
leaq -0x1a0(%rbp), %rsi
movl $0x8, %edx
callq 0x43b0
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x0, -0xa0(%rbp)
movb $0x0, -0x98(%rbp)
movq %rbx, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4300
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xbcf5(%rip), %rsi      # 0x11028
leaq 0xbcf3(%rip), %rdx      # 0x1102d
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
leaq -0x320(%rbp), %rcx
jne 0x5376
testq %rdx, %rdx
je 0x537a
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
leaq -0x320(%rbp), %rcx
testl %eax, %eax
sete %bl
jmp 0x537c
xorl %ebx, %ebx
jmp 0x537c
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x539c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x320(%rbp), %rcx
leaq -0x40(%rbp), %rax
testb %bl, %bl
je 0x541c
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %rcx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4300
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %r13, %rdi
leaq 0xbc59(%rip), %rsi      # 0x1102e
leaq 0xbc58(%rip), %rdx      # 0x11034
callq 0x7c1e
movq -0x80(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
leaq -0x320(%rbp), %rcx
jne 0x5464
testq %rdx, %rdx
je 0x553a
movq -0x50(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x42a0
leaq -0x320(%rbp), %rcx
testl %eax, %eax
sete %bl
jmp 0x553c
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xbc30(%rip), %rsi      # 0x1105b
leaq 0xbc2f(%rip), %rdx      # 0x11061
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5460
testq %rdx, %rdx
je 0x546b
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %bl
jmp 0x546d
xorl %ebx, %ebx
jmp 0x546d
xorl %ebx, %ebx
jmp 0x553c
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5486
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %bl, %bl
je 0x54d6
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x54ad
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rbx
movq -0x8(%rax), %rcx
testq %rcx, %rcx
je 0x5612
movq 0x13afb(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x560e
incl 0x8(%rcx)
jmp 0x5612
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xbb79(%rip), %rsi      # 0x11062
leaq 0xbb77(%rip), %rdx      # 0x11067
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
leaq -0x320(%rbp), %rcx
jne 0x5533
testq %rdx, %rdx
je 0x57da
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
leaq -0x320(%rbp), %rcx
testl %eax, %eax
sete %bl
jmp 0x57dc
xorl %ebx, %ebx
jmp 0x57dc
movb $0x1, %bl
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x555f
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x320(%rbp), %rcx
testb %bl, %bl
je 0x55ab
movq %rcx, %rdi
leaq -0x110(%rbp), %rsi
callq 0x4150
movq -0x60(%rbp), %rbx
movq %rax, %rdi
leaq -0x64(%rbp), %rsi
callq 0x4150
movl -0x110(%rbp), %esi
movl -0x64(%rbp), %edx
movq %r13, %rdi
callq 0x5028
leaq -0x100(%rbp), %rdi
movq %r13, %rsi
callq 0x7cb8
movq -0x80(%rbp), %rdi
jmp 0x5936
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %r13, %rdi
leaq 0xba75(%rip), %rsi      # 0x11035
leaq 0xba76(%rip), %rdx      # 0x1103d
callq 0x7c1e
movq -0x80(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
leaq -0x180(%rbp), %rcx
jne 0x5607
testq %rdx, %rdx
je 0x58c4
movq -0x50(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x42a0
leaq -0x180(%rbp), %rcx
testl %eax, %eax
sete %bl
jmp 0x58c6
xorl %ebx, %ebx
jmp 0x58c6
lock
incl 0x8(%rcx)
movq %rcx, -0x58(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x7f20
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5645
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r14
movq -0x8(%rax), %r13
testq %r13, %r13
je 0x5669
movq 0x13967(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5664
incl 0x8(%r13)
jmp 0x5669
lock
incl 0x8(%r13)
leaq -0x100(%rbp), %rdi
callq 0x7f20
movl $0x10, %edi
callq 0x4270
movq %rax, %r12
movl $0x30, %edi
callq 0x4270
movq %rax, %r15
movq %rbx, -0x170(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x168(%rbp)
testq %rax, %rax
movq -0x60(%rbp), %rbx
je 0x56c7
movq 0x1390f(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x56bf
movq -0x58(%rbp), %rax
incl 0x8(%rax)
jmp 0x56c7
movq -0x58(%rbp), %rax
lock
incl 0x8(%rax)
movq %r14, -0x160(%rbp)
movq %r13, -0x158(%rbp)
testq %r13, %r13
je 0x56f1
movq 0x138df(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x56ec
incl 0x8(%r13)
jmp 0x56f1
lock
incl 0x8(%r13)
movq %r15, %rdi
leaq -0x170(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x6734
movq %r15, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
movq %r15, %rsi
callq 0x8806
movq -0x130(%rbp), %rax
movq %rax, (%r12)
movq -0x128(%rbp), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x574e
movq 0x13880(%rip), %rcx     # 0x18fc0
cmpb $0x0, (%rcx)
je 0x574a
incl 0x8(%rax)
jmp 0x574e
lock
incl 0x8(%rax)
movq %r12, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x731a
leaq -0x100(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x7cb8
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x577c
callq 0x6810
movq -0x128(%rbp), %rdi
testq %rdi, %rdi
je 0x578d
callq 0x6810
movq -0x158(%rbp), %rdi
testq %rdi, %rdi
je 0x579e
callq 0x6810
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x57af
callq 0x6810
testq %r13, %r13
je 0x57bc
movq %r13, %rdi
callq 0x6810
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
leaq -0x88(%rbp), %r13
je 0x5ffe
callq 0x6810
jmp 0x5ffe
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x57fc
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x320(%rbp), %rcx
testb %bl, %bl
je 0x586e
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
movq %rcx, %rdi
leaq -0x50(%rbp), %rsi
callq 0x4290
movq $0x0, -0x48(%rbp)
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5840
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rcx
movq %rcx, -0x58(%rbp)
movq -0x8(%rax), %r14
testq %r14, %r14
je 0x5967
movq 0x13764(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5962
incl 0x8(%r14)
jmp 0x5967
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb7e7(%rip), %rsi      # 0x11068
leaq 0xb7e4(%rip), %rdx      # 0x1106c
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x58bd
testq %rdx, %rdx
je 0x5b2e
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %bl
jmp 0x5b30
xorl %ebx, %ebx
jmp 0x5b30
movb $0x1, %bl
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x58e9
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x180(%rbp), %rcx
testb %bl, %bl
je 0x63b9
movq %rcx, %rdi
movq %rcx, %r14
leaq -0x320(%rbp), %rsi
callq 0x4e0a
movq -0x60(%rbp), %rbx
movq %r13, %rdi
movq %r14, %rsi
callq 0x4ed1
leaq -0x100(%rbp), %rdi
movq %r13, %rsi
callq 0x7cb8
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x592f
callq 0x6810
movq -0x178(%rbp), %rdi
testq %rdi, %rdi
je 0x5940
callq 0x6810
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5ffe
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x5ffe
lock
incl 0x8(%r14)
leaq -0x100(%rbp), %rdi
callq 0x7f20
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5996
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rbx
movq -0x8(%rax), %r13
testq %r13, %r13
je 0x59ba
movq 0x13616(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x59b5
incl 0x8(%r13)
jmp 0x59ba
lock
incl 0x8(%r13)
leaq -0x100(%rbp), %rdi
callq 0x7f20
movl $0x10, %edi
callq 0x4270
movq %rax, %r12
movl $0x40, %edi
callq 0x4270
movq %rax, %r15
movq %rbx, -0x150(%rbp)
movq %r13, -0x148(%rbp)
testq %r13, %r13
movq -0x60(%rbp), %rbx
je 0x5a0e
movq 0x135c2(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5a09
incl 0x8(%r13)
jmp 0x5a0e
lock
incl 0x8(%r13)
movq -0x58(%rbp), %rax
movq %rax, -0x140(%rbp)
movq %r14, -0x138(%rbp)
testq %r14, %r14
je 0x5a3c
movq 0x13594(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5a37
incl 0x8(%r14)
jmp 0x5a3c
lock
incl 0x8(%r14)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %r15, %rdi
leaq -0x150(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x679e
movq %r15, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
movq %r15, %rsi
callq 0x92d2
movq -0x120(%rbp), %rax
movq %rax, (%r12)
movq -0x118(%rbp), %rax
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x5aa1
movq 0x1352d(%rip), %rcx     # 0x18fc0
cmpb $0x0, (%rcx)
je 0x5a9d
incl 0x8(%rax)
jmp 0x5aa1
lock
incl 0x8(%rax)
movq %r12, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
movq %r12, %rsi
callq 0x731a
leaq -0x100(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x7cb8
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x5ad5
callq 0x6810
movq -0x118(%rbp), %rdi
testq %rdi, %rdi
je 0x5ae6
callq 0x6810
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x5af7
callq 0x6810
movq -0x148(%rbp), %rdi
testq %rdi, %rdi
je 0x5b08
callq 0x6810
testq %r13, %r13
je 0x5b15
movq %r13, %rdi
callq 0x6810
testq %r14, %r14
je 0x5b22
movq %r14, %rdi
callq 0x6810
leaq -0x88(%rbp), %r13
jmp 0x5ffe
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5b49
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %bl, %bl
je 0x5bba
movl $0x6, %edx
movq 0x1346f(%rip), %rdi     # 0x18fc8
leaq 0xb50d(%rip), %rsi      # 0x1106d
callq 0x42d0
movq -0x60(%rbp), %rbx
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5b8c
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r14
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x4340
movq (%r14), %r15
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x5c0f
movq 0x13411(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5c0a
incl 0x8(%r14)
jmp 0x5c0f
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb4b0(%rip), %rsi      # 0x1107d
leaq 0xb4ad(%rip), %rdx      # 0x11081
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5c06
testq %rdx, %rdx
je 0x5c83
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %bl
jmp 0x5c85
xorl %ebx, %ebx
jmp 0x5c85
lock
incl 0x8(%r14)
leaq -0x50(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movl %eax, %r15d
testq %r14, %r14
je 0x5c31
movq %r14, %rdi
callq 0x6810
movq 0x13390(%rip), %rdi     # 0x18fc8
movl %r15d, %esi
callq 0x43f0
movq %rax, %r14
movl $0x8, %edx
movq %rax, %rdi
leaq 0xb422(%rip), %rsi      # 0x11074
callq 0x42d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
jmp 0x5ffe
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5c9e
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %bl, %bl
je 0x5d45
movl $0x5, %edx
movq 0x13316(%rip), %rdi     # 0x18fc8
leaq 0xb3c9(%rip), %rsi      # 0x11082
callq 0x42d0
movq -0x60(%rbp), %rbx
movq 0x132ff(%rip), %rcx     # 0x18fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x132e1(%rip), %rdi     # 0x18fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5d17
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r14
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x4340
movq (%r14), %r15
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x5d96
movq 0x13286(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5d91
incl 0x8(%r14)
jmp 0x5d96
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb345(%rip), %rsi      # 0x1109d
leaq 0xb342(%rip), %rdx      # 0x110a1
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5d8d
testq %rdx, %rdx
je 0x5db2
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %bl
jmp 0x5db4
xorl %ebx, %ebx
jmp 0x5db4
lock
incl 0x8(%r14)
leaq -0x50(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
movq %r15, %rdi
movl $0x1, %esi
callq *0x18(%rax)
jmp 0x5ff1
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5dcd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %bl, %bl
je 0x5e17
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
movq -0x60(%rbp), %rbx
jne 0x5df8
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r12
movq -0x8(%rax), %r14
testq %r14, %r14
je 0x5e72
movq 0x131b4(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5e6d
incl 0x8(%r14)
jmp 0x5e72
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb26e(%rip), %rsi      # 0x11098
leaq 0xb270(%rip), %rdx      # 0x110a1
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5e66
testq %rdx, %rdx
je 0x6044
movq -0xa8(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %bl
jmp 0x6046
xorl %ebx, %ebx
jmp 0x6046
lock
incl 0x8(%r14)
movq %r13, %rdi
movq %r12, %rsi
callq 0x4340
movq (%r12), %r15
movq 0x8(%r12), %r12
testq %r12, %r12
je 0x5ea4
movq 0x1312e(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x5e9e
incl 0x8(%r12)
jmp 0x5ea4
lock
incl 0x8(%r12)
movq %r13, %rdi
callq 0x42e0
movq (%r15), %rax
leaq -0x50(%rbp), %rdi
movq %r15, %rsi
callq *(%rax)
testq %r12, %r12
je 0x5ec5
movq %r12, %rdi
callq 0x6810
movl $0xf, %edx
movq 0x130f7(%rip), %rdi     # 0x18fc8
leaq 0xb1b0(%rip), %rsi      # 0x11088
callq 0x42d0
movq 0x130e4(%rip), %rcx     # 0x18fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x130c6(%rip), %rdi     # 0x18fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0x1, %r12d
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x5f99
movq 0x1309e(%rip), %rdi     # 0x18fc8
movl %r12d, %esi
callq 0x43f0
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0xb931(%rip), %rsi      # 0x11875
callq 0x42d0
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
movq (%rax), %rsi
movq %r15, %rdi
callq 0x4230
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
incl %r12d
jmp 0x5f15
movl $0xf, %edx
movq 0x13023(%rip), %rdi     # 0x18fc8
leaq 0xb0dc(%rip), %rsi      # 0x11088
callq 0x42d0
movq 0x13010(%rip), %rcx     # 0x18fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x12ff2(%rip), %rdi     # 0x18fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5ff1
callq 0x6810
testq %r14, %r14
je 0x5ffe
movq %r14, %rdi
jmp 0x57d0
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6020
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x320(%rbp), %rdi
movq 0x12f8a(%rip), %rsi     # 0x18fb8
callq 0x4310
leaq -0x2a8(%rbp), %rdi
callq 0x40b0
jmp 0x529e
movb $0x1, %bl
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x605f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %bl, %bl
je 0x63f7
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
movq -0x60(%rbp), %rbx
jne 0x608e
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r14
movq -0x8(%rax), %rcx
testq %rcx, %rcx
je 0x60b0
movq 0x12f1e(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x60ac
incl 0x8(%rcx)
jmp 0x60b0
lock
incl 0x8(%rcx)
movq %rcx, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x4380
leaq -0x64(%rbp), %rdi
movq %r14, %rsi
callq 0x4340
movq (%r14), %r15
movq 0x8(%r14), %r14
testq %r14, %r14
je 0x60ee
movq 0x12ee2(%rip), %rax     # 0x18fc0
cmpb $0x0, (%rax)
je 0x60e9
incl 0x8(%r14)
jmp 0x60ee
lock
incl 0x8(%r14)
leaq -0x64(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
leaq -0x110(%rbp), %rdi
movq %r15, %rsi
callq *(%rax)
testq %r14, %r14
je 0x6113
movq %r14, %rdi
callq 0x6810
movl $0x1, %r12d
movq -0x110(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x613c
movq -0x110(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
incl %r12d
jmp 0x6119
movq %r13, %rdi
xorl %esi, %esi
callq 0x4380
movq -0x88(%rbp), %rax
subq -0x50(%rbp), %rax
cvtsi2sd %rax, %xmm0
movq -0x80(%rbp), %r13
subq -0x48(%rbp), %r13
mulsd 0xaeba(%rip), %xmm0     # 0x11020
movsd %xmm0, -0xb0(%rbp)
movl $0xf, %edx
movq 0x12e4e(%rip), %rdi     # 0x18fc8
leaq 0xaf07(%rip), %rsi      # 0x11088
callq 0x42d0
movq 0x12e3b(%rip), %rcx     # 0x18fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x12e1d(%rip), %rdi     # 0x18fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0x11, %edx
movq 0x12e04(%rip), %rdi     # 0x18fc8
leaq 0xaed7(%rip), %rsi      # 0x110a2
callq 0x42d0
leal -0x1(%r12), %r14d
movq 0x12dec(%rip), %rdi     # 0x18fc8
movl %r14d, %esi
callq 0x43f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0xc, %edx
movq 0x12dae(%rip), %rdi     # 0x18fc8
leaq 0xae93(%rip), %rsi      # 0x110b4
callq 0x42d0
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
movsd -0xb0(%rbp), %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, -0xb0(%rbp)
cvtss2sd %xmm0, %xmm0
movq 0x12d74(%rip), %rdi     # 0x18fc8
callq 0x4360
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xae56(%rip), %rsi      # 0x110c1
callq 0x42d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
cmpl $0x2, %r12d
jb 0x631a
movl $0xd, %edx
movq 0x12d1f(%rip), %rdi     # 0x18fc8
leaq 0xae15(%rip), %rsi      # 0x110c5
callq 0x42d0
xorps %xmm0, %xmm0
cvtsi2ss %r14d, %xmm0
movss -0xb0(%rbp), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq 0x12cf1(%rip), %rdi     # 0x18fc8
callq 0x4360
movq %rax, %r14
movl $0x3, %edx
movq %rax, %rdi
leaq 0xadd3(%rip), %rsi      # 0x110c1
callq 0x42d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0xf, %edx
movq 0x12ca2(%rip), %rdi     # 0x18fc8
leaq 0xad5b(%rip), %rsi      # 0x11088
callq 0x42d0
movq 0x12c8f(%rip), %rcx     # 0x18fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x12c71(%rip), %rdi     # 0x18fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x108(%rbp), %rdi
testq %rdi, %rdi
jne 0x57b7
jmp 0x57bc
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x639b
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x100(%rbp), %rdi
callq 0x687c
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x12c30(%rip), %rdi     # 0x18ff0
leaq 0xac77(%rip), %rsi      # 0x1103e
movl $0x1c, %edx
callq 0x42d0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x12c10(%rip), %rdi     # 0x18ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42f0
movq 0x12bf2(%rip), %rdi     # 0x18ff0
leaq 0xacce(%rip), %rsi      # 0x110d3
movl $0x18, %edx
callq 0x42d0
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq 0x12bcc(%rip), %rdi     # 0x18ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
jmp 0x63ed
jmp 0x660d
movq %rax, %rbx
jmp 0x6620
movq %rax, %rbx
jmp 0x65ef
jmp 0x660d
jmp 0x6459
jmp 0x660d
jmp 0x660d
movq %rax, %rbx
jmp 0x662d
jmp 0x6619
jmp 0x660d
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x64af
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x64d1
jmp 0x660d
movq %rax, %rbx
jmp 0x64e3
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x649b
callq 0x6810
jmp 0x649b
movq %rax, %rbx
movq -0x118(%rbp), %rdi
testq %rdi, %rdi
je 0x64ac
callq 0x6810
xorl %r15d, %r15d
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x64c0
callq 0x6810
movq -0x148(%rbp), %rdi
testq %rdi, %rdi
je 0x64d1
callq 0x6810
testb %r15b, %r15b
je 0x64e3
movl $0x10, %esi
movq %r12, %rdi
callq 0x4280
testq %r13, %r13
je 0x662d
movq %r13, %rdi
jmp 0x6628
jmp 0x65c5
jmp 0x660d
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x6565
callq 0x6810
jmp 0x6565
jmp 0x65c5
movq %rax, %rbx
jmp 0x654f
jmp 0x65c5
movq %rax, %rbx
jmp 0x65b5
movq %rax, %rbx
movb $0x1, %r14b
jmp 0x6579
movq %rax, %rbx
movq -0x80(%rbp), %rdi
jmp 0x6556
jmp 0x65c5
movq %rax, %rbx
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x654f
callq 0x6810
movq -0x178(%rbp), %rdi
testq %rdi, %rdi
je 0x65c8
callq 0x6810
jmp 0x65c8
movq %rax, %rbx
movq -0x128(%rbp), %rdi
testq %rdi, %rdi
je 0x6576
callq 0x6810
xorl %r14d, %r14d
movq -0x158(%rbp), %rdi
testq %rdi, %rdi
je 0x658a
callq 0x6810
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x65a3
callq 0x6810
jmp 0x65a3
movq %rax, %rbx
movb $0x1, %r14b
testb %r14b, %r14b
je 0x65b5
movl $0x10, %esi
movq %r12, %rdi
callq 0x4280
testq %r13, %r13
je 0x65fc
movq %r13, %rdi
jmp 0x65f7
jmp 0x65e5
jmp 0x65c5
jmp 0x65c5
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x663a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x663a
jmp 0x660d
movq %rax, %rbx
movq -0x108(%rbp), %r14
testq %r14, %r14
je 0x65fc
movq %r14, %rdi
callq 0x6810
cmpq $0x0, -0x58(%rbp)
je 0x663a
movq -0x58(%rbp), %rdi
jmp 0x6635
jmp 0x6614
jmp 0x660d
movq %rax, %rbx
jmp 0x663a
jmp 0x6619
movq %rax, %rbx
jmp 0x667b
movq %rax, %rbx
movq -0x48(%rbp), %r12
testq %r12, %r12
je 0x662d
movq %r12, %rdi
callq 0x6810
testq %r14, %r14
je 0x663a
movq %r14, %rdi
callq 0x6810
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x665c
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4280
movq 0x12955(%rip), %rsi     # 0x18fb8
leaq -0x320(%rbp), %rdi
callq 0x4310
leaq -0x2a8(%rbp), %rdi
callq 0x40b0
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x669d
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x100(%rbp), %rdi
callq 0x687c
movq %rbx, %rdi
callq 0x4400
nop