// File: Albuso0[P]support/support.cpp
// Function: Support::setHist(std::vector<unsigned int, std::allocator<unsigned int>> const&)
void Support::setHist( const std::vector<unsigned> &hist )
{
    fin.clear();
    n = 0;
    
    std::map<int, int> fin_map;
    for ( const auto & freq : hist )
    {
        auto iter = fin_map.find( freq );
        if ( iter == fin_map.end() )
            fin_map.insert( std::make_pair( freq,1 ) );
        else
            ++(iter->second);
    }
    
    for ( auto it = fin_map.begin(); it != fin_map.end(); ++it )
    {
        int freq = it->first, cnt = it->second;
        fin.push_back( std::make_pair( freq, cnt ) );
        n += (freq * cnt);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
addq $0x28, %rdi
callq 0x39f0
movq -0xd0(%rbp), %rax
movl $0x0, 0x20(%rax)
leaq -0x40(%rbp), %rdi
callq 0x3ab0
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3ad0
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x3b00
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3b30
testb $0x1, %al
jne 0x3266
jmp 0x336e
leaq -0x50(%rbp), %rdi
callq 0x3b70
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0x3b90
movq %rax, -0xd8(%rbp)
jmp 0x3292
movq -0xd8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3bf0
movq %rax, -0x88(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3bc0
testb $0x1, %al
jne 0x32c6
jmp 0x334c
movq -0x60(%rbp), %rdi
movl $0x1, -0x94(%rbp)
leaq -0x94(%rbp), %rsi
callq 0x3c60
movq %rax, -0xe0(%rbp)
jmp 0x32e9
movq -0xe0(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3c20
movb %dl, -0xe9(%rbp)
movq %rax, -0xe8(%rbp)
jmp 0x3316
movb -0xe9(%rbp), %al
movq -0xe8(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movb %al, -0xa0(%rbp)
jmp 0x335e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3d60
jmp 0x346b
leaq -0x68(%rbp), %rdi
callq 0x3c90
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x3360
leaq -0x50(%rbp), %rdi
callq 0x3cb0
jmp 0x3250
leaq -0x40(%rbp), %rdi
callq 0x3cd0
movq %rax, -0xb0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3bf0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x3d00
testb $0x1, %al
jne 0x33aa
jmp 0x3459
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x3c90
movq -0x108(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xbc(%rbp)
callq 0x3c90
movq %rax, %rcx
movq -0xd0(%rbp), %rax
movl 0x4(%rcx), %ecx
movl %ecx, -0xc0(%rbp)
addq $0x28, %rax
movq %rax, -0x100(%rbp)
leaq -0xbc(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3a40
movq %rax, -0xf8(%rbp)
jmp 0x340b
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x3a10
jmp 0x342e
movq -0xd0(%rbp), %rax
movl -0xbc(%rbp), %ecx
imull -0xc0(%rbp), %ecx
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
leaq -0xb0(%rbp), %rdi
callq 0x3d30
jmp 0x337e
leaq -0x40(%rbp), %rdi
callq 0x3d60
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x22e0
nopw %cs:(%rax,%rax)