// File: /workspace/github_c_makefile_star2_O1/stonezwr[P]SpiKL-IP/network.C
// Function: Network::AddNeuronGroup(char*, int, bool, double)
void Network::AddNeuronGroup(char * name, int num, bool excitatory, double v_mem){
    assert(num >= 1);
    for(list<Neuron*>::iterator iter = _individualNeurons.begin(); iter != _individualNeurons.end(); iter++)
        assert(strcmp((*iter)->Name(),name) != 0);

    assert(_groupNeurons.find(string(name)) == _groupNeurons.end());

    NeuronGroup * neuronGroup = new NeuronGroup(name, num, this, excitatory, v_mem);
    _groupNeurons[string(name)] = neuronGroup;

    string name_str(name);
    if(name_str.substr(0, 6) == "hidden")   _hidden_layer_names.push_back(name_str);
   
    for(Neuron * neuron = neuronGroup->First(); neuron != NULL; neuron = neuronGroup->Next()){
        _allNeurons.push_back(neuron);
        if(strcmp(name,"input") == 0)
            _inputNeurons.push_back(neuron);
        if(strcmp(name,"output") == 0)
            _outputNeurons.push_back(neuron);
    }
    if(excitatory == true) for(Neuron * neuron = neuronGroup->First(); neuron != NULL; neuron = neuronGroup->Next()){
        _allExcitatoryNeurons.push_back(neuron);
        neuron->SetExcitatory();
    }
    else for(Neuron * neuron = neuronGroup->First(); neuron != NULL; neuron = neuronGroup->Next()) _allInhibitoryNeurons.push_back(neuron);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movsd %xmm0, 0x28(%rsp)
movl %ecx, 0x4(%rsp)
testl %edx, %edx
jle 0xd513
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0xd264
movq 0x10(%r14), %rdi
callq 0x6f9c
movq %rax, %rdi
movq %r15, %rsi
callq 0x33f0
testl %eax, %eax
jne 0xd225
leaq 0xb0c4(%rip), %rdi      # 0x18310
leaq 0xb0df(%rip), %rsi      # 0x18332
leaq 0xb151(%rip), %rcx      # 0x183ab
movl $0x57, %edx
callq 0x31b0
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r15, %rsi
callq 0xaa0c
leaq 0x18(%rbx), %r12
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x11b50
testq %rax, %rax
jne 0xd532
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xd2ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
movl $0xa0, %edi
callq 0x32e0
movq %rax, %r14
movzbl 0x4(%rsp), %r8d
movq %rax, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %rbx, %rcx
movsd 0x28(%rsp), %xmm0
callq 0x85ec
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r15, %rsi
callq 0xaa0c
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x11c4c
movq %r14, (%rax)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xd312
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r15, %rsi
callq 0xaa0c
leaq 0x38(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x6, %ecx
xorl %edx, %edx
callq 0x3310
leaq 0xb0a2(%rip), %rsi      # 0x183e3
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0x3100
movl %eax, %ebp
movq (%r12), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xd36b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32f0
testl %ebp, %ebp
jne 0xd380
leaq 0x278(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x116ce
movq %r14, %rdi
callq 0x91dc
movq %rax, %r13
leaq 0x88(%rbx), %r12
leaq 0xd0(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0xe8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0xb039(%rip), %rbp      # 0x183ea
testq %r13, %r13
je 0xd450
movl $0x18, %edi
callq 0x32e0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x3060
incq 0x98(%rbx)
movq %r15, %rdi
leaq 0x9ee0(%rip), %rsi      # 0x172c4
callq 0x33f0
testl %eax, %eax
jne 0xd40f
movl $0x18, %edi
callq 0x32e0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x3060
incq 0xe0(%rbx)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x33f0
testl %eax, %eax
jne 0xd440
movl $0x18, %edi
callq 0x32e0
movq %r13, 0x10(%rax)
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x3060
incq 0xf8(%rbx)
movq %r14, %rdi
callq 0x9222
movq %rax, %r13
jmp 0xd3b1
cmpb $0x0, 0x4(%rsp)
je 0xd4a4
movq %r14, %rdi
callq 0x91dc
movq %rax, %r12
leaq 0xa0(%rbx), %r15
testq %r12, %r12
je 0xd4e8
movl $0x18, %edi
callq 0x32e0
movq %r12, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x3060
incq 0xb0(%rbx)
movb $0x1, 0x110(%r12)
movq %r14, %rdi
callq 0x9222
movq %rax, %r12
jmp 0xd469
movq %r14, %rdi
callq 0x91dc
movq %rax, %r12
leaq 0xb8(%rbx), %r15
testq %r12, %r12
je 0xd4e8
movl $0x18, %edi
callq 0x32e0
movq %r12, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x3060
incq 0xc8(%rbx)
movq %r14, %rdi
callq 0x9222
movq %rax, %r12
jmp 0xd4b6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xd504
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xae88(%rip), %rdi      # 0x183a2
leaq 0xae11(%rip), %rsi      # 0x18332
leaq 0xae83(%rip), %rcx      # 0x183ab
movl $0x55, %edx
callq 0x31b0
leaq 0xae31(%rip), %rdi      # 0x1836a
leaq 0xadf2(%rip), %rsi      # 0x18332
leaq 0xae64(%rip), %rcx      # 0x183ab
movl $0x59, %edx
callq 0x31b0
jmp 0xd585
jmp 0xd585
jmp 0xd585
jmp 0xd585
jmp 0xd585
jmp 0xd57c
jmp 0xd585
jmp 0xd57c
movq %rax, %rbx
movl $0xa0, %esi
movq %r14, %rdi
jmp 0xd59f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0xd592
movq %rax, %rbx
jmp 0xd5a4
jmp 0xd585
jmp 0xd585
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xd5a4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x3570