// File: /workspace/github_cpp_makefile_star2_O1/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 0x567e
movq 0x18(%r15), %r12
addq $0x8, %r15
cmpq %r15, %r12
je 0x4d52
leaq 0x78(%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, 0x78(%rsp)
movq (%rsp), %rcx
movq 0x40(%rcx), %rsi
cmpq 0x48(%rcx), %rsi
je 0x4b0b
movq %rax, (%rsi)
addq $0x8, 0x40(%rcx)
jmp 0x4b18
movq 0x8(%rsp), %rdi
movq %r13, %rdx
callq 0x5802
movq (%rsp), %rax
movq 0x40(%rax), %rsi
addq $-0x8, %rsi
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x4b3f
movq (%rsi), %rcx
movq %rcx, -0x8(%rax)
addq $-0x8, 0x20(%rsp)
jmp 0x4b47
movq %rbp, %rdi
callq 0x591c
movq %r12, %rdi
callq 0x2230
movq %rax, %r12
cmpq %r15, %rax
jne 0x4acf
jmp 0x4d52
cmpq %r13, %rbp
je 0x4c0b
movq 0x28(%rsp), %r9
movq 0x50(%rsp), %r15
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
movq %r14, 0x8(%rdi)
movq %r15, 0x10(%rdi)
movq %r12, 0x18(%rdi)
leaq 0xd8(%rsp), %rsi
movq %r13, (%rsi)
movq %r9, 0x68(%rsp)
movq %r9, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %r8, 0x18(%rsi)
addq %rcx, %rax
addq %rdx, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq 0xab5(%rip), %rcx       # 0x5672
movq %r8, 0x70(%rsp)
callq 0x5b12
movq 0x70(%rsp), %rax
leaq 0xb8(%rsp), %rdi
movq %rbp, (%rdi)
movq %r14, 0x8(%rdi)
movq %r15, 0x10(%rdi)
movq %r12, 0x18(%rdi)
leaq 0x98(%rsp), %rsi
movq %r13, (%rsi)
movq 0x68(%rsp), %rcx
movq %rcx, 0x8(%rsi)
movq %rbx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
leaq 0xa6c(%rip), %rdx       # 0x5672
callq 0x5d03
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %rdi
movq %r14, %rax
cmpq %rdi, %r14
jne 0x4c2b
movq 0x58(%rsp), %rcx
movl $0x200, %eax            # imm = 0x200
addq -0x8(%rcx), %rax
movq -0x8(%rax), %rbx
cmpq %rdi, %r14
je 0x4c3a
addq $-0x8, %r14
jmp 0x4c69
callq 0x21c0
movq 0x58(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x58(%rsp)
movq -0x8(%rax), %r14
movq %r14, 0x48(%rsp)
leaq 0x200(%r14), %rax
movq %rax, 0x50(%rsp)
addq $0x1f8, %r14            # imm = 0x1F8
movq (%rsp), %r15
movq %r14, 0x40(%rsp)
movl $0x20, %edi
callq 0x21f0
cmpq 0x48(%rsp), %r14
jne 0x4c92
movq 0x58(%rsp), %rcx
movl $0x200, %r14d           # imm = 0x200
addq -0x8(%rcx), %r14
movq -0x8(%r14), %rcx
movq $0x0, 0x18(%rax)
movq %rbx, (%rax)
movq %rcx, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x18(%rcx), %rcx
addq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x78(%rsp)
movq 0x40(%r15), %rsi
cmpq 0x48(%r15), %rsi
je 0x4cce
movq %rax, (%rsi)
addq $0x8, 0x40(%r15)
jmp 0x4cdd
leaq 0x78(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0x5802
movq 0x40(%r15), %rsi
addq $-0x8, %rsi
movq 0x20(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x4d00
movq (%rsi), %rcx
movq %rcx, -0x8(%rax)
addq $-0x8, 0x20(%rsp)
jmp 0x4d0a
leaq 0x10(%rsp), %rdi
callq 0x591c
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rdi
cmpq %rdi, %rax
je 0x4d1f
addq $-0x8, %rax
jmp 0x4d4d
callq 0x21c0
movq 0x58(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x58(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x48(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x50(%rsp)
addq $0x1f8, %rax            # imm = 0x1F8
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %r12
movq 0x38(%rsp), %r8
movq %r12, %rax
subq %r8, %rax
shrq $0x3, %rax
cmpq $0x1, %r12
adcq $-0x1, %rax
shlq $0x6, %rax
movq 0x40(%rsp), %rbp
movq 0x48(%rsp), %r14
movq %rbp, %rcx
subq %r14, %rcx
sarq $0x3, %rcx
movq 0x20(%rsp), %r13
movq 0x30(%rsp), %rbx
movq %rbx, %rdx
subq %r13, %rdx
sarq $0x3, %rdx
leaq (%rcx,%rdx), %rsi
addq %rax, %rsi
cmpq $0x2, %rsi
jae 0x4b60
movq %r13, %rax
subq 0x28(%rsp), %rax
sarq $0x3, %rax
cmpq $0x40, %rax
jb 0x4ded
movq %rax, %rcx
shrq $0x6, %rcx
movabsq $-0x400000000000000, %rdx # imm = 0xFC00000000000000
orq %rcx, %rdx
testq %rax, %rax
cmovgq %rcx, %rdx
movq %rdx, %rcx
shlq $0x6, %rcx
subq %rcx, %rax
shlq $0x3, %rax
addq (%r8,%rdx,8), %rax
movq %rax, %r13
movq (%r13), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
leaq 0x10(%rsp), %rdi
callq 0x72b6
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x4e2c
jmp 0x4e1f
jmp 0x4e1f
jmp 0x4e1f
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x72b6
movq (%rsp), %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x4e42
callq 0x21c0
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x862a
movq %r15, %rdi
callq 0x2320