// File: 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
subq $0x770, %rsp            # imm = 0x770
movq %rdi, -0x8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7660
leaq -0x78(%rbp), %rdi
callq 0x4350
movq -0x8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4050
movq %rax, -0x558(%rbp)
jmp 0x5dc7
movq -0x558(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x4310
movb %al, -0x559(%rbp)
jmp 0x5de5
movb -0x559(%rbp), %al
testb $0x1, %al
jne 0x5df4
jmp 0x7144
leaq -0x208(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x8, %edx
callq 0x43e0
jmp 0x5e0b
leaq -0x228(%rbp), %rdi
movq %rdi, -0x568(%rbp)
callq 0x4350
movq -0x568(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x4320
jmp 0x5e33
leaq -0x249(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x4430
movq -0x570(%rbp), %rdx
leaq 0x1a234(%rip), %rsi     # 0x20088
leaq -0x248(%rbp), %rdi
callq 0x4340
jmp 0x5e62
leaq -0x248(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x571(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x4180
leaq -0x249(%rbp), %rdi
callq 0x42d0
movb -0x571(%rbp), %al
testb $0x1, %al
jne 0x5ea2
jmp 0x61e0
leaq -0x270(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x4350
movq -0x580(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x4320
jmp 0x5eca
leaq -0x291(%rbp), %rdi
movq %rdi, -0x588(%rbp)
callq 0x4430
movq -0x588(%rbp), %rdx
leaq 0x1a1a3(%rip), %rsi     # 0x2008e
leaq -0x290(%rbp), %rdi
callq 0x4340
jmp 0x5ef9
leaq -0x290(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x7690
movb %al, -0x589(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x4180
leaq -0x291(%rbp), %rdi
callq 0x42d0
movb -0x589(%rbp), %al
testb $0x1, %al
jne 0x5f39
jmp 0x6043
leaq -0x208(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x4170
movq %rax, -0x598(%rbp)
jmp 0x5f55
movq -0x598(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
callq 0x4170
jmp 0x5f6a
movl -0x298(%rbp), %esi
movl -0x29c(%rbp), %edx
leaq -0x2b0(%rbp), %rdi
callq 0x5ae0
jmp 0x5f84
leaq -0x58(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x7720
jmp 0x5f96
leaq -0x2b0(%rbp), %rdi
callq 0x7750
jmp 0x61be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x715f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x249(%rbp), %rdi
callq 0x42d0
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x61cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x291(%rbp), %rdi
callq 0x42d0
jmp 0x61cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x7750
jmp 0x61cf
leaq -0x2d1(%rbp), %rdi
movq %rdi, -0x5a0(%rbp)
callq 0x4430
movq -0x5a0(%rbp), %rdx
leaq 0x1a031(%rip), %rsi     # 0x20095
leaq -0x2d0(%rbp), %rdi
callq 0x4340
jmp 0x6072
leaq -0x2d0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x7690
movb %al, -0x5a1(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x4180
leaq -0x2d1(%rbp), %rdi
callq 0x42d0
movb -0x5a1(%rbp), %al
testb $0x1, %al
jne 0x60b2
jmp 0x6165
leaq -0x2f8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x5850
jmp 0x60c7
leaq -0x2e8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x5940
jmp 0x60dc
leaq -0x58(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x7720
jmp 0x60ee
leaq -0x2e8(%rbp), %rdi
callq 0x7750
leaq -0x2f8(%rbp), %rdi
callq 0x72b0
jmp 0x61bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x2d1(%rbp), %rdi
callq 0x42d0
jmp 0x61cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6157
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x7750
leaq -0x2f8(%rbp), %rdi
callq 0x72b0
jmp 0x61cf
movq 0x29e84(%rip), %rdi     # 0x2fff0
leaq 0x19f2b(%rip), %rsi     # 0x2009e
callq 0x4280
movq %rax, -0x5b0(%rbp)
jmp 0x6181
movq -0x5b0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x4240
movq %rax, -0x5b8(%rbp)
jmp 0x619d
movq -0x5b8(%rbp), %rdi
movq 0x29df5(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x61b2
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4300
jmp 0x61be
leaq -0x270(%rbp), %rdi
callq 0x4180
jmp 0x710d
leaq -0x270(%rbp), %rdi
callq 0x4180
jmp 0x712a
leaq -0x319(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
callq 0x4430
movq -0x5c0(%rbp), %rdx
leaq 0x19eba(%rip), %rsi     # 0x200bb
leaq -0x318(%rbp), %rdi
callq 0x4340
jmp 0x620f
leaq -0x318(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x5c1(%rbp)
leaq -0x318(%rbp), %rdi
callq 0x4180
leaq -0x319(%rbp), %rdi
callq 0x42d0
movb -0x5c1(%rbp), %al
testb $0x1, %al
jne 0x624f
jmp 0x64f2
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x5d0(%rbp)
jmp 0x6261
movq -0x5d0(%rbp), %rsi
leaq -0x330(%rbp), %rdi
callq 0x7790
leaq -0x58(%rbp), %rdi
callq 0x77c0
jmp 0x627f
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x5d8(%rbp)
jmp 0x6291
movq -0x5d8(%rbp), %rsi
leaq -0x340(%rbp), %rdi
callq 0x7790
leaq -0x58(%rbp), %rdi
callq 0x77c0
jmp 0x62af
movl $0x10, %edi
callq 0x4290
movq %rax, -0x5e0(%rbp)
jmp 0x62c2
movb $0x1, -0x382(%rbp)
movl $0x30, %edi
callq 0x4290
movq %rax, -0x5e8(%rbp)
jmp 0x62dc
movb $0x1, -0x381(%rbp)
leaq -0x370(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
leaq -0x330(%rbp), %rsi
callq 0x7790
leaq -0x380(%rbp), %rdi
movq %rdi, -0x5f0(%rbp)
leaq -0x340(%rbp), %rsi
callq 0x7790
movq -0x5e8(%rbp), %rdi
movq -0x5f8(%rbp), %rsi
movq -0x5f0(%rbp), %rdx
callq 0x77e0
jmp 0x6333
movq -0x5e8(%rbp), %rsi
movb $0x0, -0x381(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x7850
jmp 0x634f
movq -0x5e0(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x7510
jmp 0x6364
movq -0x5e0(%rbp), %rsi
movb $0x0, -0x382(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x7530
jmp 0x6380
leaq -0x58(%rbp), %rdi
leaq -0x350(%rbp), %rsi
callq 0x7720
jmp 0x6392
leaq -0x350(%rbp), %rdi
callq 0x7750
leaq -0x360(%rbp), %rdi
callq 0x7560
leaq -0x380(%rbp), %rdi
callq 0x7750
leaq -0x370(%rbp), %rdi
callq 0x7750
leaq -0x340(%rbp), %rdi
callq 0x7750
leaq -0x330(%rbp), %rdi
callq 0x7750
jmp 0x710b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x319(%rbp), %rdi
callq 0x42d0
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x64e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x64d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x64b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6481
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6475
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x7750
leaq -0x360(%rbp), %rdi
callq 0x7560
leaq -0x380(%rbp), %rdi
callq 0x7750
leaq -0x370(%rbp), %rdi
callq 0x7750
testb $0x1, -0x381(%rbp)
jne 0x64a4
jmp 0x64b5
movq -0x5e8(%rbp), %rdi
movl $0x30, %esi
callq 0x42a0
jmp 0x64b7
testb $0x1, -0x382(%rbp)
jne 0x64c2
jmp 0x64d3
movq -0x5e0(%rbp), %rdi
movl $0x10, %esi
callq 0x42a0
jmp 0x64d5
leaq -0x340(%rbp), %rdi
callq 0x7750
leaq -0x330(%rbp), %rdi
callq 0x7750
jmp 0x712a
leaq -0x3a9(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0x4430
movq -0x600(%rbp), %rdx
leaq 0x19baf(%rip), %rsi     # 0x200c2
leaq -0x3a8(%rbp), %rdi
callq 0x4340
jmp 0x6521
leaq -0x3a8(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x601(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x4180
leaq -0x3a9(%rbp), %rdi
callq 0x42d0
movb -0x601(%rbp), %al
testb $0x1, %al
jne 0x6561
jmp 0x684e
leaq -0x3c0(%rbp), %rdi
callq 0x72f0
jmp 0x656f
leaq -0x208(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
callq 0x4160
jmp 0x6584
movq $0x0, -0x3b8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x610(%rbp)
jmp 0x65a1
movq -0x610(%rbp), %rsi
leaq -0x3d0(%rbp), %rdi
callq 0x7790
leaq -0x58(%rbp), %rdi
callq 0x77c0
jmp 0x65bf
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x618(%rbp)
jmp 0x65d1
movq -0x618(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
callq 0x7790
leaq -0x58(%rbp), %rdi
callq 0x77c0
jmp 0x65ef
movl $0x10, %edi
callq 0x4290
movq %rax, -0x620(%rbp)
jmp 0x6602
movb $0x1, -0x432(%rbp)
movl $0x40, %edi
callq 0x4290
movq %rax, -0x628(%rbp)
jmp 0x661c
movb $0x1, -0x431(%rbp)
leaq -0x410(%rbp), %rdi
movq %rdi, -0x638(%rbp)
leaq -0x3e0(%rbp), %rsi
callq 0x7790
leaq -0x420(%rbp), %rdi
movq %rdi, -0x630(%rbp)
leaq -0x3d0(%rbp), %rsi
callq 0x7790
movq -0x628(%rbp), %rdi
movq -0x638(%rbp), %rsi
movq -0x630(%rbp), %rdx
movups -0x3c0(%rbp), %xmm0
movaps %xmm0, -0x430(%rbp)
movq -0x430(%rbp), %rcx
movq -0x428(%rbp), %r8
callq 0x7880
jmp 0x668f
movq -0x628(%rbp), %rsi
movb $0x0, -0x431(%rbp)
leaq -0x400(%rbp), %rdi
callq 0x7900
jmp 0x66ab
movq -0x620(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x7510
jmp 0x66c0
movq -0x620(%rbp), %rsi
movb $0x0, -0x432(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x7530
jmp 0x66dc
leaq -0x58(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x7720
jmp 0x66ee
leaq -0x3f0(%rbp), %rdi
callq 0x7750
leaq -0x400(%rbp), %rdi
callq 0x7560
leaq -0x420(%rbp), %rdi
callq 0x7750
leaq -0x410(%rbp), %rdi
callq 0x7750
leaq -0x3e0(%rbp), %rdi
callq 0x7750
leaq -0x3d0(%rbp), %rdi
callq 0x7750
jmp 0x7109
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x3a9(%rbp), %rdi
callq 0x42d0
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x683d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6831
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6813
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x67dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x67d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x3f0(%rbp), %rdi
callq 0x7750
leaq -0x400(%rbp), %rdi
callq 0x7560
leaq -0x420(%rbp), %rdi
callq 0x7750
leaq -0x410(%rbp), %rdi
callq 0x7750
testb $0x1, -0x431(%rbp)
jne 0x6800
jmp 0x6811
movq -0x628(%rbp), %rdi
movl $0x40, %esi
callq 0x42a0
jmp 0x6813
testb $0x1, -0x432(%rbp)
jne 0x681e
jmp 0x682f
movq -0x620(%rbp), %rdi
movl $0x10, %esi
callq 0x42a0
jmp 0x6831
leaq -0x3e0(%rbp), %rdi
callq 0x7750
leaq -0x3d0(%rbp), %rdi
callq 0x7750
jmp 0x712a
leaq -0x459(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0x4430
movq -0x640(%rbp), %rdx
leaq 0x19859(%rip), %rsi     # 0x200c8
leaq -0x458(%rbp), %rdi
callq 0x4340
jmp 0x687d
leaq -0x458(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x641(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x4180
leaq -0x459(%rbp), %rdi
callq 0x42d0
movb -0x641(%rbp), %al
testb $0x1, %al
jne 0x68bd
jmp 0x6978
movq 0x29704(%rip), %rdi     # 0x2ffc8
leaq 0x19802(%rip), %rsi     # 0x200cd
callq 0x4280
movq %rax, -0x650(%rbp)
jmp 0x68d9
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x658(%rbp)
jmp 0x68eb
movq -0x658(%rbp), %rdi
callq 0x7930
movq %rax, %rdi
callq 0x7950
movl %eax, -0x65c(%rbp)
jmp 0x6907
movl -0x65c(%rbp), %esi
movq -0x650(%rbp), %rdi
callq 0x4410
movq %rax, -0x668(%rbp)
jmp 0x6922
movq -0x668(%rbp), %rdi
leaq 0x197a4(%rip), %rsi     # 0x200d4
callq 0x4280
movq %rax, -0x670(%rbp)
jmp 0x693e
movq -0x670(%rbp), %rdi
movq 0x29654(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6953
jmp 0x7107
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x459(%rbp), %rdi
callq 0x42d0
jmp 0x712a
leaq -0x481(%rbp), %rdi
movq %rdi, -0x678(%rbp)
callq 0x4430
movq -0x678(%rbp), %rdx
leaq 0x19744(%rip), %rsi     # 0x200dd
leaq -0x480(%rbp), %rdi
callq 0x4340
jmp 0x69a7
leaq -0x480(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x679(%rbp)
leaq -0x480(%rbp), %rdi
callq 0x4180
leaq -0x481(%rbp), %rdi
callq 0x42d0
movb -0x679(%rbp), %al
testb $0x1, %al
jne 0x69e7
jmp 0x6a6a
movq 0x295da(%rip), %rdi     # 0x2ffc8
leaq 0x196ed(%rip), %rsi     # 0x200e2
callq 0x4280
movq %rax, -0x688(%rbp)
jmp 0x6a03
movq -0x688(%rbp), %rdi
movq 0x2958f(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6a18
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x690(%rbp)
jmp 0x6a2a
movq -0x690(%rbp), %rdi
callq 0x7930
movq %rax, %rdi
movl $0x1, %esi
callq 0x79c0
jmp 0x6a45
jmp 0x7105
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x481(%rbp), %rdi
callq 0x42d0
jmp 0x712a
leaq -0x4a9(%rbp), %rdi
movq %rdi, -0x698(%rbp)
callq 0x4430
movq -0x698(%rbp), %rdx
leaq 0x19672(%rip), %rsi     # 0x200fd
leaq -0x4a8(%rbp), %rdi
callq 0x4340
jmp 0x6a99
leaq -0x4a8(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x699(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0x4180
leaq -0x4a9(%rbp), %rdi
callq 0x42d0
movb -0x699(%rbp), %al
testb $0x1, %al
jne 0x6ad9
jmp 0x6d09
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x6a8(%rbp)
jmp 0x6aeb
movq -0x6a8(%rbp), %rsi
leaq -0x4c0(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
callq 0x7790
movq -0x6b0(%rbp), %rdi
callq 0x7930
movq %rax, %rsi
leaq -0x4d0(%rbp), %rdi
callq 0x7a30
jmp 0x6b22
movl $0x1, -0x4d4(%rbp)
movq 0x29495(%rip), %rdi     # 0x2ffc8
leaq 0x195ae(%rip), %rsi     # 0x200e8
callq 0x4280
movq %rax, -0x6b8(%rbp)
jmp 0x6b48
movq -0x6b8(%rbp), %rdi
movq 0x2944a(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6b5d
jmp 0x6b5f
leaq -0x4d0(%rbp), %rdi
callq 0x7ab0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movb %al, -0x6b9(%rbp)
jmp 0x6b7f
movb -0x6b9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6b90
jmp 0x6caa
movl -0x4d4(%rbp), %esi
movq 0x2942b(%rip), %rdi     # 0x2ffc8
callq 0x4410
movq %rax, -0x6c8(%rbp)
jmp 0x6bab
movq -0x6c8(%rbp), %rdi
leaq 0x19d7c(%rip), %rsi     # 0x20935
callq 0x4280
movq %rax, -0x6d0(%rbp)
jmp 0x6bc7
leaq -0x4d0(%rbp), %rdi
callq 0x7ab0
movq %rax, %rdi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movq %rax, -0x6d8(%rbp)
jmp 0x6be7
movq -0x6d8(%rbp), %rax
movq %rax, -0x4e0(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x7ad0
movq -0x6d0(%rbp), %rdi
movq (%rax), %rsi
callq 0x4440
movq %rax, -0x6e0(%rbp)
jmp 0x6c19
movq -0x6e0(%rbp), %rdi
movq 0x29379(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6c2e
leaq -0x4d0(%rbp), %rdi
callq 0x7ab0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
jmp 0x6c48
movl -0x4d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4d4(%rbp)
jmp 0x6b5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x4a9(%rbp), %rdi
callq 0x42d0
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x6cf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x4d0(%rbp), %rdi
callq 0x7af0
jmp 0x6cf8
movq 0x29317(%rip), %rdi     # 0x2ffc8
leaq 0x19430(%rip), %rsi     # 0x200e8
callq 0x4280
movq %rax, -0x6e8(%rbp)
jmp 0x6cc6
movq -0x6e8(%rbp), %rdi
movq 0x292cc(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6cdb
leaq -0x4d0(%rbp), %rdi
callq 0x7af0
leaq -0x4c0(%rbp), %rdi
callq 0x7750
jmp 0x7103
leaq -0x4c0(%rbp), %rdi
callq 0x7750
jmp 0x712a
leaq -0x501(%rbp), %rdi
movq %rdi, -0x6f0(%rbp)
callq 0x4430
movq -0x6f0(%rbp), %rdx
leaq 0x193ce(%rip), %rsi     # 0x200f8
leaq -0x500(%rbp), %rdi
callq 0x4340
jmp 0x6d38
leaq -0x500(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x7690
movb %al, -0x6f1(%rbp)
leaq -0x500(%rbp), %rdi
callq 0x4180
leaq -0x501(%rbp), %rdi
callq 0x42d0
movb -0x6f1(%rbp), %al
testb $0x1, %al
jne 0x6d78
jmp 0x70aa
leaq -0x58(%rbp), %rdi
callq 0x7770
movq %rax, -0x700(%rbp)
jmp 0x6d8a
movq -0x700(%rbp), %rsi
leaq -0x518(%rbp), %rdi
movq %rdi, -0x708(%rbp)
callq 0x7790
xorl %eax, %eax
movl %eax, %esi
leaq -0x528(%rbp), %rdi
callq 0x43b0
movq -0x708(%rbp), %rdi
callq 0x7930
movq %rax, %rsi
leaq -0x548(%rbp), %rdi
callq 0x7a30
jmp 0x6dd1
movl $0x1, -0x54c(%rbp)
leaq -0x548(%rbp), %rdi
callq 0x7ab0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movb %al, -0x709(%rbp)
jmp 0x6dfb
movb -0x709(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x6e09
jmp 0x6e88
leaq -0x548(%rbp), %rdi
callq 0x7ab0
movq %rax, %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
jmp 0x6e23
movl -0x54c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54c(%rbp)
jmp 0x6ddb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x501(%rbp), %rdi
callq 0x42d0
jmp 0x712a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x7099
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x548(%rbp), %rdi
callq 0x7af0
jmp 0x7099
xorl %eax, %eax
movl %eax, %esi
leaq -0x538(%rbp), %rdi
callq 0x43b0
movq -0x538(%rbp), %rdx
movq -0x530(%rbp), %rax
movq -0x528(%rbp), %rsi
movq -0x520(%rbp), %rcx
subq %rsi, %rdx
cvtsi2sd %rdx, %xmm0
subq %rcx, %rax
cvtsi2sd %rax, %xmm1
movsd 0x191b4(%rip), %xmm2    # 0x20080
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x550(%rbp)
movq 0x290e1(%rip), %rdi     # 0x2ffc8
leaq 0x191fa(%rip), %rsi     # 0x200e8
callq 0x4280
movq %rax, -0x718(%rbp)
jmp 0x6efc
movq -0x718(%rbp), %rdi
movq 0x29096(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6f11
movq 0x290b0(%rip), %rdi     # 0x2ffc8
leaq 0x191e3(%rip), %rsi     # 0x20102
callq 0x4280
movq %rax, -0x720(%rbp)
jmp 0x6f2d
movq -0x720(%rbp), %rdi
movl -0x54c(%rbp), %esi
decl %esi
callq 0x4410
movq %rax, -0x728(%rbp)
jmp 0x6f4a
movq -0x728(%rbp), %rdi
movq 0x29048(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6f5f
movq 0x29062(%rip), %rdi     # 0x2ffc8
leaq 0x191a7(%rip), %rsi     # 0x20114
callq 0x4280
movq %rax, -0x730(%rbp)
jmp 0x6f7b
movq -0x730(%rbp), %rdi
movss -0x550(%rbp), %xmm0
callq 0x41e0
movq %rax, -0x738(%rbp)
jmp 0x6f98
movq -0x738(%rbp), %rdi
leaq 0x1917b(%rip), %rsi     # 0x20121
callq 0x4280
movq %rax, -0x740(%rbp)
jmp 0x6fb4
movq -0x740(%rbp), %rdi
movq 0x28fde(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x6fc9
cmpl $0x1, -0x54c(%rbp)
jle 0x704e
movq 0x28fef(%rip), %rdi     # 0x2ffc8
leaq 0x19145(%rip), %rsi     # 0x20125
callq 0x4280
movq %rax, -0x748(%rbp)
jmp 0x6fee
movq -0x748(%rbp), %rdi
movss -0x550(%rbp), %xmm0
movl -0x54c(%rbp), %eax
decl %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
callq 0x41e0
movq %rax, -0x750(%rbp)
jmp 0x701b
movq -0x750(%rbp), %rdi
leaq 0x190f8(%rip), %rsi     # 0x20121
callq 0x4280
movq %rax, -0x758(%rbp)
jmp 0x7037
movq -0x758(%rbp), %rdi
movq 0x28f5b(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x704c
jmp 0x704e
movq 0x28f73(%rip), %rdi     # 0x2ffc8
leaq 0x1908c(%rip), %rsi     # 0x200e8
callq 0x4280
movq %rax, -0x760(%rbp)
jmp 0x706a
movq -0x760(%rbp), %rdi
movq 0x28f28(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x707f
leaq -0x548(%rbp), %rdi
callq 0x7af0
leaq -0x518(%rbp), %rdi
callq 0x7750
jmp 0x7101
leaq -0x518(%rbp), %rdi
callq 0x7750
jmp 0x712a
movq 0x28f3f(%rip), %rdi     # 0x2fff0
leaq 0x1907b(%rip), %rsi     # 0x20133
callq 0x4280
movq %rax, -0x768(%rbp)
jmp 0x70c6
movq -0x768(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x4240
movq %rax, -0x770(%rbp)
jmp 0x70e2
movq -0x770(%rbp), %rdi
movq 0x28eb0(%rip), %rsi     # 0x2ffa0
callq 0x42c0
jmp 0x70f7
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4300
jmp 0x7103
jmp 0x7105
jmp 0x7107
jmp 0x7109
jmp 0x710b
jmp 0x710d
leaq -0x228(%rbp), %rdi
callq 0x4180
leaq -0x208(%rbp), %rdi
callq 0x4120
jmp 0x5db1
leaq -0x228(%rbp), %rdi
callq 0x4180
leaq -0x208(%rbp), %rdi
callq 0x4120
jmp 0x715f
leaq -0x78(%rbp), %rdi
callq 0x4180
leaq -0x58(%rbp), %rdi
callq 0x7b10
addq $0x770, %rsp            # imm = 0x770
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x4180
leaq -0x58(%rbp), %rdi
callq 0x7b10
movq -0x80(%rbp), %rdi
callq 0x4420
nopw (%rax,%rax)