// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
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 0x7734
leaq -0x190(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %r14, -0x60(%rbp)
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %edx
movq %r14, %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6128
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 0xbf5b(%rip), %rsi      # 0x11020
leaq 0xbf59(%rip), %rdx      # 0x11025
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
leaq -0x320(%rbp), %rdi
jne 0x510c
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5115
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
leaq -0x320(%rbp), %rdi
testl %eax, %eax
sete %r14b
jmp 0x5118
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5118
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x5137
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
leaq -0x320(%rbp), %rdi
leaq -0x40(%rbp), %rax
testb %r14b, %r14b
je 0x51b4
movq %rax, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x4300
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
leaq 0xbeba(%rip), %rsi      # 0x11026
leaq 0xbeb9(%rip), %rdx      # 0x1102c
callq 0x78c0
movq -0x78(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
leaq -0x320(%rbp), %rdi
jne 0x5205
movq -0x80(%rbp), %rbx
testq %rdx, %rdx
je 0x52ea
movq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
leaq -0x320(%rbp), %rdi
testl %eax, %eax
sete %r14b
jmp 0x52ed
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xbe90(%rip), %rsi      # 0x11053
leaq 0xbe8f(%rip), %rdx      # 0x11059
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x51fc
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5211
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x5214
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5214
movq -0x80(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x52ed
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x522c
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x527d
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5254
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 0x53c4
movq 0x12d54(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x53c0
incl 0x8(%rcx)
jmp 0x53c4
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xbdca(%rip), %rsi      # 0x1105a
leaq 0xbdc8(%rip), %rdx      # 0x1105f
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
leaq -0x320(%rbp), %rdi
jne 0x52de
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5582
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
leaq -0x320(%rbp), %rdi
testl %eax, %eax
sete %r14b
jmp 0x5585
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5585
movb $0x1, %r14b
leaq -0x70(%rbp), %rax
cmpq %rax, %rbx
je 0x530c
movq -0x70(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
leaq -0x320(%rbp), %rdi
testb %r14b, %r14b
je 0x5360
leaq -0x110(%rbp), %rsi
callq 0x4150
movq -0x60(%rbp), %r14
movq %rax, %rdi
leaq -0x84(%rbp), %rsi
callq 0x4150
movl -0x110(%rbp), %esi
movl -0x84(%rbp), %edx
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
callq 0x4dad
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
callq 0x795e
movq -0x78(%rbp), %rdi
jmp 0x56dd
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x80(%rbp), %rdi
leaq 0xbcba(%rip), %rsi      # 0x1102d
leaq 0xbcbb(%rip), %rdx      # 0x11035
callq 0x78c0
movq -0x78(%rbp), %rdx
cmpq -0x48(%rbp), %rdx
leaq -0x180(%rbp), %r15
jne 0x53b4
movq -0x80(%rbp), %rbx
testq %rdx, %rdx
je 0x5673
movq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x5676
movq -0x80(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5676
lock
incl 0x8(%rcx)
movq %rcx, -0x58(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x7bc6
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x53f7
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r15
movq -0x8(%rax), %r12
testq %r12, %r12
je 0x541d
movq 0x12bb5(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5417
incl 0x8(%r12)
jmp 0x541d
lock
incl 0x8(%r12)
leaq -0x100(%rbp), %rdi
callq 0x7bc6
movl $0x10, %edi
callq 0x4270
movq %rax, %rbx
movl $0x30, %edi
callq 0x4270
movq %rax, %r13
movq %r14, -0x170(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x168(%rbp)
testq %rax, %rax
movq -0x60(%rbp), %r14
je 0x547b
movq 0x12b5b(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5473
movq -0x58(%rbp), %rax
incl 0x8(%rax)
jmp 0x547b
movq -0x58(%rbp), %rax
lock
incl 0x8(%rax)
movq %r15, -0x160(%rbp)
movq %r12, -0x158(%rbp)
testq %r12, %r12
je 0x54a7
movq 0x12b2b(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x54a1
incl 0x8(%r12)
jmp 0x54a7
lock
incl 0x8(%r12)
movq %r13, %rdi
leaq -0x170(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x64e6
movq %r13, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
movq %r13, %rsi
callq 0x84b4
movq -0x130(%rbp), %rax
movq %rax, (%rbx)
movq -0x128(%rbp), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x5502
movq 0x12acc(%rip), %rcx     # 0x17fc0
cmpb $0x0, (%rcx)
je 0x54fe
incl 0x8(%rax)
jmp 0x5502
lock
incl 0x8(%rax)
movq %rbx, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x6f94
leaq -0x100(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x795e
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x5530
callq 0x65c2
movq -0x128(%rbp), %rdi
testq %rdi, %rdi
je 0x5541
callq 0x65c2
movq -0x158(%rbp), %rdi
testq %rdi, %rdi
je 0x5552
callq 0x65c2
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x5563
callq 0x65c2
testq %r12, %r12
je 0x5570
movq %r12, %rdi
callq 0x65c2
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
jne 0x58c0
jmp 0x58c5
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x55a4
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
leaq -0x320(%rbp), %rdi
testb %r14b, %r14b
je 0x5614
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rsi
callq 0x4290
movq $0x0, -0x48(%rbp)
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x55e6
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), %r15
testq %r15, %r15
je 0x570e
movq 0x129be(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5709
incl 0x8(%r15)
jmp 0x570e
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xba39(%rip), %rsi      # 0x11060
leaq 0xba36(%rip), %rdx      # 0x11064
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5667
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x590b
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x590e
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x590e
movb $0x1, %r14b
leaq -0x70(%rbp), %rax
cmpq %rax, %rbx
je 0x568e
movq -0x70(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x6168
movq %r15, %rdi
leaq -0x320(%rbp), %rsi
callq 0x4b7f
movq -0x60(%rbp), %r14
leaq -0x80(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4c42
leaq -0x100(%rbp), %rdi
movq %rbx, %rsi
callq 0x795e
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x56d6
callq 0x65c2
movq -0x178(%rbp), %rdi
testq %rdi, %rdi
je 0x56e7
callq 0x65c2
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x58c5
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x58c5
lock
incl 0x8(%r15)
leaq -0x100(%rbp), %rdi
callq 0x7bc6
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x573d
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %r14
movq -0x8(%rax), %r12
testq %r12, %r12
je 0x5763
movq 0x1286f(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x575d
incl 0x8(%r12)
jmp 0x5763
lock
incl 0x8(%r12)
leaq -0x100(%rbp), %rdi
callq 0x7bc6
movl $0x10, %edi
callq 0x4270
movq %rax, %rbx
movl $0x40, %edi
callq 0x4270
movq %rax, %r13
movq %r14, -0x150(%rbp)
movq %r12, -0x148(%rbp)
testq %r12, %r12
movq -0x60(%rbp), %r14
je 0x57b9
movq 0x12819(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x57b3
incl 0x8(%r12)
jmp 0x57b9
lock
incl 0x8(%r12)
movq -0x58(%rbp), %rax
movq %rax, -0x140(%rbp)
movq %r15, -0x138(%rbp)
testq %r15, %r15
je 0x57e7
movq 0x127e9(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x57e2
incl 0x8(%r15)
jmp 0x57e7
lock
incl 0x8(%r15)
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %r13, %rdi
leaq -0x150(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x6550
movq %r13, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
movq %r13, %rsi
callq 0x8f8a
movq -0x120(%rbp), %rax
movq %rax, (%rbx)
movq -0x118(%rbp), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x584a
movq 0x12784(%rip), %rcx     # 0x17fc0
cmpb $0x0, (%rcx)
je 0x5846
incl 0x8(%rax)
jmp 0x584a
lock
incl 0x8(%rax)
movq %rbx, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x6f94
leaq -0x100(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x795e
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x5878
callq 0x65c2
movq -0x118(%rbp), %rdi
testq %rdi, %rdi
je 0x5889
callq 0x65c2
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x589a
callq 0x65c2
movq -0x148(%rbp), %rdi
testq %rdi, %rdi
je 0x58ab
callq 0x65c2
testq %r12, %r12
je 0x58b8
movq %r12, %rdi
callq 0x65c2
testq %r15, %r15
je 0x58c5
movq %r15, %rdi
callq 0x65c2
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x58e7
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x320(%rbp), %rdi
movq 0x126c3(%rip), %rsi     # 0x17fb8
callq 0x4310
leaq -0x2a8(%rbp), %rdi
callq 0x40b0
jmp 0x5030
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x5926
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x5997
movl $0x6, %edx
movq 0x12691(%rip), %rdi     # 0x17fc8
leaq 0xb727(%rip), %rsi      # 0x11065
callq 0x42d0
movq -0x60(%rbp), %r14
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x596a
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rbx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4340
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x59f7
movq 0x12633(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x59f3
incl 0x8(%rbx)
jmp 0x59f7
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb6cb(%rip), %rsi      # 0x11075
leaq 0xb6c8(%rip), %rdx      # 0x11079
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x59ea
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5a6b
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x5a6e
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5a6e
lock
incl 0x8(%rbx)
leaq -0x50(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movl %eax, %r15d
testq %rbx, %rbx
je 0x5a19
movq %rbx, %rdi
callq 0x65c2
movq 0x125a8(%rip), %rdi     # 0x17fc8
movl %r15d, %esi
callq 0x43f0
movq %rax, %rbx
movl $0x8, %edx
movq %rax, %rdi
leaq 0xb632(%rip), %rsi      # 0x1106c
callq 0x42d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
jmp 0x58c5
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x5a86
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x5b2d
movl $0x5, %edx
movq 0x1252d(%rip), %rdi     # 0x17fc8
leaq 0xb5d8(%rip), %rsi      # 0x1107a
callq 0x42d0
movq -0x60(%rbp), %r14
movq 0x12516(%rip), %rcx     # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x124f8(%rip), %rdi     # 0x17fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jne 0x5b00
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rbx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x4340
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x5b86
movq 0x1249d(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5b82
incl 0x8(%rbx)
jmp 0x5b86
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb555(%rip), %rsi      # 0x11095
leaq 0xb552(%rip), %rdx      # 0x11099
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5b79
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5bae
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x5bb1
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5bb1
lock
incl 0x8(%rbx)
leaq -0x50(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
movq %r15, %rdi
movl $0x1, %esi
callq *0x18(%rax)
testq %rbx, %rbx
je 0x58c5
movq %rbx, %rdi
jmp 0x58c0
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x5bc9
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x5c14
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
movq -0x60(%rbp), %r14
jne 0x5bf5
movq -0xb8(%rbp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x10(%rax), %rbx
movq -0x8(%rax), %r15
testq %r15, %r15
je 0x5c78
movq 0x123b7(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5c73
incl 0x8(%r15)
jmp 0x5c78
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0xb469(%rip), %rsi      # 0x11090
leaq 0xb46b(%rip), %rdx      # 0x11099
callq 0x78c0
movq -0x48(%rbp), %rdx
cmpq -0xa0(%rbp), %rdx
jne 0x5c67
movq -0x50(%rbp), %rbx
testq %rdx, %rdx
je 0x5df2
movq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0x42a0
testl %eax, %eax
sete %r14b
jmp 0x5df5
movq -0x50(%rbp), %rbx
xorl %r14d, %r14d
jmp 0x5df5
lock
incl 0x8(%r15)
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x4340
movq (%rbx), %r12
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x5ca5
movq 0x12329(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5ca1
incl 0x8(%rbx)
jmp 0x5ca5
lock
incl 0x8(%rbx)
leaq -0x80(%rbp), %rdi
callq 0x42e0
movq (%r12), %rax
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq *(%rax)
testq %rbx, %rbx
je 0x5cc8
movq %rbx, %rdi
callq 0x65c2
movl $0xf, %edx
movq 0x122f4(%rip), %rdi     # 0x17fc8
leaq 0xb3a5(%rip), %rsi      # 0x11080
callq 0x42d0
movq 0x122e1(%rip), %rcx     # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x122c3(%rip), %rdi     # 0x17fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0x1, %ebx
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x5d96
movq 0x1229c(%rip), %rdi     # 0x17fc8
movl %ebx, %esi
callq 0x43f0
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0xba28(%rip), %rsi      # 0x1176d
callq 0x42d0
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *(%rax)
movq (%rax), %rsi
movq %r12, %rdi
callq 0x4230
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
incl %ebx
jmp 0x5d17
movl $0xf, %edx
movq 0x12226(%rip), %rdi     # 0x17fc8
leaq 0xb2d7(%rip), %rsi      # 0x11080
callq 0x42d0
movq 0x12213(%rip), %rcx     # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x121f5(%rip), %rdi     # 0x17fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
jne 0x58b3
jmp 0x58b8
movb $0x1, %r14b
leaq -0x40(%rbp), %rax
cmpq %rax, %rbx
je 0x5e0d
movq -0x40(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x4280
testb %r14b, %r14b
je 0x61a6
movq -0xd0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
movq -0x60(%rbp), %r14
jne 0x5e3d
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 0x5e5f
movq 0x1216f(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5e5b
incl 0x8(%rcx)
jmp 0x5e5f
lock
incl 0x8(%rcx)
movq %rcx, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x4380
leaq -0x84(%rbp), %rdi
movq %rbx, %rsi
callq 0x4340
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x5e9e
movq 0x12130(%rip), %rax     # 0x17fc0
cmpb $0x0, (%rax)
je 0x5e9a
incl 0x8(%rbx)
jmp 0x5e9e
lock
incl 0x8(%rbx)
leaq -0x84(%rbp), %rdi
callq 0x42e0
movq (%r15), %rax
leaq -0x110(%rbp), %rdi
movq %r15, %rsi
callq *(%rax)
testq %rbx, %rbx
je 0x5ec6
movq %rbx, %rdi
callq 0x65c2
movl $0x1, %r12d
movq -0x110(%rbp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x5eef
movq -0x110(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
incl %r12d
jmp 0x5ecc
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
callq 0x4380
movq -0x80(%rbp), %rax
subq -0x50(%rbp), %rax
cvtsi2sd %rax, %xmm0
movq -0x78(%rbp), %r13
subq -0x48(%rbp), %r13
mulsd 0xb0f1(%rip), %xmm0     # 0x11008
movsd %xmm0, -0xb0(%rbp)
movl $0xf, %edx
movq 0x1209d(%rip), %rdi     # 0x17fc8
leaq 0xb14e(%rip), %rsi      # 0x11080
callq 0x42d0
movq 0x1208a(%rip), %rcx     # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x1206c(%rip), %rdi     # 0x17fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0x11, %edx
movq 0x12053(%rip), %rdi     # 0x17fc8
leaq 0xb11e(%rip), %rsi      # 0x1109a
callq 0x42d0
leal -0x1(%r12), %ebx
movq 0x1203b(%rip), %rdi     # 0x17fc8
movl %ebx, %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 0x11ffe(%rip), %rdi     # 0x17fc8
leaq 0xb0db(%rip), %rsi      # 0x110ac
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 0x11fc4(%rip), %rdi     # 0x17fc8
callq 0x4360
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0xb09e(%rip), %rsi      # 0x110b9
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 0x60c9
movl $0xd, %edx
movq 0x11f6f(%rip), %rdi     # 0x17fc8
leaq 0xb05d(%rip), %rsi      # 0x110bd
callq 0x42d0
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movss -0xb0(%rbp), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq 0x11f42(%rip), %rdi     # 0x17fc8
callq 0x4360
movq %rax, %rbx
movl $0x3, %edx
movq %rax, %rdi
leaq 0xb01c(%rip), %rsi      # 0x110b9
callq 0x42d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4190
movl $0xf, %edx
movq 0x11ef3(%rip), %rdi     # 0x17fc8
leaq 0xafa4(%rip), %rsi      # 0x11080
callq 0x42d0
movq 0x11ee0(%rip), %rcx     # 0x17fc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %esi
movq 0x11ec2(%rip), %rdi     # 0x17fc8
callq 0x4030
movq %rax, %rdi
callq 0x4190
movq -0x108(%rbp), %rdi
testq %rdi, %rdi
jne 0x556b
jmp 0x5570
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x614a
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x100(%rbp), %rdi
callq 0x662e
addq $0x2f8, %rsp            # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11e81(%rip), %rdi     # 0x17ff0
leaq 0xaec0(%rip), %rsi      # 0x11036
movl $0x1c, %edx
callq 0x42d0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x11e61(%rip), %rdi     # 0x17ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x42f0
movq 0x11e43(%rip), %rdi     # 0x17ff0
leaq 0xaf17(%rip), %rsi      # 0x110cb
movl $0x18, %edx
callq 0x42d0
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq 0x11e1d(%rip), %rdi     # 0x17ff0
callq 0x42d0
movq %rax, %rdi
callq 0x4120
jmp 0x619c
jmp 0x63c2
movq %rax, %r14
jmp 0x63d5
movq %rax, %r14
jmp 0x63a4
jmp 0x63c2
jmp 0x6208
jmp 0x63c2
jmp 0x63c2
movq %rax, %r14
testq %rbx, %rbx
je 0x63ef
movq %rbx, %rdi
jmp 0x63ea
jmp 0x63ce
jmp 0x63c2
movq %rax, %r14
movb $0x1, %r13b
jmp 0x6267
movq %rax, %r14
jmp 0x628e
jmp 0x63c2
movq %rax, %r14
jmp 0x629b
movq %rax, %r14
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x6253
callq 0x65c2
jmp 0x6253
movq %rax, %r14
movq -0x118(%rbp), %rdi
testq %rdi, %rdi
je 0x6264
callq 0x65c2
xorl %r13d, %r13d
movq -0x138(%rbp), %rdi
testq %rdi, %rdi
je 0x6278
callq 0x65c2
movq -0x148(%rbp), %rdi
testq %rdi, %rdi
je 0x6289
callq 0x65c2
testb %r13b, %r13b
je 0x629b
movl $0x10, %esi
movq %rbx, %rdi
callq 0x4280
testq %r12, %r12
je 0x63e2
movq %r12, %rdi
jmp 0x63dd
jmp 0x637a
jmp 0x63c2
movq %rax, %r14
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x631d
callq 0x65c2
jmp 0x631d
jmp 0x637a
movq %rax, %r14
jmp 0x6307
jmp 0x637a
movq %rax, %r14
jmp 0x636a
movq %rax, %r14
movb $0x1, %r15b
jmp 0x6331
movq %rax, %r14
movq -0x78(%rbp), %rdi
jmp 0x630e
jmp 0x637a
movq %rax, %r14
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x6307
callq 0x65c2
movq -0x178(%rbp), %rdi
testq %rdi, %rdi
je 0x637d
callq 0x65c2
jmp 0x637d
movq %rax, %r14
movq -0x128(%rbp), %rdi
testq %rdi, %rdi
je 0x632e
callq 0x65c2
xorl %r15d, %r15d
movq -0x158(%rbp), %rdi
testq %rdi, %rdi
je 0x6342
callq 0x65c2
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x6353
callq 0x65c2
testb %r15b, %r15b
jne 0x635d
jmp 0x636a
movq %rax, %r14
movl $0x10, %esi
movq %rbx, %rdi
callq 0x4280
testq %r12, %r12
je 0x63b1
movq %r12, %rdi
jmp 0x63ac
jmp 0x639a
jmp 0x637a
jmp 0x637a
movq %rax, %r14
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x63ef
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
jmp 0x63ef
jmp 0x63c2
movq %rax, %r14
movq -0x108(%rbp), %rbx
testq %rbx, %rbx
je 0x63b1
movq %rbx, %rdi
callq 0x65c2
cmpq $0x0, -0x58(%rbp)
je 0x63ef
movq -0x58(%rbp), %rdi
jmp 0x63ea
jmp 0x63c9
jmp 0x63c2
movq %rax, %r14
jmp 0x63ef
jmp 0x63ce
movq %rax, %r14
jmp 0x6430
movq %rax, %r14
movq -0x48(%rbp), %rbx
testq %rbx, %rbx
je 0x63e2
movq %rbx, %rdi
callq 0x65c2
testq %r15, %r15
je 0x63ef
movq %r15, %rdi
callq 0x65c2
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x6411
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x4280
movq 0x11ba0(%rip), %rsi     # 0x17fb8
leaq -0x320(%rbp), %rdi
callq 0x4310
leaq -0x2a8(%rbp), %rdi
callq 0x40b0
movq -0x1a0(%rbp), %rdi
leaq -0x190(%rbp), %rax
cmpq %rax, %rdi
je 0x6452
movq -0x190(%rbp), %rsi
incq %rsi
callq 0x4280
leaq -0x100(%rbp), %rdi
callq 0x662e
movq %r14, %rdi
callq 0x4400