// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
pushq $0x10
popq %rdx
movq %r14, %rsi
callq 0x32f0
leaq 0xa0(%rsp), %rdi
callq 0x30a0
testb %al, %al
je 0xe06f
leaq 0xc(%rsp), %rdx
movl $0x3, (%rdx)
movq (%r15), %rsi
leaq 0x8249(%rip), %rcx      # 0x16184
callq 0xdbce
movl 0xc(%rsp), %eax
cmpl $0x3, %eax
je 0xe09d
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
cmpl $0x2, %eax
je 0xdf6d
testl %eax, %eax
jne 0xdf76
addq $0x118, %rbx            # imm = 0x118
jmp 0xdf89
addq $0x130, %rbx            # imm = 0x130
jmp 0xdf89
addq $0x148, %rbx            # imm = 0x148
cmpl $0x1, %eax
leaq 0x10(%rsp), %rax
cmovneq %rax, %rbx
xorl %r14d, %r14d
leaq 0x30(%rsp), %r15
leaq 0x6098(%rip), %r12      # 0x14030
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r14
jae 0xe040
movq %r15, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x32a0
movq %rax, %r13
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xa8a0
movq %rax, %rdi
callq 0x5d1a
movq %r13, %rdi
movq %rax, %rsi
callq 0x32a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x32a0
movq %rax, %r13
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xa8a4
movq %rax, %rdi
callq 0x5d1a
movq %r13, %rdi
movq %rax, %rsi
callq 0x32a0
movq %rax, %rdi
movq %r12, %rsi
callq 0x32a0
movq (%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movsd 0x38(%rcx), %xmm0
movq %rax, %rdi
callq 0x34d0
movq %rax, %rdi
callq 0x3160
incq %r14
jmp 0xdf98
leaq 0x30(%rsp), %rdi
callq 0x33e0
leaq 0x10(%rsp), %rdi
callq 0x9226
leaq 0x30(%rsp), %rdi
callq 0x3420
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x11f52(%rip), %rdi     # 0x1ffc8
leaq 0x80c9(%rip), %rsi      # 0x16146
callq 0x32a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32a0
movq %rax, %rdi
callq 0x3160
pushq $0x1
popq %rdi
callq 0x3330
leaq 0x80f9(%rip), %rdi      # 0x1619d
leaq 0x7307(%rip), %rsi      # 0x153b2
leaq 0x8103(%rip), %rcx      # 0x161b5
movl $0x3dc, %edx            # imm = 0x3DC
callq 0x31b0
jmp 0xe0c0
jmp 0xe0c5
movq %rax, %rbx
jmp 0xe0d2
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x9226
leaq 0x30(%rsp), %rdi
callq 0x3420
movq %rbx, %rdi
callq 0x3540