// File: /workspace/github_cpp_makefile_star2_O1/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, 0xc(%rsp)
movslq %edx, %rsi
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x28(%rsp), %rdi
movl $0x20, %edx
callq 0x43b0
leaq 0xf2a6(%rip), %rsi      # 0x15244
movl $0x2, %edx
movq %r14, %rdi
callq 0x4390
movq %r14, %rdi
movq %r15, %rsi
callq 0x4260
movq %rax, %r12
leaq 0xf269(%rip), %rsi      # 0x15229
movl $0xa, %edx
movq %rax, %rdi
callq 0x4390
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r12, %rdi
callq 0x4390
leaq 0xf251(%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 0x6032
leaq 0x10(%rsp), %r12
movq %rsp, %r13
movq (%rbp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x67ec
addq $0x8, %rbp
cmpq %rbx, %rbp
jne 0x6016
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
cmpq %r13, %r12
je 0x606e
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 0x6957
movq %r12, %rdi
movq %r13, %rsi
callq 0x6a43
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %r13
cmpq %r13, %r12
movl 0xc(%rsp), %ebx
je 0x6216
incl %ebx
movq (%r12), %rax
cmpl $0x3, 0x20(%rax)
jb 0x6209
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x17f0a(%rip), %rdi     # 0x1dfb0
callq 0x4390
movb $0x22, (%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %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 0xf158(%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 0xf133(%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 0xf0fe(%rip), %rsi      # 0x15244
callq 0x4390
movq (%r12), %rsi
movq %r14, %rdi
callq 0x4260
movq %rax, %rbp
movl $0x7, %edx
movq %rax, %rdi
leaq 0xf0d6(%rip), %rsi      # 0x1523f
callq 0x4390
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4260
movl $0x2, %edx
movq %rax, %rdi
leaq 0xf0ca(%rip), %rsi      # 0x15252
callq 0x4390
movl $0xd, %edx
movq %r14, %rdi
leaq 0xf0ab(%rip), %rsi      # 0x15247
callq 0x4390
movq (%r12), %rax
movl 0x20(%rax), %esi
movq %r14, %rdi
callq 0x4200
movl $0x4, %edx
movq %rax, %rdi
leaq 0xf096(%rip), %rsi      # 0x15255
callq 0x4390
movl $0xc, %edx
movq %r14, %rdi
leaq 0xf087(%rip), %rsi      # 0x1525a
callq 0x4390
movq (%r12), %rax
movl 0x20(%rax), %esi
movq %r14, %rdi
callq 0x4200
movl $0x3, %edx
movq %rax, %rdi
leaq 0xf071(%rip), %rsi      # 0x15267
callq 0x4390
movq (%r12), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x5f64
addq $0x8, %r12
cmpq %r13, %r12
jne 0x6087
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x622d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6249
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 0x6261
movq %rax, %rbx
jmp 0x627b
jmp 0x6261
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x627b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4320
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6297
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4320
movq %rbx, %rdi
callq 0x4520
nop