// File: /workspace/github_cpp_makefile_star2_O3/cristian-bicheru[P]arith/./huffman.h
// Function: huffman::HuffmanTree<unsigned char, unsigned long>::HuffmanTree(std::map<unsigned char, unsigned long, std::less<unsigned char>, std::allocator<std::pair<unsigned char const, unsigned long>>> const&)
explicit HuffmanTree(const std::map<SymbolType, ValueType>& SortedFrequencyTable) {
            std::deque<HuffmanNode<SymbolType, ValueType>*> SymbolQueue;
            HuffmanNode<SymbolType, ValueType>* NodePtr;

            for (auto SymbolFrequency : SortedFrequencyTable) {
                AllNodes.push_back(new HuffmanNode<SymbolType, ValueType>(std::get<1>(SymbolFrequency), std::get<0>(SymbolFrequency)));
                SymbolQueue.push_front(AllNodes.back());
            }

            while (SymbolQueue.size() > 1) {
                std::sort(SymbolQueue.rbegin(), SymbolQueue.rend(), ComparePointerObjects<HuffmanNode<SymbolType, ValueType>>);
                //std::cout << SymbolQueue.back()->GetValue() << std::endl;
                NodePtr = SymbolQueue.back();
                SymbolQueue.pop_back();
                AllNodes.push_back(new HuffmanNode<SymbolType, ValueType>(NodePtr, SymbolQueue.back()));
                SymbolQueue.push_front(AllNodes.back());
                SymbolQueue.pop_back();
            }

            ParentNode = SymbolQueue[0];
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r15
leaq 0x10(%rdi), %rax
movl $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rax, 0x28(%rdi)
leaq 0x38(%rdi), %rax
movq %rax, 0x8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movq %rdi, (%rsp)
movups %xmm0, 0x40(%rdi)
leaq 0x10(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x5624
movq 0x18(%r15), %r12
addq $0x8, %r15
cmpq %r15, %r12
je 0x4aee
leaq 0x68(%rsp), %r13
leaq 0x10(%rsp), %rbp
movb 0x20(%r12), %bl
movq 0x28(%r12), %r14
movl $0x20, %edi
callq 0x21f0
movq %r14, 0x18(%rax)
movb $0x1, 0x10(%rax)
movb %bl, 0x11(%rax)
movq %rax, 0x68(%rsp)
movq (%rsp), %rcx
movq 0x40(%rcx), %rsi
cmpq 0x48(%rcx), %rsi
je 0x4a9e
movq %rax, (%rsi)
movq 0x40(%rcx), %rsi
addq $0x8, %rsi
movq %rsi, 0x40(%rcx)
jmp 0x4ab3
movq 0x8(%rsp), %rdi
movq %r13, %rdx
callq 0x57a8
movq (%rsp), %rax
movq 0x40(%rax), %rsi
addq $-0x8, %rsi
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x4ad2
movq (%rsi), %rcx
movq %rcx, -0x8(%rax)
addq $-0x8, 0x20(%rsp)
jmp 0x4ada
movq %rbp, %rdi
callq 0x58c2
movq %r12, %rdi
callq 0x2230
movq %rax, %r12
cmpq %r15, %rax
jne 0x4a5b
leaq 0x10(%rsp), %rax
movq 0x30(%rax), %rbp
movq 0x38(%rax), %r15
movq 0x58(%rsp), %r13
movq 0x38(%rsp), %r14
movq %r13, %rcx
subq %r14, %rcx
shrq $0x3, %rcx
cmpq $0x1, %r13
adcq $-0x1, %rcx
shlq $0x6, %rcx
movq %rbp, %rdx
subq %r15, %rdx
sarq $0x3, %rdx
movq 0x20(%rsp), %r12
movq 0x30(%rsp), %rbx
movq %rbx, %rax
subq %r12, %rax
sarq $0x3, %rax
addq %rdx, %rax
addq %rcx, %rax
cmpq $0x2, %rax
jb 0x4d8b
cmpq %r12, %rbp
je 0x4c3f
movq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rdx
movq %rbp, 0x68(%rsp)
movq %r15, 0x70(%rsp)
movq %rdx, 0x88(%rsp)
movq %rdx, 0x78(%rsp)
movq %r13, 0x80(%rsp)
movq %r12, 0xd8(%rsp)
movq %rcx, 0x90(%rsp)
movq %rcx, 0xe0(%rsp)
movq %rbx, 0xe8(%rsp)
movq %r14, 0xf0(%rsp)
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq 0x68(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0xa54(%rip), %rcx       # 0x5618
callq 0x5ab8
movq %rbp, 0xb8(%rsp)
movq %r15, 0xc0(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq %r13, 0xd0(%rsp)
movq %r12, 0x98(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rbx, 0xa8(%rsp)
movq %r14, 0xb0(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
leaq 0x9e8(%rip), %rdx       # 0x5618
callq 0x5ca9
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %r15
cmpq %r15, %rbp
movq (%rsp), %rbx
je 0x4c52
movq -0x8(%rbp), %r14
addq $-0x8, %rbp
jmp 0x4c96
movq 0x58(%rsp), %rax
movq -0x8(%rax), %rax
movq 0x1f8(%rax), %r14
movq %r15, %rdi
callq 0x21c0
movq 0x58(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x58(%rsp)
movq -0x8(%rax), %r15
movq %r15, 0x48(%rsp)
leaq 0x200(%r15), %rax
movq %rax, 0x50(%rsp)
movl $0x1f8, %eax            # imm = 0x1F8
leaq (%r15,%rax), %rbp
movq %rbp, 0x40(%rsp)
movl $0x20, %edi
callq 0x21f0
cmpq %r15, %rbp
jne 0x4cbb
movq 0x58(%rsp), %rcx
movq -0x8(%rcx), %rbp
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rbp
movq -0x8(%rbp), %rcx
movq $0x0, 0x18(%rax)
movq %r14, (%rax)
movq %rcx, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x18(%rcx), %rcx
addq 0x18(%r14), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x68(%rsp)
movq 0x40(%rbx), %rsi
cmpq 0x48(%rbx), %rsi
je 0x4cfe
movq %rax, (%rsi)
movq 0x40(%rbx), %rsi
addq $0x8, %rsi
movq %rsi, 0x40(%rbx)
jmp 0x4d11
movq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x57a8
movq 0x40(%rbx), %rsi
addq $-0x8, %rsi
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x4d30
movq (%rsi), %rcx
movq %rcx, -0x8(%rax)
addq $-0x8, 0x20(%rsp)
jmp 0x4d3a
leaq 0x10(%rsp), %rdi
callq 0x58c2
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %r15
cmpq %r15, %rbp
je 0x4d4f
addq $-0x8, %rbp
jmp 0x4d81
movq %r15, %rdi
callq 0x21c0
movq 0x58(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x58(%rsp)
movq -0x8(%rax), %r15
movq %r15, 0x48(%rsp)
leaq 0x200(%r15), %rax
movq %rax, 0x50(%rsp)
leaq 0x1f8(%r15), %rbp
movq %rbp, 0x40(%rsp)
jmp 0x4afb
movq %r12, %rcx
subq 0x28(%rsp), %rcx
movq %rcx, %rax
sarq $0x3, %rax
js 0x4daf
cmpq $0x40, %rax
movq (%rsp), %rsi
jb 0x4dcc
movq %rax, %rcx
shrq $0x6, %rcx
jmp 0x4db7
sarq $0x9, %rcx
movq (%rsp), %rsi
movq %rcx, %rdx
shlq $0x6, %rdx
subq %rdx, %rax
shlq $0x3, %rax
addq (%r14,%rcx,8), %rax
movq %rax, %r12
movq (%r12), %rax
movq %rax, (%rsi)
leaq 0x10(%rsp), %rdi
callq 0x71b4
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x4e07
jmp 0x4dfa
jmp 0x4dfa
jmp 0x4dfa
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x71b4
movq (%rsp), %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4e1d
callq 0x21c0
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x8558
movq %r15, %rdi
callq 0x2320
nop