// File: /workspace/github_c_makefile_star2_O2/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, 0x8(%rsp)
movl %ecx, 0x4(%rsp)
testl %edx, %edx
jle 0xb47f
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0xb279
movq 0x10(%r14), %rdi
callq 0x5d1a
movq %rax, %rdi
movq %r15, %rsi
callq 0x33d0
testl %eax, %eax
jne 0xb23c
leaq 0xa12d(%rip), %rdi      # 0x15390
leaq 0xa148(%rip), %rsi      # 0x153b2
leaq 0xa1ba(%rip), %rcx      # 0x1542b
pushq $0x57
popq %rdx
callq 0x31b0
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x18(%rbx), %r13
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0xf0d6
testq %rax, %rax
jne 0xb49b
leaq 0x10(%rsp), %rdi
callq 0x3150
movl $0xa0, %edi
callq 0x32c0
movq %rax, %r14
movzbl 0x4(%rsp), %r8d
movq %rax, %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %rbx, %rcx
movsd 0x8(%rsp), %xmm0
callq 0x6e6e
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0xf262
movq %r14, (%rax)
leaq 0x10(%rsp), %rdi
callq 0x3150
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x6
popq %rcx
xorl %edx, %edx
callq 0x32e0
leaq 0xa131(%rip), %rsi      # 0x15463
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x5047
movl %eax, %ebp
movq %r12, %rdi
callq 0x3150
testb %bpl, %bpl
je 0xb35f
leaq 0x278(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0xe93a
movq %r14, %rdi
callq 0x78c2
leaq 0x88(%rbx), %r12
leaq 0xd0(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0xe8(%rbx), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x30(%rsp), %r13
leaq 0xa0d8(%rip), %rbp      # 0x1546a
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0xb3ed
movq %r12, %rdi
movq %r13, %rsi
callq 0xe92e
movq %r15, %rdi
leaq 0x8f13(%rip), %rsi      # 0x142c4
callq 0x33d0
testl %eax, %eax
jne 0xb3c7
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xe92e
movq %r15, %rdi
movq %rbp, %rsi
callq 0x33d0
testl %eax, %eax
jne 0xb3e3
movq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0xe92e
movq %r14, %rdi
callq 0x7908
jmp 0xb392
cmpb $0x0, 0x4(%rsp)
je 0xb433
movq %r14, %rdi
callq 0x78c2
addq $0xa0, %rbx
leaq 0x30(%rsp), %r15
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0xb466
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe92e
movq 0x30(%rsp), %rax
movb $0x1, 0x110(%rax)
movq %r14, %rdi
callq 0x7908
jmp 0xb408
movq %r14, %rdi
callq 0x78c2
addq $0xb8, %rbx
leaq 0x30(%rsp), %r15
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0xb466
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe92e
movq %r14, %rdi
callq 0x7908
jmp 0xb447
leaq 0x10(%rsp), %rdi
callq 0x3150
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9f9c(%rip), %rdi      # 0x15422
leaq 0x9f25(%rip), %rsi      # 0x153b2
leaq 0x9f97(%rip), %rcx      # 0x1542b
pushq $0x55
jmp 0xb273
leaq 0x9f48(%rip), %rdi      # 0x153ea
leaq 0x9f09(%rip), %rsi      # 0x153b2
leaq 0x9f7b(%rip), %rcx      # 0x1542b
pushq $0x59
jmp 0xb273
jmp 0xb4e4
jmp 0xb4e4
jmp 0xb4e4
jmp 0xb4e4
jmp 0xb4e4
jmp 0xb4db
jmp 0xb4e4
jmp 0xb4db
movq %rax, %rbx
movl $0xa0, %esi
movq %r14, %rdi
callq 0x32d0
jmp 0xb4f1
jmp 0xb4e4
movq %rax, %rbx
jmp 0xb4f1
jmp 0xb4e4
jmp 0xb4e4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3540
nop