// File: /workspace/github_cpp_makefile_star2_O1/cegme[P]vose/VoseTree.cc
// Function: VoseTree::histogram[abi:cxx11](VoseTree, long)
std::map<std::string, double> 
    VoseTree::histogram(VoseTree tree, long samples) {

    std::map<std::string,double> histogram;
    long hist_sum = 0L;
    for (int i = 0; i != samples; ++i) {
      auto idx = tree.rand_marble();

      if (histogram.find(idx.label) != histogram.end()) {
        histogram[idx.label] += 1.0;
        hist_sum += 1L;
      }
      else {
        histogram.insert(std::make_pair(idx.label, 1.0));
        hist_sum += 1L;
      }
    }
    
    std::map<std::string,double> new_hist;
    std::for_each(histogram.cbegin(), histogram.cend(),
      [&new_hist,hist_sum] (std::pair<const std::string, double> a) {
        //std::cerr << a.first << ", " << (double)a.second/hist_sum << "\n";
        new_hist.insert( std::make_pair(a.first,(double)a.second/hist_sum));
    });

    return new_hist;

  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, -0x38(%rbp)
leaq -0xc0(%rbp), %r13
movl $0x0, (%r13)
xorl %eax, %eax
movq %rax, 0x8(%r13)
movq %r13, 0x10(%r13)
movq %r13, 0x18(%r13)
movq %rax, 0x20(%r13)
testq %rdx, %rdx
je 0x4179
movq %rsi, %r15
leaq -0x90(%rbp), %r12
leaq -0xc8(%rbp), %r14
movq %rdx, -0x30(%rbp)
movq %rdx, %rbx
movq %rsi, -0x40(%rbp)
leaq -0x98(%rbp), %rdi
movq %r15, %rsi
callq 0x3620
movq %r14, %rdi
movq %r12, %rsi
callq 0x69ee
cmpq %r13, %rax
je 0x40f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x46b4
movsd (%rax), %xmm0
addsd 0x6f56(%rip), %xmm0     # 0xb040
movsd %xmm0, (%rax)
jmp 0x4150
movq %r12, %r15
movq %r13, %r12
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %r13
movq %r13, %rdi
callq 0x4742
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x48(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x669e
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
movq %r12, %r13
je 0x4149
callq 0x21c0
movq %r15, %r12
movq -0x40(%rbp), %r15
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x4165
callq 0x21c0
decq %rbx
jne 0x40b4
xorps %xmm0, %xmm0
cvtsi2sdq -0x30(%rbp), %xmm0
jmp 0x417d
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x38(%rbp), %rdx
leaq 0x8(%rdx), %rax
movl $0x0, 0x8(%rdx)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdx)
movq %rax, 0x18(%rdx)
movq %rax, 0x20(%rdx)
movq %rcx, 0x28(%rdx)
movq -0xb0(%rbp), %r14
cmpq %r13, %r14
je 0x425f
leaq -0x58(%rbp), %rbx
leaq -0x88(%rbp), %r13
leaq -0x68(%rbp), %r15
leaq -0x98(%rbp), %r12
movq %rbx, -0x68(%rbp)
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x4742
movsd 0x40(%r14), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd %xmm0, -0x48(%rbp)
movq %r13, -0x98(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x4742
movsd -0x40(%rbp), %xmm0
divsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0x669e
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0x4236
callq 0x21c0
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4244
callq 0x21c0
movq %r14, %rdi
callq 0x2210
movq %rax, %r14
leaq -0xc0(%rbp), %rax
cmpq %rax, %r14
jne 0x41c9
leaq -0xc8(%rbp), %rdi
callq 0x52c6
movq -0x38(%rbp), %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x42db
callq 0x21c0
jmp 0x42db
jmp 0x42d8
jmp 0x42d8
movq %rax, %r14
jmp 0x42c8
movq %rax, %r14
jmp 0x42ba
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %r13, %rdi
je 0x42ba
callq 0x21c0
movq -0x68(%rbp), %rdi
cmpq %rbx, %rdi
je 0x42c8
callq 0x21c0
movq -0x38(%rbp), %rdi
callq 0x52c6
jmp 0x42f0
movq %rax, %r14
jmp 0x42f0
movq %rax, %r14
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x42f0
callq 0x21c0
leaq -0xc8(%rbp), %rdi
callq 0x52c6
movq %r14, %rdi
callq 0x22b0