// File: aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::normalize(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>>>>&)
void
Bigrams::normalize(transitions_t &trans_stats)
{
    for (auto srcit = trans_stats.begin(); srcit != trans_stats.end(); ++srcit) {
        flt_type normalizer = MIN_FLOAT;
        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit)
            if (normalizer == MIN_FLOAT) normalizer = tgtit->second;
            else normalizer = add_log_domain_probs(normalizer, tgtit->second);
        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit)
            tgtit->second -= normalizer;
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b10
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x31360
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x48b40
testb $0x1, %al
jne 0x5decc
jmp 0x5e03d
callq 0x47bf0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x58790
movq %rax, -0x28(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x48c90
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x5df35
jmp 0x5dfb7
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x47bf0
movaps %xmm0, %xmm1
movsd -0x48(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5df80
jp 0x5df80
leaq -0x28(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x5dfa7
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x587c0
movsd -0x50(%rbp), %xmm0
movsd 0x20(%rax), %xmm1
callq 0x5de00
movsd %xmm0, -0x20(%rbp)
jmp 0x5dfa9
leaq -0x28(%rbp), %rdi
callq 0x4bba0
jmp 0x5df06
leaq -0x10(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x58790
movq %rax, -0x38(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x48c90
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x5dffc
jmp 0x5e02d
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x587c0
movsd -0x58(%rbp), %xmm1
movsd 0x20(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x38(%rbp), %rdi
callq 0x4bba0
jmp 0x5dfd0
jmp 0x5e02f
leaq -0x10(%rbp), %rdi
callq 0x48d60
jmp 0x5dea9
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)