// File: ynilu[P]elastic/auxiliary.cpp
// Function: Aux_graph::Aux_graph(Auxiliary_info&)
Aux_graph::Aux_graph(Auxiliary_info& a_info)
{
    // reserve space for all possible auxiliary nodes
    adding_node_list.reserve(a_info.num_nodes);
    dropping_node_list.reserve(a_info.num_nodes);
    OFDM_WOB_virtual_transmitting_node_list.reserve(a_info.num_nodes);
    OFDM_WOB_virtual_receiving_node_list.reserve(a_info.num_nodes);
    OFDM_WB_virtual_transmitting_node_list.reserve(a_info.num_nodes);
    OFDM_WB_virtual_receiving_node_list.reserve(a_info.num_nodes);
    OFDM_virtual_transmitting_node_list.reserve(a_info.num_nodes);
    OFDM_virtual_receiving_node_list.reserve(a_info.num_nodes);
    OTDM_virtual_transmitting_node_list.reserve(a_info.num_nodes);
    OTDM_virtual_receiving_node_list.reserve(a_info.num_nodes);

    Aux_node* a_node;   // adding node
    Aux_node* d_node;   // dropping node
    Aux_node* OFDM_WOB_v_t_node; // OFDM_WOB virtual transmitting node
    Aux_node* OFDM_WOB_v_r_node; // OFDM_WOB virtual receiving node
    Aux_node* OFDM_WB_v_t_node; // OFDM_WB virtual transmitting node
    Aux_node* OFDM_WB_v_r_node; // OFDM_WB virtual receiving node
    Aux_node* OFDM_v_t_node; // OFDM virtual transmitting node
    Aux_node* OFDM_v_r_node; // OFDM virtual receiving node
    Aux_node* OTDM_v_t_node; // OTDM virtual transmitting node
    Aux_node* OTDM_v_r_node; // OTDM virtual receiving node

    for(int phy_node_i = 0; phy_node_i < a_info.num_nodes; phy_node_i++)
    {
        a_node = create_aux_node(phy_node_i, Aux_node::adding_node);
        adding_node_list.push_back(a_node);
        d_node = create_aux_node(phy_node_i, Aux_node::dropping_node);
        dropping_node_list.push_back(d_node);

        OFDM_WOB_v_t_node = create_aux_node(phy_node_i, Aux_node::virtual_transmitting_node);
        OFDM_WOB_virtual_transmitting_node_list.push_back(OFDM_WOB_v_t_node);
        OFDM_WOB_v_r_node = create_aux_node(phy_node_i, Aux_node::virtual_receiving_node);
        OFDM_WOB_virtual_receiving_node_list.push_back(OFDM_WOB_v_r_node);

        OFDM_WB_v_t_node = create_aux_node(phy_node_i, Aux_node::virtual_transmitting_node);
        OFDM_WB_virtual_transmitting_node_list.push_back(OFDM_WB_v_t_node);
        OFDM_WB_v_r_node = create_aux_node(phy_node_i, Aux_node::virtual_receiving_node);
        OFDM_WB_virtual_receiving_node_list.push_back(OFDM_WB_v_r_node);

        OFDM_v_t_node = create_aux_node(phy_node_i, Aux_node::virtual_transmitting_node);
        OFDM_virtual_transmitting_node_list.push_back(OFDM_v_t_node);
        OFDM_v_r_node = create_aux_node(phy_node_i, Aux_node::virtual_receiving_node);
        OFDM_virtual_receiving_node_list.push_back(OFDM_v_r_node);

        OTDM_v_t_node = create_aux_node(phy_node_i, Aux_node::virtual_transmitting_node);
        OTDM_virtual_transmitting_node_list.push_back(OTDM_v_t_node);
        OTDM_v_r_node = create_aux_node(phy_node_i, Aux_node::virtual_receiving_node);
        OTDM_virtual_receiving_node_list.push_back(OTDM_v_r_node);


        create_aux_link(d_node, a_node, a_info.OEO_weight, Aux_link::grooming_link);

        create_aux_link(a_node, OFDM_WOB_v_t_node, a_info.used_OFDM_transceiver_weight, Aux_link::adding_link);
        create_aux_link(OFDM_WOB_v_r_node, d_node, a_info.used_OFDM_transceiver_weight, Aux_link::dropping_link);

        create_aux_link(a_node, OFDM_WB_v_t_node, a_info.used_OFDM_transceiver_weight, Aux_link::adding_link);
        create_aux_link(OFDM_WB_v_r_node, d_node, a_info.OFDM_transceiver_weight, Aux_link::virtual_dropping_link);

        create_aux_link(a_node, OFDM_v_t_node, a_info.OFDM_transceiver_weight, Aux_link::virtual_adding_link);
        create_aux_link(OFDM_v_r_node, d_node, a_info.OFDM_transceiver_weight, Aux_link::virtual_dropping_link);

        create_aux_link(a_node, OTDM_v_t_node, a_info.transceiver_weight, Aux_link::virtual_adding_link);
        create_aux_link(OTDM_v_r_node, d_node, a_info.transceiver_weight, Aux_link::virtual_dropping_link);
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x90(%rbp)
leaq 0x17f13(%rip), %rax     # 0x42d08
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0x80(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0xd0(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0x38, %rdi
movq %rdi, -0xc8(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0x50, %rdi
movq %rdi, -0xc0(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0xb8(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
subq $-0x80, %rdi
movq %rdi, -0xb0(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0x98, %rdi
movq %rdi, -0xa8(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0xb0, %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0xc8, %rdi
movq %rdi, -0x98(%rbp)
callq 0x2bb30
movq -0x90(%rbp), %rdi
addq $0xe0, %rdi
movq %rdi, -0x88(%rbp)
callq 0x2bb30
movq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2aef3
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af0d
movq -0x90(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af27
movq -0x90(%rbp), %rdi
addq $0x50, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af41
movq -0x90(%rbp), %rdi
addq $0x68, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af5b
movq -0x90(%rbp), %rdi
subq $-0x80, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af75
movq -0x90(%rbp), %rdi
addq $0x98, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2af92
movq -0x90(%rbp), %rdi
addq $0xb0, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2afaf
movq -0x90(%rbp), %rdi
addq $0xc8, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2afcc
movq -0x90(%rbp), %rdi
addq $0xe0, %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0xb730
jmp 0x2afe9
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x2b44c
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
xorl %edx, %edx
callq 0x2b460
movq %rax, -0xd8(%rbp)
jmp 0x2b01a
movq -0x90(%rbp), %rdi
movq -0xd8(%rbp), %rax
movq %rax, -0x28(%rbp)
addq $0x8, %rdi
leaq -0x28(%rbp), %rsi
callq 0xb830
jmp 0x2b03b
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x1, %edx
callq 0x2b460
movq %rax, -0xe0(%rbp)
jmp 0x2b058
movq -0x90(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x20, %rdi
leaq -0x30(%rbp), %rsi
callq 0xb830
jmp 0x2b079
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x4, %edx
callq 0x2b460
movq %rax, -0xe8(%rbp)
jmp 0x2b096
movq -0x90(%rbp), %rdi
movq -0xe8(%rbp), %rax
movq %rax, -0x38(%rbp)
addq $0x38, %rdi
leaq -0x38(%rbp), %rsi
callq 0xb830
jmp 0x2b0b7
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x5, %edx
callq 0x2b460
movq %rax, -0xf0(%rbp)
jmp 0x2b0d4
movq -0x90(%rbp), %rdi
movq -0xf0(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0x50, %rdi
leaq -0x40(%rbp), %rsi
callq 0xb830
jmp 0x2b0f5
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x4, %edx
callq 0x2b460
movq %rax, -0xf8(%rbp)
jmp 0x2b112
movq -0x90(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0x68, %rdi
leaq -0x48(%rbp), %rsi
callq 0xb830
jmp 0x2b133
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x5, %edx
callq 0x2b460
movq %rax, -0x100(%rbp)
jmp 0x2b150
movq -0x90(%rbp), %rdi
movq -0x100(%rbp), %rax
movq %rax, -0x50(%rbp)
subq $-0x80, %rdi
leaq -0x50(%rbp), %rsi
callq 0xb830
jmp 0x2b171
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x4, %edx
callq 0x2b460
movq %rax, -0x108(%rbp)
jmp 0x2b18e
movq -0x90(%rbp), %rdi
movq -0x108(%rbp), %rax
movq %rax, -0x58(%rbp)
addq $0x98, %rdi
leaq -0x58(%rbp), %rsi
callq 0xb830
jmp 0x2b1b2
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x5, %edx
callq 0x2b460
movq %rax, -0x110(%rbp)
jmp 0x2b1cf
movq -0x90(%rbp), %rdi
movq -0x110(%rbp), %rax
movq %rax, -0x60(%rbp)
addq $0xb0, %rdi
leaq -0x60(%rbp), %rsi
callq 0xb830
jmp 0x2b1f3
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x4, %edx
callq 0x2b460
movq %rax, -0x118(%rbp)
jmp 0x2b210
movq -0x90(%rbp), %rdi
movq -0x118(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0xc8, %rdi
leaq -0x68(%rbp), %rsi
callq 0xb830
jmp 0x2b234
movq -0x90(%rbp), %rdi
movl -0x74(%rbp), %esi
movl $0x5, %edx
callq 0x2b460
movq %rax, -0x120(%rbp)
jmp 0x2b251
movq -0x90(%rbp), %rdi
movq -0x120(%rbp), %rax
movq %rax, -0x70(%rbp)
addq $0xe0, %rdi
leaq -0x70(%rbp), %rsi
callq 0xb830
jmp 0x2b275
movq -0x90(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x28(%rax), %xmm0
movl $0x2, %ecx
callq 0x2b4d0
jmp 0x2b299
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movl $0x3, %ecx
callq 0x2b4d0
jmp 0x2b2bd
movq -0x90(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movl $0x4, %ecx
callq 0x2b4d0
jmp 0x2b2e1
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm0
movl $0x3, %ecx
callq 0x2b4d0
jmp 0x2b305
movq -0x90(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movl $0x7, %ecx
callq 0x2b4d0
jmp 0x2b329
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movl $0x6, %ecx
callq 0x2b4d0
jmp 0x2b34d
movq -0x90(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movl $0x7, %ecx
callq 0x2b4d0
jmp 0x2b371
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movl $0x6, %ecx
callq 0x2b4d0
jmp 0x2b395
movq -0x90(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rax
movsd 0x8(%rax), %xmm0
movl $0x7, %ecx
callq 0x2b4d0
jmp 0x2b3b9
jmp 0x2b3bb
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x2aff0
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2bb50
movq -0x98(%rbp), %rdi
callq 0x2bb50
movq -0xa0(%rbp), %rdi
callq 0x2bb50
movq -0xa8(%rbp), %rdi
callq 0x2bb50
movq -0xb0(%rbp), %rdi
callq 0x2bb50
movq -0xb8(%rbp), %rdi
callq 0x2bb50
movq -0xc0(%rbp), %rdi
callq 0x2bb50
movq -0xc8(%rbp), %rdi
callq 0x2bb50
movq -0xd0(%rbp), %rdi
callq 0x2bb50
movq -0x80(%rbp), %rdi
callq 0x2bb50
jmp 0x2b455
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3340
nop