// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x28(%rsp), %rdi
movq %rdx, %rsi
movl $0x10, %edx
callq 0x3320
leaq 0x98(%rsp), %rdi
callq 0x30b0
testb %al, %al
je 0x109c8
leaq 0xc(%rsp), %rdx
movl $0x3, (%rdx)
movq (%r15), %rsi
leaq 0x89c6(%rip), %rcx      # 0x191a4
callq 0x1046e
movl 0xc(%rsp), %eax
cmpl $0x3, %eax
je 0x10a01
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
cmpl $0x2, %eax
je 0x10813
testl %eax, %eax
jne 0x1081c
addq $0x118, %rbx            # imm = 0x118
jmp 0x1082f
addq $0x130, %rbx            # imm = 0x130
jmp 0x1082f
addq $0x148, %rbx            # imm = 0x148
cmpl $0x1, %eax
leaq 0x10(%rsp), %rax
cmovneq %rax, %rbx
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x1097a
xorl %r14d, %r14d
leaq 0x28(%rsp), %r15
leaq 0x6805(%rip), %r12      # 0x17050
movq %r15, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3340
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xc17c
movq %rax, %rdi
callq 0x6ec8
movq %rax, %rbp
testq %rax, %rax
je 0x1089d
movq %rbp, %rdi
callq 0x3150
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x3340
jmp 0x108b6
movq (%r13), %rax
movq -0x18(%rax), %rax
leaq (%rax,%r13), %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x3550
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x3340
movq (%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0xc180
movq %rax, %rdi
callq 0x6ec8
movq %rax, %rbp
testq %rax, %rax
je 0x108fa
movq %rbp, %rdi
callq 0x3150
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x3340
jmp 0x10915
movq (%r13), %rax
movq -0x18(%rax), %rax
movq %r13, %rdi
addq %rax, %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x3550
movl $0x1, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x3340
movq (%rbx), %rax
movq (%rax,%r14,8), %rax
movsd 0x38(%rax), %xmm0
movq %r13, %rdi
callq 0x34f0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
incq %r14
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r14
jb 0x1084b
leaq 0x28(%rsp), %rdi
callq 0x3410
movq 0x1063d(%rip), %rax     # 0x20fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x30(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x28(%rsp,%rcx)
callq 0x3240
leaq 0x120(%rsp), %rdi
callq 0x3120
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10601(%rip), %rdi     # 0x20fd0
leaq 0x8790(%rip), %rsi      # 0x19166
movl $0x3d, %edx
callq 0x3340
movq 0x105e9(%rip), %rdi     # 0x20fd0
movq %r14, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
leaq 0x87b5(%rip), %rdi      # 0x191bd
leaq 0x79c3(%rip), %rsi      # 0x183d2
leaq 0x87bf(%rip), %rcx      # 0x191d5
movl $0x3dc, %edx            # imm = 0x3DC
callq 0x31b0
jmp 0x10a26
jmp 0x10a26
jmp 0x10a26
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3570
nop