// File: 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
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movslq -0x14(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x67b0
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rcx
leaq -0x38(%rbp), %rdi
movl $0x20, %edx
callq 0xdb40
jmp 0x911a
leaq -0x39(%rbp), %rdi
callq 0x64a0
movq -0x10(%rbp), %rdi
leaq 0x301b7(%rip), %rsi     # 0x392e5
callq 0x6420
movq %rax, -0xe8(%rbp)
jmp 0x913c
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdi
callq 0x6380
movq %rax, -0xf0(%rbp)
jmp 0x9158
movq -0xf0(%rbp), %rdi
leaq 0x30164(%rip), %rsi     # 0x392ca
callq 0x6420
movq %rax, -0xf8(%rbp)
jmp 0x9174
movq -0xe0(%rbp), %rsi
movq -0xf8(%rbp), %rdi
callq 0x63e0
movq %rax, -0x100(%rbp)
jmp 0x9190
movq -0x100(%rbp), %rdi
leaq 0x30137(%rip), %rsi     # 0x392d5
callq 0x6420
jmp 0x91a5
movl $0x0, -0x50(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xdbb0
movq -0xe0(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xdbd0
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xdc00
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xdc30
testb $0x1, %al
jne 0x91f4
jmp 0x927b
leaq -0x78(%rbp), %rdi
callq 0xdc70
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0xc180
movq %rax, -0x90(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xdc90
jmp 0x9229
jmp 0x922b
leaq -0x78(%rbp), %rdi
callq 0xdcc0
jmp 0x91de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x64a0
jmp 0x9574
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x956b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xde00
jmp 0x956b
leaq -0x68(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xdd20
movq -0x108(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0xdd50
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0xdce0
jmp 0x92ba
leaq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0xdd20
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0xdd50
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xdd80
testb $0x1, %al
jne 0x9307
jmp 0x9550
leaq -0xb8(%rbp), %rdi
callq 0xddc0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %eax
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rax
cmpl $0x2, 0x20(%rax)
jbe 0x953d
movq 0x4cc70(%rip), %rdi     # 0x55fb8
leaq -0x38(%rbp), %rsi
callq 0x63e0
movq %rax, -0x110(%rbp)
jmp 0x935a
movq -0x110(%rbp), %rdi
movl $0x22, %esi
callq 0x6540
movq %rax, -0x118(%rbp)
jmp 0x9374
movq -0xe0(%rbp), %rsi
movq -0x118(%rbp), %rdi
callq 0x63e0
movq %rax, -0x120(%rbp)
jmp 0x9390
movq -0x120(%rbp), %rdi
leaq 0x2ff3b(%rip), %rsi     # 0x392d9
callq 0x6420
movq %rax, -0x128(%rbp)
jmp 0x93ac
movq -0x128(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rsi
callq 0x63e0
movq %rax, -0x130(%rbp)
jmp 0x93cb
movq -0x130(%rbp), %rdi
leaq 0x2ff05(%rip), %rsi     # 0x392de
callq 0x6420
movq %rax, -0x138(%rbp)
jmp 0x93e7
movq -0x138(%rbp), %rdi
movq 0x4cb8b(%rip), %rsi     # 0x55f80
callq 0x6480
jmp 0x93fc
movq -0x10(%rbp), %rdi
leaq 0x2fede(%rip), %rsi     # 0x392e5
callq 0x6420
movq %rax, -0x140(%rbp)
jmp 0x9415
movq -0x140(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rsi
callq 0x6380
movq %rax, -0x148(%rbp)
jmp 0x9434
movq -0x148(%rbp), %rdi
leaq 0x2fe9e(%rip), %rsi     # 0x392e0
callq 0x6420
movq %rax, -0x150(%rbp)
jmp 0x9450
movq -0xe0(%rbp), %rsi
movq -0x150(%rbp), %rdi
callq 0x6380
movq %rax, -0x158(%rbp)
jmp 0x946c
movq -0x158(%rbp), %rdi
leaq 0x2fe79(%rip), %rsi     # 0x392f3
callq 0x6420
jmp 0x9481
movq -0x10(%rbp), %rdi
leaq 0x2fe5c(%rip), %rsi     # 0x392e8
callq 0x6420
movq %rax, -0x160(%rbp)
jmp 0x949a
movq -0x160(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %esi
callq 0x6600
movq %rax, -0x168(%rbp)
jmp 0x94bc
movq -0x168(%rbp), %rdi
leaq 0x2fe2c(%rip), %rsi     # 0x392f6
callq 0x6420
jmp 0x94d1
movq -0x10(%rbp), %rdi
leaq 0x2fe1f(%rip), %rsi     # 0x392fb
callq 0x6420
movq %rax, -0x170(%rbp)
jmp 0x94ea
movq -0x170(%rbp), %rdi
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %esi
callq 0x6600
movq %rax, -0x178(%rbp)
jmp 0x950c
movq -0x178(%rbp), %rdi
leaq 0x2fdee(%rip), %rsi     # 0x39308
callq 0x6420
jmp 0x9521
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
incl %edx
callq 0x90c0
jmp 0x953b
jmp 0x953d
jmp 0x953f
leaq -0xb8(%rbp), %rdi
callq 0xdde0
jmp 0x92eb
leaq -0x68(%rbp), %rdi
callq 0xde00
leaq -0x38(%rbp), %rdi
callq 0x6290
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x6290
movq -0x48(%rbp), %rdi
callq 0x67a0
nopl (%rax)