// File: /workspace/github_cpp_makefile_star2_O3/ahupowerdns[P]spamidea/getsender.cc
// Function: MailTreeNode::emitLinks(std::basic_ofstream<char, std::char_traits<char>>&, int) const
void emitLinks(ofstream& fs, int depth=0) const
  {
    string prefix(depth, ' ');
    //    cout << prefix << '"' << d_name << "\"\n";
    fs << "\"a" << (void*) this << "\" [label=\""<< d_name << "\"]\n";
    unsigned int ccount=0;

    vector<MailTreeNode*> children;
    for(const auto& mtn : d_children) {
      children.push_back(mtn.get());
    }
    sort(children.begin(), children.end(),
         [](const auto& a, const auto& b) {
           return (b)->d_count < (a)->d_count;
         });
    
    //    reverse(children.begin() + children.size()/2, children.end());
    for(const auto& mtn : children) {
      ccount += mtn->d_count;
      if(mtn->d_count > 2) {
        cout << prefix << '"' << d_name << "\" -> \"" << mtn->d_name << "\""<< endl; 
        fs << "\"a" <<(void*)mtn  << "\" -> \"a" << (void*) this << "\" ";
        fs << " [ label = \" " << mtn->d_count<<" \"] ";
        fs << " [ weight = " << mtn->d_count<<" ]\n";

        mtn->emitLinks(fs, depth+1);
      }
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %r15
movl %edx, 0x4(%rsp)
movslq %edx, %rsi
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28(%rsp), %rdi
movl $0x20, %edx
callq 0x43b0
leaq 0xf2e6(%rip), %rsi      # 0x15244
movl $0x2, %edx
movq %r14, %rdi
callq 0x4390
movq %r14, %rdi
movq %r15, %rsi
callq 0x4260
movq %rax, %r12
leaq 0xf2a9(%rip), %rsi      # 0x15229
movl $0xa, %edx
movq %rax, %rdi
callq 0x4390
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x4390
leaq 0xf291(%rip), %rsi      # 0x15234
movl $0x3, %edx
movq %rax, %rdi
callq 0x4390
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x28(%r15), %rbp
movq 0x30(%r15), %rbx
cmpq %rbx, %rbp
je 0x603c
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
movq (%rbp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x67d6
addq $0x8, %rbp
cmpq %rbx, %rbp
jne 0x5fd8
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
cmpq %r13, %r12
je 0x603f
movq %r13, %rax
subq %r12, %rax
sarq $0x3, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6949
movl 0x4(%rsp), %ebx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6a35
movq 0x10(%rsp), %r12
jmp 0x6043
xorl %r12d, %r12d
movl 0x4(%rsp), %ebx
movq 0x18(%rsp), %r13
cmpq %r13, %r12
je 0x61ea
incl %ebx
movq (%r12), %rax
cmpl $0x3, 0x20(%rax)
jb 0x61d8
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x17f3e(%rip), %rdi     # 0x1dfb0
callq 0x4390
movb $0x22, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x4390
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rax, %rdi
callq 0x4390
movq %rax, %rbp
movl $0x6, %edx
movq %rax, %rdi
leaq 0xf189(%rip), %rsi      # 0x15238
callq 0x4390
movq (%r12), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbp, %rdi
callq 0x4390
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0xf164(%rip), %rsi      # 0x1523d
callq 0x4390
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x42e0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4210
movl $0x2, %edx
movq %r14, %rdi
leaq 0xf12f(%rip), %rsi      # 0x15244
callq 0x4390
movq (%r12), %rsi
movq %r14, %rdi
callq 0x4260
movq %rax, %rbp
movl $0x7, %edx
movq %rax, %rdi
leaq 0xf107(%rip), %rsi      # 0x1523f
callq 0x4390
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4260
movl $0x2, %edx
movq %rax, %rdi
leaq 0xf0fb(%rip), %rsi      # 0x15252
callq 0x4390
movl $0xd, %edx
movq %r14, %rdi
leaq 0xf0dc(%rip), %rsi      # 0x15247
callq 0x4390
movq (%r12), %rax
movl 0x20(%rax), %esi
movq %r14, %rdi
callq 0x4200
movl $0x4, %edx
movq %rax, %rdi
leaq 0xf0c7(%rip), %rsi      # 0x15255
callq 0x4390
movl $0xc, %edx
movq %r14, %rdi
leaq 0xf0b8(%rip), %rsi      # 0x1525a
callq 0x4390
movq (%r12), %rax
movl 0x20(%rax), %esi
movq %r14, %rdi
callq 0x4200
movl $0x3, %edx
movq %rax, %rdi
leaq 0xf0a2(%rip), %rsi      # 0x15267
callq 0x4390
movq (%r12), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x5f24
addq $0x8, %r12
cmpq %r13, %r12
jne 0x6053
movq 0x10(%rsp), %r12
testq %r12, %r12
leaq 0x38(%rsp), %rbx
je 0x6204
movq 0x20(%rsp), %rsi
subq %r12, %rsi
movq %r12, %rdi
callq 0x4320
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x621b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4320
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6238
movq %rax, %rbx
leaq 0x38(%rsp), %r14
jmp 0x6257
jmp 0x6238
movq %rax, %rbx
leaq 0x38(%rsp), %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x6257
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x626e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x4520