// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::remove_arcs(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void
FactorGraph::remove_arcs(const std::string &source,
                         const std::string &target)
{
    for (auto node = nodes.begin(); node != nodes.end(); ++node) {
        if (source != this->get_factor(*node)) continue;
        for (unsigned int i=0; i<node->outgoing.size(); i++) {
            FactorGraph::Arc *arc = node->outgoing[i];
            if (target != this->get_factor(arc->target_node)) continue;
            this->remove_arc(arc);
            break;
        }
    }

    // Prune all transitions from non-reachable nodes
    for (auto it = nodes.begin(); it != nodes.end(); it++) {
        if (it->incoming.size() == 0 && it->len > 0) {
            while (it->outgoing.size() > 0)
                remove_arc(it->outgoing[0]);
            continue;
        }
        if (it->outgoing.size() == 0 && it->len > 0) {
            while (it->incoming.size() > 0)
                remove_arc(it->incoming[0]);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x40(%rbp)
movq %rsi, -0x30(%rbp)
movq 0x40(%rdi), %r15
cmpq 0x48(%rdi), %r15
je 0xf889
movq %rdi, %rbx
movq %rdi, -0x38(%rbp)
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10242
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
cmpq -0x58(%rbp), %rdx
jne 0xf73d
movq -0x60(%rbp), %r12
testq %rdx, %rdx
je 0xf746
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq %r12, %rsi
callq 0x43a0
testl %eax, %eax
setne %r14b
jmp 0xf749
movb $0x1, %r14b
movq -0x60(%rbp), %r12
jmp 0xf749
xorl %r14d, %r14d
leaq -0x50(%rbp), %rax
cmpq %rax, %r12
je 0xf75a
movq %r12, %rdi
callq 0x4350
testb %r14b, %r14b
jne 0xf80a
movq 0x20(%r15), %rax
cmpq %rax, 0x28(%r15)
je 0xf80a
movl $0x1, %r14d
xorl %ecx, %ecx
movq (%rax,%rcx,8), %r12
movzwl 0x2(%r12), %edx
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x10288
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdx
cmpq -0x58(%rbp), %rdx
jne 0xf7bc
movq -0x60(%rbp), %r13
testq %rdx, %rdx
je 0xf7c4
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq %r13, %rsi
callq 0x43a0
testl %eax, %eax
setne %bl
jmp 0xf7c6
movb $0x1, %bl
movq -0x60(%rbp), %r13
jmp 0xf7c6
xorl %ebx, %ebx
leaq -0x50(%rbp), %rax
cmpq %rax, %r13
je 0xf7d7
movq %r13, %rdi
callq 0x4350
testb %bl, %bl
je 0xf7fb
movl %r14d, %ecx
movq 0x20(%r15), %rax
movq 0x28(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
incl %r14d
cmpq %rcx, %rdx
movq -0x38(%rbp), %rbx
ja 0xf779
jmp 0xf80a
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf5e4
addq $0x38, %r15
cmpq 0x48(%rbx), %r15
jne 0xf700
movq 0x40(%rbx), %r14
cmpq %r15, %r14
jne 0xf841
jmp 0xf889
cmpb $0x0, 0x2(%r14)
je 0xf84e
movq 0x20(%r14), %rax
cmpq %rax, 0x28(%r14)
je 0xf87f
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
jmp 0xf82a
movq 0x8(%r14), %rax
movq 0x10(%r14), %rcx
cmpq %rax, %rcx
je 0xf823
movq 0x28(%r14), %rdx
cmpq 0x20(%r14), %rdx
jne 0xf87f
cmpq %rax, %rcx
sete %cl
cmpb $0x0, 0x2(%r14)
sete %dl
orb %cl, %dl
jne 0xf87f
movq (%rax), %rsi
movq %rbx, %rdi
callq 0xf5e4
movq 0x8(%r14), %rax
cmpq %rax, 0x10(%r14)
jne 0xf86a
addq $0x38, %r14
cmpq 0x48(%rbx), %r14
jne 0xf841
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq