// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/network.C
// Function: Network::WriteSelectedSynToFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char*)
void Network::WriteSelectedSynToFile(const string& syn_type, char * filename){

    ofstream f_out(filename);
    if(!f_out.is_open()){
        cout<<"In Network::WriteSelectedSynToFile(), cannot open the file : "<<filename<<endl;
        exit(EXIT_FAILURE);
    }

    synapsetype_t  wrt_syn_type = INVALID;
    DetermineSynType(syn_type.c_str(), wrt_syn_type, "WriteSelectedSynToFile()");
    assert(wrt_syn_type != INVALID);
    vector<Synapse*> tmp;

    const vector<Synapse*> & synapses = 
        wrt_syn_type == RESERVOIR_SYN ? _rsynapses : 
        wrt_syn_type == READOUT_SYN ? _rosynapses : 
        wrt_syn_type == INPUT_SYN ? _isynapses : tmp;
    for(size_t i = 0; i < synapses.size(); ++i)
        f_out<<i<<"\t"<<synapses[i]->PreNeuron()->Name()
            <<"\t"<<synapses[i]->PostNeuron()->Name()
            <<"\t"<<synapses[i]->Weight()<<endl;
    f_out.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x268(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x218(%rbp), %rdi
movq %rdi, -0x260(%rbp)
movl $0x10, %edx
callq 0x43e0
movq -0x260(%rbp), %rdi
callq 0x4270
movb %al, -0x251(%rbp)
jmp 0x22722
movb -0x251(%rbp), %al
testb $0x1, %al
jne 0x22799
jmp 0x2272e
movq 0x2a893(%rip), %rdi     # 0x4cfc8
leaq 0x13972(%rip), %rsi     # 0x360ae
callq 0x4360
movq %rax, -0x270(%rbp)
jmp 0x2274a
movq -0x270(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4360
movq %rax, -0x278(%rbp)
jmp 0x22763
movq -0x278(%rbp), %rdi
movq 0x2a847(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x22778
movl $0x1, %edi
callq 0x4440
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
jmp 0x22aa9
movl $0x3, -0x228(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4160
movq -0x268(%rbp), %rdi
movq %rax, %rsi
leaq 0x1392f(%rip), %rcx     # 0x360ec
leaq -0x228(%rbp), %rdx
callq 0x22210
jmp 0x227cb
cmpl $0x3, -0x228(%rbp)
je 0x227d6
jmp 0x227f5
leaq 0x13928(%rip), %rdi     # 0x36105
leaq 0x12b36(%rip), %rsi     # 0x3531a
movl $0x3dc, %edx            # imm = 0x3DC
leaq 0x1392d(%rip), %rcx     # 0x3611d
callq 0x4210
leaq -0x240(%rbp), %rdi
callq 0x11f50
cmpl $0x0, -0x228(%rbp)
jne 0x22820
movq -0x268(%rbp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x280(%rbp)
jmp 0x2288a
cmpl $0x2, -0x228(%rbp)
jne 0x2283f
movq -0x268(%rbp), %rax
addq $0x130, %rax            # imm = 0x130
movq %rax, -0x288(%rbp)
jmp 0x2287c
cmpl $0x1, -0x228(%rbp)
jne 0x2285e
movq -0x268(%rbp), %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, -0x290(%rbp)
jmp 0x2286e
leaq -0x240(%rbp), %rax
movq %rax, -0x290(%rbp)
jmp 0x2286e
movq -0x290(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0x248(%rbp)
movq $0x0, -0x250(%rbp)
movq -0x250(%rbp), %rax
movq %rax, -0x298(%rbp)
movq -0x248(%rbp), %rdi
callq 0x12b20
movq %rax, %rcx
movq -0x298(%rbp), %rax
cmpq %rcx, %rax
jae 0x22a7a
movq -0x250(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x40d0
movq %rax, -0x2a0(%rbp)
jmp 0x228ec
movq -0x2a0(%rbp), %rdi
leaq 0x1172e(%rip), %rsi     # 0x34028
callq 0x4360
movq %rax, -0x2a8(%rbp)
jmp 0x22908
movq -0x248(%rbp), %rdi
movq -0x250(%rbp), %rsi
callq 0x24ae0
movq (%rax), %rdi
callq 0x1c140
movq %rax, -0x2b0(%rbp)
jmp 0x2292c
movq -0x2b0(%rbp), %rdi
callq 0xbea0
movq %rax, -0x2b8(%rbp)
jmp 0x22941
movq -0x2b8(%rbp), %rsi
movq -0x2a8(%rbp), %rdi
callq 0x4360
movq %rax, -0x2c0(%rbp)
jmp 0x2295d
movq -0x2c0(%rbp), %rdi
leaq 0x116bd(%rip), %rsi     # 0x34028
callq 0x4360
movq %rax, -0x2c8(%rbp)
jmp 0x22979
movq -0x248(%rbp), %rdi
movq -0x250(%rbp), %rsi
callq 0x24ae0
movq (%rax), %rdi
callq 0x1c160
movq %rax, -0x2d0(%rbp)
jmp 0x2299d
movq -0x2d0(%rbp), %rdi
callq 0xbea0
movq %rax, -0x2d8(%rbp)
jmp 0x229b2
movq -0x2d8(%rbp), %rsi
movq -0x2c8(%rbp), %rdi
callq 0x4360
movq %rax, -0x2e0(%rbp)
jmp 0x229ce
movq -0x2e0(%rbp), %rdi
leaq 0x1164c(%rip), %rsi     # 0x34028
callq 0x4360
movq %rax, -0x2e8(%rbp)
jmp 0x229ea
movq -0x248(%rbp), %rdi
movq -0x250(%rbp), %rsi
callq 0x24ae0
movq (%rax), %rdi
callq 0x12140
movsd %xmm0, -0x2f0(%rbp)
jmp 0x22a0f
movsd -0x2f0(%rbp), %xmm0
movq -0x2e8(%rbp), %rdi
callq 0x4770
movq %rax, -0x2f8(%rbp)
jmp 0x22a2c
movq -0x2f8(%rbp), %rdi
movq 0x2a57e(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x22a41
jmp 0x22a43
movq -0x250(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x250(%rbp)
jmp 0x228a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x11fb0
jmp 0x22aa9
leaq -0x218(%rbp), %rdi
callq 0x4530
jmp 0x22a88
leaq -0x240(%rbp), %rdi
callq 0x11fb0
leaq -0x218(%rbp), %rdi
callq 0x4570
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x218(%rbp), %rdi
callq 0x4570
movq -0x220(%rbp), %rdi
callq 0x46d0
nopw %cs:(%rax,%rax)