// File: ynilu[P]elastic/simulator.cpp
// Function: get_align_num(std::vector<int, std::allocator<int>>&, int, int, Phy_graph&)
int get_align_num(Path& path, int slot_st, int slot_ed, Phy_graph& p_graph)
{
    int num_align = 0;
    for(unsigned int node_i = 0; node_i < path.size() - 1; node_i++)
    {
        int from = path[node_i];
        int to = path[node_i + 1];
        for(auto &w : p_graph.get_node(from).neighbor)
        {
            if(w == to)
            {
                continue;
            }
            Phy_link& link = p_graph.get_link(w, from);
            num_align += num_spectrum_available(link, slot_st, slot_ed);
        }
        for(auto &v : p_graph.get_node(to).neighbor)
        {
            if(v == from)
            {
                continue;
            }
            Phy_link& link = p_graph.get_link(to, v);
            num_align += num_spectrum_available(link, slot_st, slot_ed);
        }
    }
    return num_align;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb380
movq %rax, %rcx
movq -0x80(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0xaad8
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, %esi
callq 0xb210
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0xb210
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x1b450
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xbf70
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xbfa0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xbfd0
testb $0x1, %al
jne 0xa9e7
jmp 0xaa37
leaq -0x38(%rbp), %rdi
callq 0xc010
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
cmpl -0x28(%rbp), %eax
jne 0xaa01
jmp 0xaa2c
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rax
movl (%rax), %esi
movl -0x24(%rbp), %edx
callq 0x1a730
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0xa480
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xc030
jmp 0xa9d4
movq -0x18(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x1b450
addq $0x10, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0xbf70
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0xbfa0
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xbfd0
testb $0x1, %al
jne 0xaa78
jmp 0xaac8
leaq -0x60(%rbp), %rdi
callq 0xc010
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
cmpl -0x24(%rbp), %eax
jne 0xaa92
jmp 0xaabd
movq -0x18(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x70(%rbp), %rax
movl (%rax), %edx
callq 0x1a730
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0xa480
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xc030
jmp 0xaa65
jmp 0xaaca
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xa957
movl -0x1c(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)