// File: /workspace/github_cpp_makefile_star2_O1/UBOdin[P]jitd-cpp/src/ds_tester.cpp
// Function: ds_test(std::istream&)
void ds_test(istream &input) 
{
  string line;
  shared_ptr<map<Key,Value>> ds(new map<Key,Value>());

  while(getline(input, line)){
    istringstream toks(line);
    string op;

    CASE_1("--") {
      // skip, comment
    } CASE("init") {
      RecordBuffer data = buffer_cmd(toks);
      vector<pair<Key, Value>> map_data;

      for(BufferElement<Record> curr = data->begin(); curr != data->end(); ++curr){
        map_data.push_back(std::make_pair(curr->key, curr->value));
      }

      timeval start, end;      
      gettimeofday(&start, NULL);
      for(vector<pair<Key,Value>>::iterator curr = map_data.begin(); curr != map_data.end(); curr++){
        ds->insert(*curr);
      }
      // for(BufferElement<Record> curr = data->begin(); curr != data->end(); ++curr){
      //   ds->emplace(curr->key, curr->value);
      // }
      gettimeofday(&end, NULL);
      cout << "Load Map: " << total_time(start, end) << " us" << endl;

    } else {
      cout << "Skipping irrelevant operation: " << line << endl;
    }

  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x30, %edi
callq 0x4270
movq %rax, %rcx
addq $0x8, %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq $0x0, 0x28(%rax)
leaq -0xb8(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq %rax, %rsi
callq 0xf9a2
leaq -0x40(%rbp), %r13
leaq -0x250(%rbp), %r12
leaq -0x50(%rbp), %r14
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4250
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x90(%rbp), %rsi
callq 0x4420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xf8af
movq %r12, %rdi
leaq -0x90(%rbp), %rsi
movl $0x8, %edx
callq 0x43b0
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x0, -0x68(%rbp)
movb $0x0, -0x60(%rbp)
movq %r12, %rdi
leaq -0x70(%rbp), %rsi
callq 0x4300
movq %r13, -0x50(%rbp)
movq %r14, %rdi
leaq 0x1a80(%rip), %rsi      # 0x11095
leaq 0x1a7b(%rip), %rdx      # 0x11097
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0xf645
testq %rdx, %rdx
je 0xf64a
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0xf64d
xorl %r15d, %r15d
jmp 0xf64d
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xf662
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %r15b, %r15b
jne 0xf876
movq %r13, -0x50(%rbp)
movq %r14, %rdi
leaq 0x20a1(%rip), %rsi      # 0x1171a
leaq 0x209e(%rip), %rdx      # 0x1171e
callq 0x7c1e
movq -0x48(%rbp), %rdx
cmpq -0x68(%rbp), %rdx
jne 0xf6a9
testq %rdx, %rdx
je 0xf6ae
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdi
callq 0x42a0
testl %eax, %eax
sete %r15b
jmp 0xf6b1
xorl %r15d, %r15d
jmp 0xf6b1
movb $0x1, %r15b
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0xf6c6
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x4280
testb %r15b, %r15b
je 0xf73f
leaq -0xb0(%rbp), %rdi
movq %r12, %rsi
callq 0xfda6
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0xb0(%rbp), %rax
movq (%rax), %r15
cmpq 0x8(%rax), %r15
je 0xf7a0
movups (%r15), %xmm0
movups %xmm0, -0xa0(%rbp)
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0xf723
movups -0xa0(%rbp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, -0x48(%rbp)
jmp 0xf732
movq %r14, %rdi
leaq -0xa0(%rbp), %rdx
callq 0xface
addq $0x10, %r15
movq -0xb0(%rbp), %rax
jmp 0xf6f3
movl $0x1f, %edx
movq 0x987d(%rip), %rdi      # 0x18fc8
leaq 0x275e(%rip), %rsi      # 0x11eb0
callq 0x42d0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x985c(%rip), %rdi      # 0x18fc8
callq 0x42d0
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
jmp 0xf876
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
callq 0x4380
movq -0x50(%rbp), %r15
cmpq -0x48(%rbp), %r15
je 0xf7cd
movq -0xc0(%rbp), %rdi
movq %r15, %rsi
callq 0xfc1c
addq $0x10, %r15
jmp 0xf7b2
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
callq 0x4380
movl $0xa, %edx
movq 0x97e1(%rip), %rdi      # 0x18fc8
leaq 0x26b7(%rip), %rsi      # 0x11ea5
callq 0x42d0
leaq -0xa0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xfd7c
movq 0x97bb(%rip), %rdi      # 0x18fc8
callq 0x4360
movq %rax, %r15
movl $0x3, %edx
movq %rax, %rdi
leaq 0x189d(%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
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xf865
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x4280
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0xf876
callq 0x6810
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf88f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
movq %r12, %rdi
movq 0x971f(%rip), %rsi      # 0x18fb8
callq 0x4310
leaq -0x1d8(%rbp), %rdi
callq 0x40b0
jmp 0xf59b
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0xf8c0
callq 0x6810
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf8dc
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x4280
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xf97e
jmp 0xf907
jmp 0xf907
jmp 0xf907
jmp 0xf902
jmp 0xf90c
jmp 0xf90c
movq %rax, %rbx
jmp 0xf96d
movq %rax, %rbx
jmp 0xf935
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xf924
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x4280
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0xf935
callq 0x6810
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf94e
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x4280
movq 0x9663(%rip), %rsi      # 0x18fb8
leaq -0x250(%rbp), %rdi
callq 0x4310
leaq -0x1d8(%rbp), %rdi
callq 0x40b0
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0xf97e
callq 0x6810
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf99a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x4280
movq %rbx, %rdi
callq 0x4400