// File: aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::freqs_to_logprobs(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>>>>>>&, double)
void
Bigrams::freqs_to_logprobs(transitions_t &trans_stats,
                           flt_type min_lp)
{
    for (auto srcit = trans_stats.begin(); srcit != trans_stats.end(); ++srcit) {
        flt_type normalizer = SMALL_LP;
        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit) {
            tgtit->second = log(tgtit->second);
            if (tgtit->second < min_lp || std::isinf(tgtit->second) || std::isnan(tgtit->second))
                tgtit->second = min_lp;
            normalizer = add_log_domain_probs(normalizer, tgtit->second);
        }

        for (auto tgtit = srcit->second.begin(); tgtit != srcit->second.end(); ++tgtit) {
            tgtit->second -= normalizer;
            if (tgtit->second < min_lp || std::isinf(tgtit->second) || std::isnan(tgtit->second))
                tgtit->second = min_lp;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x48b10
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x31360
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x48b40
testb $0x1, %al
jne 0x5cc61
jmp 0x5ce70
movsd 0x9b1f(%rip), %xmm0     # 0x66788
movsd %xmm0, -0x28(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x58790
movq %rax, -0x30(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x48c90
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x5ccb6
jmp 0x5cd7c
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x4340
movsd %xmm0, -0x50(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd -0x50(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm1
movsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x5cd2a
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b50
testb $0x1, %al
jne 0x5cd2a
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b90
testb $0x1, %al
jne 0x5cd2a
jmp 0x5cd47
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd -0x58(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x587c0
movsd -0x60(%rbp), %xmm0
movsd 0x20(%rax), %xmm1
callq 0x5de00
movsd %xmm0, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4bba0
jmp 0x5cc87
leaq -0x18(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x58790
movq %rax, -0x40(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x48c90
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x5cdc4
jmp 0x5ce60
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x587c0
movsd -0x68(%rbp), %xmm1
movsd 0x20(%rax), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
leaq -0x40(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm1
movsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x5ce33
leaq -0x40(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b50
testb $0x1, %al
jne 0x5ce33
leaq -0x40(%rbp), %rdi
callq 0x587c0
movsd 0x20(%rax), %xmm0
callq 0x58b90
testb $0x1, %al
jne 0x5ce33
jmp 0x5ce50
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x587c0
movsd -0x70(%rbp), %xmm0
movsd %xmm0, 0x20(%rax)
jmp 0x5ce52
leaq -0x40(%rbp), %rdi
callq 0x4bba0
jmp 0x5cd95
jmp 0x5ce62
leaq -0x18(%rbp), %rdi
callq 0x48d60
jmp 0x5cc3e
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)