// File: Albuso0[P]support/support.cpp
// Function: Support::setHist(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Support::setHist(const std::string filename) 
{
    fin.clear();
    n = 0;
    std::map<int, int> fin_map;
    
    std::ifstream infile;
    infile.open( filename.c_str() );
    int freq;
    while ( (infile>>freq).good() )
    {
        if ( freq == 0)
            continue;

        auto iter = fin_map.find( freq );
        if ( iter == fin_map.end() )
            fin_map.insert( std::make_pair( freq,1 ) );
        else
            ++(iter->second);
    }
    infile.close();

    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 $0x300, %rsp            # imm = 0x300
movq %rsi, -0x2b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
addq $0x28, %rdi
callq 0x39f0
movq -0x2b0(%rbp), %rax
movl $0x0, 0x20(%rax)
leaq -0x40(%rbp), %rdi
callq 0x3ab0
leaq -0x248(%rbp), %rdi
callq 0x2230
jmp 0x34d3
movq -0x2b8(%rbp), %rdi
callq 0x20b0
movq %rax, %rsi
leaq -0x248(%rbp), %rdi
movl $0x8, %edx
callq 0x2100
jmp 0x34f5
jmp 0x34f7
leaq -0x248(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x20e0
movq %rax, -0x2c0(%rbp)
jmp 0x3513
movq -0x2c0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x22b0
movb %al, -0x2c1(%rbp)
jmp 0x3531
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x3540
jmp 0x365e
cmpl $0x0, -0x258(%rbp)
jne 0x3585
jmp 0x34f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
jmp 0x3775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x250(%rbp)
movl %eax, -0x254(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x2070
jmp 0x3775
leaq -0x40(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x3b90
movq %rax, -0x2d0(%rbp)
jmp 0x359e
movq -0x2d0(%rbp), %rax
movq %rax, -0x260(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3bf0
movq %rax, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x3bc0
testb $0x1, %al
jne 0x35d5
jmp 0x3644
movl $0x1, -0x274(%rbp)
leaq -0x258(%rbp), %rdi
leaq -0x274(%rbp), %rsi
callq 0x3dc0
movq %rax, -0x2d8(%rbp)
jmp 0x35fb
movq -0x2d8(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x3d80
movb %dl, -0x2e1(%rbp)
movq %rax, -0x2e0(%rbp)
jmp 0x3628
movb -0x2e1(%rbp), %al
movq -0x2e0(%rbp), %rcx
movq %rcx, -0x288(%rbp)
movb %al, -0x280(%rbp)
jmp 0x3659
leaq -0x260(%rbp), %rdi
callq 0x3c90
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x34f7
leaq -0x248(%rbp), %rdi
callq 0x2060
jmp 0x366c
leaq -0x40(%rbp), %rdi
callq 0x3cd0
movq %rax, -0x290(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3bf0
movq %rax, -0x298(%rbp)
leaq -0x290(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x3d00
testb $0x1, %al
jne 0x36a8
jmp 0x3757
leaq -0x290(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x3c90
movq -0x300(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x29c(%rbp)
callq 0x3c90
movq %rax, %rcx
movq -0x2b0(%rbp), %rax
movl 0x4(%rcx), %ecx
movl %ecx, -0x2a0(%rbp)
addq $0x28, %rax
movq %rax, -0x2f8(%rbp)
leaq -0x29c(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x3a40
movq %rax, -0x2f0(%rbp)
jmp 0x3709
movq -0x2f8(%rbp), %rdi
movq -0x2f0(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x2a8(%rbp), %rsi
callq 0x3a10
jmp 0x372c
movq -0x2b0(%rbp), %rax
movl -0x29c(%rbp), %ecx
imull -0x2a0(%rbp), %ecx
addl 0x20(%rax), %ecx
movl %ecx, 0x20(%rax)
leaq -0x290(%rbp), %rdi
callq 0x3d30
jmp 0x367c
leaq -0x248(%rbp), %rdi
callq 0x2070
leaq -0x40(%rbp), %rdi
callq 0x3d60
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x3d60
movq -0x250(%rbp), %rdi
callq 0x22e0
nopw (%rax,%rax)