// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/./network.h
// Function: void Network::LSMAddSynapse<double>(Neuron*, Neuron*, double, bool, double, bool, NeuronGroup*)
void LSMAddSynapse(Neuron * pre, Neuron * post, T weight, bool fixed, T weight_limit,bool liquid, NeuronGroup * group = NULL){
        Synapse * synapse = new Synapse(pre, post, weight, fixed, weight_limit, pre->IsExcitatory(),liquid);
        _synapses.push_back(synapse);
        std::string pre_name = std::string(pre->Name());
        std::string post_name = std::string(post->Name());
        if(_synapses_map.find(pre_name) == _synapses_map.end()){
            _synapses_map[pre_name] = std::unordered_map<std::string, Synapse*>();
        }
        if(_synapses_map[pre_name].find(post_name) != _synapses_map[pre_name].end()){
            std::cout<<"Warning:: duplicate synapse "<<pre_name<<" to "<<post_name<<" detected"<<std::endl;
        }
        _synapses_map[pre_name][post_name] = synapse; 
    
        // push back the reservoir, readout and input synapses into the vector:
        if(!synapse->IsReadoutSyn() && !synapse->IsInputSyn())
            _rsynapses.push_back(synapse);
        else if(synapse->IsReadoutSyn())
            _rosynapses.push_back(synapse);
        else
            _isynapses.push_back(synapse);

        if(group)  group->AddSynapse(synapse);
        pre->AddPostSyn(synapse);
        post->AddPreSyn(synapse);	
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
movsd %xmm1, -0x30(%rbp)
andb $0x1, %al
movb %al, -0x31(%rbp)
movq %r9, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
movl $0xc0, %edi
callq 0x4380
movq %rax, -0x128(%rbp)
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x120(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x118(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x108(%rbp)
movzbl -0x21(%rbp), %eax
movl %eax, -0x12c(%rbp)
callq 0x13350
movl -0x12c(%rbp), %ecx
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movsd -0x110(%rbp), %xmm0
movsd -0x108(%rbp), %xmm1
movzbl -0x31(%rbp), %r9d
andl $0x1, %ecx
movzbl %al, %r8d
andl $0x1, %r9d
callq 0x1bb00
jmp 0x12e77
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rax
movq %rax, -0x48(%rbp)
addq $0x100, %rdi            # imm = 0x100
leaq -0x48(%rbp), %rsi
callq 0x17020
movq -0x10(%rbp), %rdi
callq 0xbea0
movq %rax, -0x150(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x46f0
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x12880
jmp 0x12ed2
leaq -0x79(%rbp), %rdi
callq 0x43d0
movq -0x18(%rbp), %rdi
callq 0xbea0
movq %rax, -0x160(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x46f0
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x12880
jmp 0x12f1a
leaq -0xa1(%rbp), %rdi
callq 0x43d0
movq -0x140(%rbp), %rdi
addq $0x50, %rdi
leaq -0x78(%rbp), %rsi
callq 0x17090
movq %rax, -0x168(%rbp)
jmp 0x12f43
movq -0x140(%rbp), %rdi
movq -0x168(%rbp), %rax
movq %rax, -0xb0(%rbp)
addq $0x50, %rdi
callq 0x170c0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x17060
testb $0x1, %al
jne 0x12f84
jmp 0x1307b
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0xe0(%rbp)
movaps %xmm0, -0xf0(%rbp)
movq $0x0, -0xc0(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x170f0
movq -0x140(%rbp), %rdi
addq $0x50, %rdi
leaq -0x78(%rbp), %rsi
callq 0x17110
movq %rax, -0x170(%rbp)
jmp 0x12fd0
movq -0x170(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x17140
leaq -0xf0(%rbp), %rdi
callq 0x17170
jmp 0x1307b
movq -0x138(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl $0xc0, %esi
callq 0x4390
jmp 0x13316
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x79(%rbp), %rdi
callq 0x43d0
jmp 0x13316
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x43d0
jmp 0x1330d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x13301
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x17170
jmp 0x13301
movq -0x140(%rbp), %rdi
addq $0x50, %rdi
leaq -0x78(%rbp), %rsi
callq 0x17110
movq %rax, -0x178(%rbp)
jmp 0x13098
movq -0x178(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x171c0
movq %rax, -0x180(%rbp)
jmp 0x130b4
movq -0x140(%rbp), %rdi
movq -0x180(%rbp), %rax
movq %rax, -0xf8(%rbp)
addq $0x50, %rdi
leaq -0x78(%rbp), %rsi
callq 0x17110
movq %rax, -0x188(%rbp)
jmp 0x130df
movq -0x188(%rbp), %rdi
callq 0x171f0
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x17190
testb $0x1, %al
jne 0x1310e
jmp 0x131ae
movq 0x39eb3(%rip), %rdi     # 0x4cfc8
leaq 0x2200f(%rip), %rsi     # 0x3512b
callq 0x4360
movq %rax, -0x190(%rbp)
jmp 0x1312a
movq -0x190(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x4300
movq %rax, -0x198(%rbp)
jmp 0x13143
movq -0x198(%rbp), %rdi
leaq 0x21ff7(%rip), %rsi     # 0x35148
callq 0x4360
movq %rax, -0x1a0(%rbp)
jmp 0x1315f
movq -0x1a0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x4300
movq %rax, -0x1a8(%rbp)
jmp 0x1317b
movq -0x1a8(%rbp), %rdi
leaq 0x21fc4(%rip), %rsi     # 0x3514d
callq 0x4360
movq %rax, -0x1b0(%rbp)
jmp 0x13197
movq -0x1b0(%rbp), %rdi
movq 0x39e13(%rip), %rsi     # 0x4cfb8
callq 0x43b0
jmp 0x131ac
jmp 0x131ae
movq -0x140(%rbp), %rdi
movq -0x48(%rbp), %rax
movq %rax, -0x1c0(%rbp)
addq $0x50, %rdi
leaq -0x78(%rbp), %rsi
callq 0x17110
movq %rax, -0x1b8(%rbp)
jmp 0x131d6
movq -0x1b8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x17220
movq %rax, -0x1c8(%rbp)
jmp 0x131f2
movq -0x1c8(%rbp), %rax
movq -0x1c0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x48(%rbp), %rdi
callq 0x1bde0
movb %al, -0x1c9(%rbp)
jmp 0x13214
movb -0x1c9(%rbp), %al
testb $0x1, %al
jne 0x13258
jmp 0x13220
movq -0x48(%rbp), %rdi
callq 0x1be50
movb %al, -0x1ca(%rbp)
jmp 0x13231
movb -0x1ca(%rbp), %al
testb $0x1, %al
jne 0x13258
jmp 0x1323d
movq -0x140(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
leaq -0x48(%rbp), %rsi
callq 0x12010
jmp 0x13256
jmp 0x132ad
movq -0x48(%rbp), %rdi
callq 0x1bde0
movb %al, -0x1cb(%rbp)
jmp 0x13269
movb -0x1cb(%rbp), %al
testb $0x1, %al
jne 0x13275
jmp 0x13290
movq -0x140(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
leaq -0x48(%rbp), %rsi
callq 0x12010
jmp 0x1328e
jmp 0x132ab
movq -0x140(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
leaq -0x48(%rbp), %rsi
callq 0x12010
jmp 0x132a9
jmp 0x132ab
jmp 0x132ad
cmpq $0x0, -0x40(%rbp)
je 0x132c5
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xf080
jmp 0x132c3
jmp 0x132c5
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xbec0
jmp 0x132d4
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0xbef0
jmp 0x132e3
leaq -0xa0(%rbp), %rdi
callq 0x4200
leaq -0x78(%rbp), %rdi
callq 0x4200
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0xa0(%rbp), %rdi
callq 0x4200
leaq -0x78(%rbp), %rdi
callq 0x4200
movq -0x50(%rbp), %rdi
callq 0x46d0
nop