// File: lionell[P]huffman-rle/main.cc
// Function: convolute[abi:cxx11](Node const*)
map<char, string> convolute(const Node *root) {
  map<char, string> res;
  if (root->val != 0) {
    res[root->val] = "";
    return res;
  }
  map<char, string> zero = convolute(root->zero);
  for (auto const& p : zero) {
    res[p.first] = "0" + p.second;
  }
  map<char, string> one = convolute(root->one);
  for (auto const& p : one) {
    res[p.first] = "1" + p.second;
  }
  return res;
}

// Assembly:
subq $0x138, %rsp            # imm = 0x138
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x130(%rsp)
movq %rsi, 0x128(%rsp)
movb $0x0, 0x127(%rsp)
callq 0x3bb0
movq 0x128(%rsp), %rax
movsbl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0x2b63
movq 0x20(%rsp), %rdi
movq 0x128(%rsp), %rsi
addq $0x10, %rsi
callq 0x3bc0
movq %rax, 0x18(%rsp)
jmp 0x2b1f
movq 0x18(%rsp), %rdi
leaq 0x550e(%rip), %rsi      # 0x8039
callq 0x2260
jmp 0x2b32
movb $0x1, 0x127(%rsp)
movl $0x1, 0x110(%rsp)
jmp 0x2dce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x2def
movq 0x128(%rsp), %rax
movq (%rax), %rsi
leaq 0xe0(%rsp), %rdi
callq 0x2ac0
jmp 0x2b7d
leaq 0xe0(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x3cb0
movq %rax, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x3ce0
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3d10
testb $0x1, %al
jne 0x2bd5
jmp 0x2c95
leaq 0xd0(%rsp), %rdi
callq 0x3d30
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdx
addq $0x8, %rdx
leaq 0x543b(%rip), %rsi      # 0x8038
leaq 0xa0(%rsp), %rdi
callq 0x3d50
jmp 0x2c0c
movq 0x20(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x3bc0
movq %rax, 0x10(%rsp)
jmp 0x2c25
movq 0x10(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2230
leaq 0xa0(%rsp), %rdi
callq 0x20f0
leaq 0xd0(%rsp), %rdi
callq 0x3e80
jmp 0x2bb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x2dbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x20f0
jmp 0x2dbf
movq 0x128(%rsp), %rax
movq 0x8(%rax), %rsi
leaq 0x70(%rsp), %rdi
callq 0x2ac0
jmp 0x2cad
leaq 0x70(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x3cb0
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
callq 0x3ce0
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3d10
testb $0x1, %al
jne 0x2ced
jmp 0x2d89
leaq 0x60(%rsp), %rdi
callq 0x3d30
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdx
addq $0x8, %rdx
leaq 0x532e(%rip), %rsi      # 0x803a
leaq 0x30(%rsp), %rdi
callq 0x3d50
jmp 0x2d18
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rsi
callq 0x3bc0
movq %rax, 0x8(%rsp)
jmp 0x2d2e
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2230
leaq 0x30(%rsp), %rdi
callq 0x20f0
leaq 0x60(%rsp), %rdi
callq 0x3e80
jmp 0x2cd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
jmp 0x2db5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x118(%rsp)
movl %eax, 0x114(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x20f0
jmp 0x2db5
movb $0x1, 0x127(%rsp)
movl $0x1, 0x110(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x3eb0
leaq 0xe0(%rsp), %rdi
callq 0x3eb0
jmp 0x2dce
leaq 0x70(%rsp), %rdi
callq 0x3eb0
leaq 0xe0(%rsp), %rdi
callq 0x3eb0
jmp 0x2def
testb $0x1, 0x127(%rsp)
jne 0x2de2
movq 0x20(%rsp), %rdi
callq 0x3eb0
movq 0x28(%rsp), %rax
addq $0x138, %rsp            # imm = 0x138
retq
movq 0x20(%rsp), %rdi
callq 0x3eb0
movq 0x118(%rsp), %rdi
callq 0x2320
nopw %cs:(%rax,%rax)