// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::disable_transition(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>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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>>, 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>>>>>>&, 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>>>>>>&)
flt_type
Bigrams::disable_transition(const map<string, flt_type> &unigram_stats,
                            string src,
                            string tgt,
                            transitions_t &transitions,
                            transitions_t &changes)
{
    changes.clear();

    flt_type renormalizer = sub_log_domain_probs(0, transitions[src][tgt]);
    flt_type ll_diff = 0.0;
    changes[src][tgt] = transitions[src][tgt];
    transitions[src][tgt] = SMALL_LP;

    for (auto it = transitions[src].begin(); it != transitions[src].end(); ++it) {
        if (it->first != tgt) {
            flt_type count = unigram_stats.at(src) * exp(it->second);
            changes[src][it->first] = it->second;
            ll_diff -= count * it->second;
            it->second -= renormalizer;
            ll_diff += count * it->second;
        }
    }

    return ll_diff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, -0x48(%rbp)
movq %r8, %rdi
callq 0x1c43c
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
movq %rax, %rdi
movq %r15, %rsi
callq 0x1af86
movsd (%rax), %xmm0
callq 0x231a5
movsd %xmm0, -0x40(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
movq %rax, %rdi
movq %r15, %rsi
callq 0x1af86
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %rbx, -0x50(%rbp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1b318
movq %rax, %rdi
movq %r15, %rsi
callq 0x1af86
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
movq %rax, %rdi
movq %r15, %rsi
callq 0x1af86
movabsq $-0x3fa7000000000000, %rcx # imm = 0xC059000000000000
movq %rcx, (%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
movq 0x18(%rax), %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
addq $0x8, %rax
xorpd %xmm0, %xmm0
cmpq %rax, %r13
je 0x2338e
movsd %xmm0, -0x30(%rbp)
leaq 0x20(%r13), %rbx
movq 0x28(%r13), %rdx
cmpq 0x8(%r15), %rdx
jne 0x232e0
testq %rdx, %rdx
je 0x23369
movq (%r15), %rsi
movq (%rbx), %rdi
callq 0x43a0
testl %eax, %eax
je 0x23369
movq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x1b3f6
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x40(%r13), %xmm0
callq 0x4660
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x40(%r13), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x1b318
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1af86
movsd -0x58(%rbp), %xmm0
movsd %xmm0, (%rax)
movsd 0x40(%r13), %xmm0
movsd -0x38(%rbp), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm2
subsd %xmm1, %xmm2
subsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x40(%r13)
mulsd %xmm3, %xmm0
addsd %xmm0, %xmm2
movsd %xmm2, -0x30(%rbp)
movq %r13, %rdi
callq 0x4280
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x1b318
addq $0x8, %rax
cmpq %rax, %r13
jne 0x232b6
jmp 0x23393
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop