// File: Kingsford-Group[P]ghost2/src/spectralToDistance.hpp
// Function: distanceWorker(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::vector<LevelInfo, std::allocator<LevelInfo>>>, boost::unordered::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<LevelInfo, std::allocator<LevelInfo>>, boost::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::vector<LevelInfo, std::allocator<LevelInfo>>>>>*, D_alpha**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, ProgressBar*)
void distanceWorker(spectramap::value_type n, spectramap* m2,
    D_alpha** result, string* out, ProgressBar *pbar)
{
  auto end = m2->end();
  string name = n.first;
  vector<LevelInfo> info = n.second;
  ostringstream res;
  int i=0;
  for(auto it = m2->begin(); it != end; ++it){
    double topo = DTopo(&info[0], &(it->second)[0], min(info.size(), it->second.size()));
    res << name << "\t" << it->first << "\t" << topo << "\n";
    D_alpha* d = new D_alpha(name, it->first, topo);
    result[i++] = d;
  }
  pbar->update();
  *out = res.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x280(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x272e0
movq -0x280(%rbp), %rsi
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x10300
movq -0x280(%rbp), %rsi
addq $0x20, %rsi
leaq -0x68(%rbp), %rdi
callq 0x27300
jmp 0x183f9
leaq -0x1f0(%rbp), %rdi
callq 0x109b0
jmp 0x18407
movl $0x0, -0x1f4(%rbp)
movq -0x10(%rbp), %rdi
callq 0x273f0
movq %rax, -0x200(%rbp)
leaq -0x200(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x27430
testb $0x1, %al
jne 0x1843a
jmp 0x18710
xorl %eax, %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0x27460
movq %rax, -0x290(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x27480
movq %rax, -0x288(%rbp)
jmp 0x18463
movq -0x288(%rbp), %rdi
addq $0x20, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x27460
movq %rax, -0x2a8(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x274a0
movl %eax, -0x29c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x27480
movq %rax, -0x298(%rbp)
jmp 0x184a2
movq -0x298(%rbp), %rdi
addq $0x20, %rdi
callq 0x274a0
movl -0x29c(%rbp), %edi
movl %eax, %esi
callq 0x18010
movq -0x290(%rbp), %rdi
movq -0x2a8(%rbp), %rsi
movl %eax, %edx
callq 0x182b0
movsd %xmm0, -0x2b0(%rbp)
jmp 0x184de
movsd -0x2b0(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x10600
movq %rax, -0x2b8(%rbp)
jmp 0x18507
movq -0x2b8(%rbp), %rdi
leaq 0xa4376(%rip), %rsi     # 0xbc88b
callq 0x106c0
movq %rax, -0x2c0(%rbp)
jmp 0x18523
leaq -0x200(%rbp), %rdi
callq 0x27480
movq %rax, -0x2c8(%rbp)
jmp 0x18538
movq -0x2c8(%rbp), %rsi
movq -0x2c0(%rbp), %rdi
callq 0x10600
movq %rax, -0x2d0(%rbp)
jmp 0x18554
movq -0x2d0(%rbp), %rdi
leaq 0xa4329(%rip), %rsi     # 0xbc88b
callq 0x106c0
movq %rax, -0x2d8(%rbp)
jmp 0x18570
movq -0x2d8(%rbp), %rdi
movsd -0x208(%rbp), %xmm0
callq 0x10dc0
movq %rax, -0x2e0(%rbp)
jmp 0x1858d
movq -0x2e0(%rbp), %rdi
leaq 0xa406c(%rip), %rsi     # 0xbc607
callq 0x106c0
jmp 0x185a2
movl $0x50, %edi
callq 0x106e0
movq %rax, -0x2e8(%rbp)
jmp 0x185b5
movb $0x1, -0x251(%rbp)
leaq -0x230(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x10300
jmp 0x185ce
leaq -0x200(%rbp), %rdi
callq 0x27480
movq %rax, -0x2f0(%rbp)
jmp 0x185e3
movq -0x2f0(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x10300
jmp 0x185f8
movq -0x2e8(%rbp), %rdi
movsd -0x208(%rbp), %xmm0
leaq -0x230(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0x274d0
jmp 0x1861c
movb $0x0, -0x251(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x10460
leaq -0x230(%rbp), %rdi
callq 0x10460
movq -0x2e8(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x210(%rbp), %rdx
movq -0x18(%rbp), %rax
movl -0x1f4(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1f4(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
leaq -0x200(%rbp), %rdi
callq 0x27580
jmp 0x1867a
jmp 0x18421
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x18788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1877f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x18773
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x186f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x186e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x10460
leaq -0x230(%rbp), %rdi
callq 0x10460
testb $0x1, -0x251(%rbp)
jne 0x186fd
jmp 0x1870e
movq -0x2e8(%rbp), %rdi
movl $0x50, %esi
callq 0x10710
jmp 0x18773
movq -0x28(%rbp), %rdi
callq 0x14360
jmp 0x1871b
leaq -0x278(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x10730
jmp 0x18730
movq -0x20(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x108a0
leaq -0x278(%rbp), %rdi
callq 0x10460
leaq -0x1f0(%rbp), %rdi
callq 0x101a0
leaq -0x68(%rbp), %rdi
callq 0x27220
leaq -0x50(%rbp), %rdi
callq 0x10460
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
leaq -0x1f0(%rbp), %rdi
callq 0x101a0
leaq -0x68(%rbp), %rdi
callq 0x27220
leaq -0x50(%rbp), %rdi
callq 0x10460
movq -0x70(%rbp), %rdi
callq 0x10cc0
nopw (%rax,%rax)