LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::AddNeuron(char*, bool, double)
void Network::AddNeuron(char * name, bool excitatory, double v_mem){
    for(list<Neuron*>::iterator iter = _individualNeurons.begin(); iter != _individualNeurons.end(); iter++)
        assert(strcmp((*iter)->Name(),name) != 0);

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

    Neuron * neuron = new Neuron(name, excitatory, this, v_mem);
    _individualNeurons.push_back(neuron);
    _allNeurons.push_back(neuron);
    if(excitatory == true){
        _allExcitatoryNeurons.push_back(neuron);
        neuron->SetExcitatory();
    }else _allInhibitoryNeurons.push_back(neuron);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movsd %xmm0, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq %rdi, %r15
movq (%r15), %r15
cmpq %rbx, %r15
je 0xb106
movq 0x10(%r15), %rdi
callq 0x5d1a
movq %rax, %rdi
movq %r14, %rsi
callq 0x33d0
testl %eax, %eax
jne 0xb0c9
leaq 0xa2a0(%rip), %rdi      # 0x15390
leaq 0xa2bb(%rip), %rsi      # 0x153b2
leaq 0xa2be(%rip), %rcx      # 0x153bc
pushq $0x47
popq %rdx
callq 0x31b0
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r14, %rsi
callq 0x8d8c
leaq 0x18(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0xf0d6
testq %rax, %rax
jne 0xb1c7
leaq 0x18(%rsp), %rdi
callq 0x3150
movl $0x220, %edi            # imm = 0x220
callq 0x32c0
movq %rax, %r15
movzbl %bpl, %edx
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rcx
movsd 0x10(%rsp), %xmm0
callq 0x5ac4
leaq 0x18(%rsp), %r14
movq %r15, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe92e
leaq 0x88(%rbx), %rdi
movq %r14, %rsi
callq 0xe92e
testb %bpl, %bpl
je 0xb1a8
addq $0xa0, %rbx
leaq 0x18(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe92e
movq (%r14), %rax
movb $0x1, 0x110(%rax)
jmp 0xb1bc
addq $0xb8, %rbx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0xe92e
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa21c(%rip), %rdi      # 0x153ea
leaq 0xa1dd(%rip), %rsi      # 0x153b2
leaq 0xa1e0(%rip), %rcx      # 0x153bc
pushq $0x49
jmp 0xb100
movq %rax, %rbx
movl $0x220, %esi            # imm = 0x220
movq %r15, %rdi
callq 0x32d0
jmp 0xb207
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3150
jmp 0xb207
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3540
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMAddNeuronGroup(char*, int, int, int)
void Network::LSMAddNeuronGroup(char * name, int dim1, int dim2, int dim3){
    assert((dim1>0)&&(dim2>0)&&(dim3>0));
    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, dim1, dim2, dim3, this);

    _groupNeurons[string(name)] = neuronGroup;

    for(Neuron * neuron = neuronGroup->First(); neuron != NULL; neuron = neuronGroup->Next()){
        _allNeurons.push_back(neuron);
        if(neuron->IsExcitatory()) _allExcitatoryNeurons.push_back(neuron);
        else _allInhibitoryNeurons.push_back(neuron);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %edx, %edx
jle 0xb664
movl %ecx, %r13d
testl %ecx, %ecx
jle 0xb664
movl %r8d, %r12d
testl %r8d, %r8d
jle 0xb664
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0xb56f
movq 0x10(%r14), %rdi
callq 0x5d1a
movq %rax, %rdi
movq %r15, %rsi
callq 0x33d0
testl %eax, %eax
jne 0xb532
leaq 0x9e37(%rip), %rdi      # 0x15390
leaq 0x9e52(%rip), %rsi      # 0x153b2
leaq 0x9f27(%rip), %rcx      # 0x1548e
pushq $0x73
popq %rdx
callq 0x31b0
movl %ebp, 0x4(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x3(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x18(%rbx), %rbp
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0xf0d6
testq %rax, %rax
jne 0xb680
leaq 0x8(%rsp), %rdi
callq 0x3150
movl $0xa0, %edi
callq 0x32c0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movl 0x4(%rsp), %edx
movl %r13d, %ecx
movl %r12d, %r8d
movq %rbx, %r9
callq 0x7432
leaq 0x8(%rsp), %rdi
leaq 0x3(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0xf262
movq %r14, (%rax)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3150
movq %r14, %rdi
callq 0x78c2
leaq 0x88(%rbx), %r12
leaq 0xb8(%rbx), %r13
addq $0xa0, %rbx
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xb655
movq %r12, %rdi
movq %r15, %rsi
callq 0xe92e
movq 0x8(%rsp), %rax
cmpb $0x0, 0x110(%rax)
movq %rbx, %rdi
jne 0xb643
movq %r13, %rdi
movq %r15, %rsi
callq 0xe92e
movq %r14, %rdi
callq 0x7908
jmp 0xb61a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9e06(%rip), %rdi      # 0x15471
leaq 0x9d40(%rip), %rsi      # 0x153b2
leaq 0x9e15(%rip), %rcx      # 0x1548e
pushq $0x71
jmp 0xb569
leaq 0x9d63(%rip), %rdi      # 0x153ea
leaq 0x9d24(%rip), %rsi      # 0x153b2
leaq 0x9df9(%rip), %rcx      # 0x1548e
pushq $0x75
jmp 0xb569
jmp 0xb6b2
jmp 0xb6c1
movq %rax, %rbx
movl $0xa0, %esi
movq %r14, %rdi
callq 0x32d0
jmp 0xb6c4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3150
jmp 0xb6c4
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3540
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMAddNeuronGroup(char*, char*, char*)
void Network::LSMAddNeuronGroup(char * name, char * path_info_neuron, char * path_info_synapse){
    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, path_info_neuron, path_info_synapse,this); //This function helps to generate the reservoir with brain-like connectivity
    _groupNeurons[string(name)] = neuronGroup;

    for(Neuron * neuron = neuronGroup->First(); neuron != NULL; neuron = neuronGroup->Next()){
        _allNeurons.push_back(neuron);
        if(neuron->IsExcitatory()) _allExcitatoryNeurons.push_back(neuron);
        else _allInhibitoryNeurons.push_back(neuron);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movq %rdi, %r14
movq (%r14), %r14
cmpq %rbx, %r14
je 0xb728
movq 0x10(%r14), %rdi
callq 0x5d1a
movq %rax, %rdi
movq %r15, %rsi
callq 0x33d0
testl %eax, %eax
jne 0xb6e9
leaq 0x9c80(%rip), %rdi      # 0x15390
leaq 0x9c9b(%rip), %rsi      # 0x153b2
leaq 0x9da7(%rip), %rcx      # 0x154c5
movl $0x85, %edx
callq 0x31b0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x18(%rbx), %rbp
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0xf0d6
testq %rax, %rax
jne 0xb815
leaq 0x8(%rsp), %rdi
callq 0x3150
movl $0xa0, %edi
callq 0x32c0
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x6fe0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
movq %r15, %rsi
callq 0x8d8c
leaq 0x8(%rsp), %rsi
movq %rbp, %rdi
callq 0xf262
movq %r14, (%rax)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3150
movq %r14, %rdi
callq 0x78c2
leaq 0x88(%rbx), %r12
leaq 0xb8(%rbx), %r13
addq $0xa0, %rbx
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0xb806
movq %r12, %rdi
movq %r15, %rsi
callq 0xe92e
movq 0x8(%rsp), %rax
cmpb $0x0, 0x110(%rax)
movq %rbx, %rdi
jne 0xb7f4
movq %r13, %rdi
movq %r15, %rsi
callq 0xe92e
movq %r14, %rdi
callq 0x7908
jmp 0xb7cb
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9bce(%rip), %rdi      # 0x153ea
leaq 0x9b8f(%rip), %rsi      # 0x153b2
leaq 0x9c9b(%rip), %rcx      # 0x154c5
movl $0x87, %edx
callq 0x31b0
jmp 0xb84a
jmp 0xb859
movq %rax, %rbx
movl $0xa0, %esi
movq %r14, %rdi
callq 0x32d0
jmp 0xb85c
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3150
jmp 0xb85c
movq %rax, %rbx
movq %rbx, %rdi
callq 0x3540
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMAddSynapse(NeuronGroup*, int, int, int, int, bool)
void Network::LSMAddSynapse(NeuronGroup * pre, int npre, int npost, int value, int random, bool fixed){
    assert(npre == -1 && npost == -1);
    assert(fixed);
    assert(value > 0);
    pre->SetLateral();
    pre->SetLateralWeight(double(value));
    for(Neuron * pre_neuron = pre->First(); pre_neuron != NULL; pre_neuron = pre->Next()){
        for(int i = 0; i < pre->Size(); ++i){
            Neuron * post_neuron = pre->Order(i);
            if(pre_neuron == post_neuron)   continue;
            // weight_value, fixed, weight_limit, is_in_liquid
            LSMAddSynapse(pre_neuron, post_neuron, double(-value), fixed, double(value), false);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
andl %ecx, %edx
cmpl $-0x1, %edx
jne 0xbabc
cmpb $0x0, 0x40(%rsp)
je 0xbadb
movl %r8d, %ebp
testl %r8d, %r8d
jle 0xbafa
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, 0x82(%rsi)
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x88(%rsi)
movq %rsi, %rdi
callq 0x78c2
movq %rax, %r15
negl %ebp
cvtsi2sd %ebp, %xmm0
movsd %xmm0, (%rsp)
pushq $0x1
popq %rbp
testq %r15, %r15
je 0xbaaf
xorl %r12d, %r12d
movq 0x30(%rbx), %rax
subq 0x28(%rbx), %rax
shrq $0x3, %rax
movq %rbx, %rdi
cmpl %eax, %r12d
jge 0xbaa5
movl %r12d, %esi
callq 0x79f2
cmpq %rax, %r15
je 0xbaa0
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movsd (%rsp), %xmm0
movl %ebp, %ecx
movsd 0x8(%rsp), %xmm1
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x8e5c
incl %r12d
jmp 0xba5e
callq 0x7908
movq %rax, %r15
jmp 0xba56
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9a90(%rip), %rdi      # 0x15553
leaq 0x98e8(%rip), %rsi      # 0x153b2
leaq 0x9a9c(%rip), %rcx      # 0x1556d
movl $0xc8, %edx
callq 0x31b0
leaq 0x9ad0(%rip), %rdi      # 0x155b2
leaq 0x98c9(%rip), %rsi      # 0x153b2
leaq 0x9a7d(%rip), %rcx      # 0x1556d
movl $0xc9, %edx
callq 0x31b0
leaq 0x9ab7(%rip), %rdi      # 0x155b8
leaq 0x98aa(%rip), %rsi      # 0x153b2
leaq 0x9a5e(%rip), %rcx      # 0x1556d
movl $0xca, %edx
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMAddSynapse(NeuronGroup*, NeuronGroup*, int, int, int, int, bool)
void Network::LSMAddSynapse(NeuronGroup * pre, NeuronGroup * post, int npre, int npost, int value, int random, bool fixed){
    assert((npre == 1)||(npre == -1));
    for(Neuron * neuron = pre->First(); neuron != NULL; neuron = pre->Next()){
        LSMAddSynapse(neuron,post,npost,value, random, fixed);
    }
    if(pre->GetBiasNeuron() != NULL){
        BiasNeuron * b_neuron = pre->GetBiasNeuron();
        LSMAddSynapse(b_neuron, post, npost, value, 0, fixed);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %r8d, %ebp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
cmpl $-0x1, %ecx
je 0xbb3e
cmpl $0x1, %ecx
jne 0xbbaa
movb 0x48(%rsp), %r13b
movq %r12, %rdi
callq 0x78c2
movzbl %r13b, %r13d
testq %rax, %rax
je 0xbb7a
movl %r13d, (%rsp)
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
movl 0x40(%rsp), %r9d
callq 0xb864
movq %r12, %rdi
callq 0x7908
jmp 0xbb4f
movq 0x48(%r12), %rsi
testq %rsi, %rsi
je 0xbb9b
movl %r13d, (%rsp)
movq %r15, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
callq 0xb864
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9a11(%rip), %rdi      # 0x155c2
leaq 0x97fa(%rip), %rsi      # 0x153b2
leaq 0x9a1d(%rip), %rcx      # 0x155dc
movl $0xd8, %edx
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMAddSynapse(char*, char*, int, int, int, int, bool)
void Network::LSMAddSynapse(char * pre, char * post, int npre, int npost, int value, int random, bool fixed){
    NeuronGroup * preNeuronGroup = SearchForNeuronGroup(pre);
    NeuronGroup * postNeuronGroup = SearchForNeuronGroup(post);
    assert((preNeuronGroup != NULL)&&(postNeuronGroup != NULL));
    
    // add synapses
    if(strcmp(pre, post) != 0) // between layer connections
        LSMAddSynapse(preNeuronGroup, postNeuronGroup, npre, npost, value, random, fixed);
    else{ // laterial inhibition
        assert(preNeuronGroup == postNeuronGroup);
        LSMAddSynapse(preNeuronGroup, npre, npost, value, random, fixed);
    } 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x14(%rsp)
movl %r8d, 0x10(%rsp)
movl %ecx, %r14d
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r15
movb 0x58(%rsp), %al
movb %al, 0xf(%rsp)
callq 0xbcc0
movq %rax, %r12
movq %r15, %rdi
movq %r13, %rsi
callq 0xbcc0
testq %r12, %r12
je 0xbc81
movq %rax, %rbp
testq %rax, %rax
je 0xbc81
movq %rbx, %rdi
movq %r13, %rsi
callq 0x33d0
testl %eax, %eax
je 0xbc4e
movq %r15, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movl %r14d, %ecx
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbb1a
cmpq %rbp, %r12
jne 0xbca0
movzbl 0xf(%rsp), %eax
movl %eax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %r14d, %edx
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %r8d
callq 0xb9f0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x99a8(%rip), %rdi      # 0x15630
leaq 0x9723(%rip), %rsi      # 0x153b2
leaq 0x99ce(%rip), %rcx      # 0x15664
movl $0xe5, %edx
callq 0x31b0
leaq 0x9a03(%rip), %rdi      # 0x156aa
leaq 0x9704(%rip), %rsi      # 0x153b2
leaq 0x99af(%rip), %rcx      # 0x15664
movl $0xeb, %edx
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::PrintSize()
void Network::PrintSize(){
    cout<<"Total Number of neurons: "<<_allNeurons.size()<<endl;
    cout<<"Total Number of synapses: "<<_synapses.size()<<endl;
    int numExitatory = 0;
    int numLearning = 0;
    for(list<Synapse*>::iterator iter = _synapses.begin(); iter != _synapses.end(); iter++){
        if((*iter)->Excitatory()==true) numExitatory++;
        if((*iter)->Fixed()==false) numLearning++;
    }
    cout<<"\tNumber of excitatory synapses: "<<numExitatory<<endl;
    cout<<"\tNumber of learning synapses: "<<numLearning<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1424f(%rip), %r14     # 0x1ffc8
leaq 0x994c(%rip), %rsi      # 0x156cc
movq %r14, %rdi
callq 0x32a0
movq 0x98(%rbx), %rsi
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
callq 0x3160
leaq 0x9940(%rip), %rsi      # 0x156e6
movq %r14, %rdi
callq 0x32a0
movq 0x110(%rbx), %rsi
addq $0x100, %rbx            # imm = 0x100
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
callq 0x3160
xorl %ebp, %ebp
movq %rbx, %r15
xorl %r14d, %r14d
movq (%r15), %r15
cmpq %rbx, %r15
je 0xbdfd
movq 0x10(%r15), %rdi
callq 0xa8aa
movzbl %al, %eax
addl %eax, %r14d
movq 0x10(%r15), %rdi
callq 0xa8ae
xorb $0x1, %al
movzbl %al, %eax
addl %eax, %ebp
jmp 0xbdd4
movq 0x141c4(%rip), %rbx     # 0x1ffc8
leaq 0x98f6(%rip), %rsi      # 0x15701
movq %rbx, %rdi
callq 0x32a0
movq %rax, %rdi
movl %r14d, %esi
callq 0x3530
movq %rax, %rdi
callq 0x3160
leaq 0x98f5(%rip), %rsi      # 0x15722
movq %rbx, %rdi
callq 0x32a0
movq %rax, %rdi
movl %ebp, %esi
callq 0x3530
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3160
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMClearSignals()
void Network::LSMClearSignals(){
    for(list<Neuron*>::iterator iter = _allNeurons.begin(); iter != _allNeurons.end(); iter++) (*iter)->LSMClear();
    for(list<Synapse*>::iterator iter = _synapses.begin(); iter != _synapses.end(); iter++) (*iter)->LSMClear();
    // Remember to clear the list to store the synapses:      
    _lsmActiveLearnSyns.clear();                              
    _lsmActiveSyns.clear();
    _sp = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x88(%rdi), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xc041
movq 0x10(%r15), %rdi
callq 0x5dde
jmp 0xc02e
leaq 0x100(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xc05e
movq 0x10(%r15), %rdi
callq 0xa8ee
jmp 0xc04b
leaq 0x160(%rbx), %rdi
callq 0xe966
leaq 0x178(%rbx), %rdi
callq 0xe966
andq $0x0, 0x260(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadFirstSpeech(bool, networkmode_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Network::LoadFirstSpeech(bool train, networkmode_t networkmode, const string sample_type){
    LSMLoadLayers();

    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout); 
    auto sp_end_ptr = _speeches.end();
    _sp_iter = _speeches.begin();

    if(_sp_iter != sp_end_ptr){
        LoadSpeeches(*_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout, train);
        return (*_sp_iter)->Index();
    }else{
        _sp = NULL;
        return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movl %edx, (%r14)
callq 0xd2ea
pushq $0x3
popq %rax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rsp, %r8
movl %eax, (%r8)
movq %r14, %rsi
callq 0xd3ee
movq 0x208(%rbx), %rax
movq %rax, 0x220(%rbx)
cmpq 0x210(%rbx), %rax
je 0xc101
movq (%rax), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movzbl %bpl, %r9d
movq %rbx, %rdi
callq 0xd10c
movq 0x220(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xc10c
andq $0x0, 0x260(%rbx)
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::SpeechEndTime()
int Network::SpeechEndTime(){
    if(_sp == NULL){
        cout<<"In Network::EndSpeechTime(), find out the attached _sp in network"
            <<" is valid!!"<< endl;
        assert(_sp != NULL);
    }
    return _sp->EndTime();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x260(%rdi), %rdi
testq %rdi, %rdi
jne 0xc15c
movq 0x13e9b(%rip), %rdi     # 0x1ffc8
leaq 0x9679(%rip), %rsi      # 0x157ad
callq 0x32a0
leaq 0x96af(%rip), %rsi      # 0x157ef
movq %rax, %rdi
callq 0x32a0
movq %rax, %rdi
callq 0x3160
movq 0x260(%rbx), %rdi
testq %rdi, %rdi
je 0xc162
popq %rbx
jmp 0x4d7c
leaq 0x9692(%rip), %rdi      # 0x157fb
leaq 0x9242(%rip), %rsi      # 0x153b2
leaq 0x9690(%rip), %rcx      # 0x15807
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMNextTimeStep(int, bool, int, int, _IO_FILE*)
void Network::LSMNextTimeStep(int t, bool train,int iteration,int end_time, FILE * Foutp){
    _lsm_t = t;
	vector<int> state; 

    _lsmActiveSyns.clear();

    // Please remember that the neuron firing activity will change the list: 
    // _lsmActiveSyns, _lsmActiveSTDPLearnSyns, and _lsmActiveLearnSyns:
    for(Neuron * neuron : _allNeurons){
		neuron->LSMNextTimeStep(t, Foutp, train, end_time);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r12
movl %r8d, %r13d
movl %ecx, (%rsp)
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, 0x2bc(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
addq $0x178, %rdi            # imm = 0x178
callq 0xe966
movq %rbx, 0x8(%rsp)
leaq 0x88(%rbx), %r14
movl %r15d, 0x4(%rsp)
movzbl %r15b, %r15d
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0xc229
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
movl %ebp, %esi
movq %r12, %rdx
movl %r15d, %ecx
movl %r13d, %r8d
callq *(%rax)
jmp 0xc20b
movq %r14, %rbx
movq 0x8(%rsp), %r15
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0xc244
movq 0x10(%rbx), %rdi
callq 0x5f7a
jmp 0xc231
cmpb $0x0, 0x4(%rsp)
je 0xc283
cmpl $0x1, 0x2c0(%r15)
jne 0xc283
addq $0x160, %r15            # imm = 0x160
movq %r15, %rbx
movl (%rsp), %r14d
movq (%rbx), %rbx
cmpq %r15, %rbx
je 0xc27b
movq 0x10(%rbx), %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0xa7e2
jmp 0xc263
movq %r15, %rdi
callq 0xe966
leaq 0x10(%rsp), %rdi
callq 0x520c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc2a0
jmp 0xc2a0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x520c
movq %rbx, %rdi
callq 0x3540
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::SpeechPrint(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Network::SpeechPrint(int info, const string& channel_name){
    // prepare the paths
    string s;
    for(int i=0;i<CLS;i++){
        s="spikes/Input_Response/"+to_string(i);
        if(access(s.c_str(),0)!=0)
            MakeDirs(s);
        s="spikes/Reservoir_Response/"+to_string(i);
        if(access(s.c_str(),0)!=0)
            MakeDirs(s);
        s="spikes/Readout_Response_Trans/"+to_string(i);
        if(access(s.c_str(),0)!=0)
            MakeDirs(s);
    }
    if(_sp_iter != _speeches.end())
        (*_sp_iter)->PrintSpikes(info, channel_name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, 0x8(%rsp)
movl %esi, 0x4(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, 0x10(%rsp)
movb $0x0, (%rax)
xorl %r15d, %r15d
leaq 0x38(%rsp), %r12
leaq 0xb8(%rsp), %rbx
leaq 0x18(%rsp), %rbp
leaq 0x98(%rsp), %r14
cmpl $0x1a, %r15d
je 0xc44c
movq %r12, %rdi
movl %r15d, %esi
callq 0x50fe
movq %rbx, %rdi
leaq 0x7fac(%rip), %rsi      # 0x142ce
movq %r12, %rdx
callq 0x50da
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x3150
movq %r12, %rdi
callq 0x3150
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x3520
testl %eax, %eax
je 0xc370
movq %r14, %rdi
movq %rbp, %rsi
callq 0x33c0
movq %r14, %rdi
callq 0x11845
movq %r14, %rdi
callq 0x3150
movq %r12, %rdi
movl %r15d, %esi
callq 0x50fe
movq %rbx, %rdi
leaq 0x7f7e(%rip), %rsi      # 0x14303
movq %r12, %rdx
callq 0x50da
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x3150
movq %r12, %rdi
callq 0x3150
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x3520
testl %eax, %eax
je 0xc3da
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x33c0
leaq 0x78(%rsp), %r13
movq %r13, %rdi
callq 0x11845
movq %r13, %rdi
callq 0x3150
movq %r12, %rdi
movl %r15d, %esi
callq 0x50fe
movq %rbx, %rdi
leaq 0x97a2(%rip), %rsi      # 0x15b91
movq %r12, %rdx
callq 0x50da
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x3350
movq %rbx, %rdi
callq 0x3150
movq %r12, %rdi
callq 0x3150
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x3520
testl %eax, %eax
je 0xc444
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x33c0
leaq 0x58(%rsp), %r13
movq %r13, %rdi
callq 0x11845
movq %r13, %rdi
callq 0x3150
incl %r15d
jmp 0xc303
movq 0x10(%rsp), %rcx
movq 0x220(%rcx), %rax
cmpq 0x210(%rcx), %rax
je 0xc472
movq (%rax), %rdi
movl 0x4(%rsp), %esi
movq 0x8(%rsp), %rdx
callq 0x48d6
leaq 0x18(%rsp), %rdi
callq 0x3150
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc4ca
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0xc4c3
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0xc4c3
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0xc4c3
jmp 0xc4bb
jmp 0xc4ca
jmp 0xc4ca
jmp 0xc4bb
jmp 0xc4ca
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3150
jmp 0xc4cd
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3150
movq %rbx, %rdi
callq 0x3540
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMClearSignalsIP()
void Network::LSMClearSignalsIP(){
    for(list<Neuron*>::iterator iter = _allNeurons.begin(); iter != _allNeurons.end(); iter++) (*iter)->LSMClearIP();
    for(list<Synapse*>::iterator iter = _synapses.begin(); iter != _synapses.end(); iter++) (*iter)->LSMClear();
    // Remember to clear the list to store the synapses:      
    _lsmActiveLearnSyns.clear();                              
    _lsmActiveSyns.clear();
    _sp = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x88(%rdi), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xc505
movq 0x10(%r15), %rdi
callq 0x5eae
jmp 0xc4f2
leaq 0x100(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0xc522
movq 0x10(%r15), %rdi
callq 0xa8ee
jmp 0xc50f
leaq 0x160(%rbx), %rdi
callq 0xe966
leaq 0x178(%rbx), %rdi
callq 0xe966
andq $0x0, 0x260(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadSpeechAgain(bool, networkmode_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Network::LoadSpeechAgain(bool train, networkmode_t networkmode, const string sample_type){
    assert(_lsm_input_layer != NULL);
    assert(_lsm_reservoir_layer != NULL);
    assert(_lsm_output_layer != NULL);

    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout);

    if(train == true) _lsm_output_layer->LSMRemoveTeacherSignal((*_sp_iter)->Class());

    LoadSpeeches(*_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout, train);
    return (*_sp_iter)->Index();
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x14(%rsp)
cmpq $0x0, 0x268(%rdi)
je 0xc5ff
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xc61e
cmpq $0x0, 0x2a8(%rbx)
je 0xc63d
movl %esi, %ebp
pushq $0x3
popq %rax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x8(%rsp), %r8
movl %eax, (%r8)
leaq 0x14(%rsp), %rsi
callq 0xd3ee
testb %bpl, %bpl
je 0xc5c5
movq 0x220(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0x8692
movq 0x220(%rbx), %rax
movq (%rax), %rsi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movzbl %bpl, %r9d
movq %rbx, %rdi
callq 0xd10c
movq 0x220(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x931d(%rip), %rdi      # 0x15923
leaq 0x8da5(%rip), %rsi      # 0x153b2
leaq 0x93d6(%rip), %rcx      # 0x159ea
movl $0x233, %edx            # imm = 0x233
callq 0x31b0
leaq 0x9334(%rip), %rdi      # 0x15959
leaq 0x8d86(%rip), %rsi      # 0x153b2
leaq 0x93b7(%rip), %rcx      # 0x159ea
movl $0x234, %edx            # imm = 0x234
callq 0x31b0
leaq 0x9332(%rip), %rdi      # 0x15976
leaq 0x8d67(%rip), %rsi      # 0x153b2
leaq 0x9398(%rip), %rcx      # 0x159ea
movl $0x235, %edx            # imm = 0x235
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadNextSpeech(bool, networkmode_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Network::LoadNextSpeech(bool train, networkmode_t networkmode, const string sample_type){
    assert(_lsm_input_layer != NULL);
    assert(_lsm_reservoir_layer != NULL);
    assert(_lsm_output_layer != NULL);

    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout);

    if(train == true) _lsm_output_layer->LSMRemoveTeacherSignal((*_sp_iter)->Class());
    _sp_iter++;

    auto sp_end_ptr = _speeches.end();
    
    if(_sp_iter != sp_end_ptr){
        LoadSpeeches(*_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout, train);
        return (*_sp_iter)->Index();
    }else{
        LSMNetworkRemoveSpeech();
        return -1;
    }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edx, 0x14(%rsp)
cmpq $0x0, 0x268(%rdi)
je 0xc734
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xc753
cmpq $0x0, 0x2a8(%rbx)
je 0xc772
movl %esi, %ebp
pushq $0x3
popq %rax
leaq 0x10(%rsp), %rdx
movl %eax, (%rdx)
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x8(%rsp), %r8
movl %eax, (%r8)
leaq 0x14(%rsp), %rsi
callq 0xd3ee
testb %bpl, %bpl
je 0xc6d9
movq 0x220(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0x8692
movq 0x220(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x220(%rbx)
cmpq 0x210(%rbx), %rax
je 0xc722
movq (%rax), %rsi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movzbl %bpl, %r9d
movq %rbx, %rdi
callq 0xd10c
movq 0x220(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xc72d
movq %rbx, %rdi
callq 0xd260
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x91e8(%rip), %rdi      # 0x15923
leaq 0x8c70(%rip), %rsi      # 0x153b2
leaq 0x9262(%rip), %rcx      # 0x159ab
movl $0x21c, %edx            # imm = 0x21C
callq 0x31b0
leaq 0x91ff(%rip), %rdi      # 0x15959
leaq 0x8c51(%rip), %rsi      # 0x153b2
leaq 0x9243(%rip), %rcx      # 0x159ab
movl $0x21d, %edx            # imm = 0x21D
callq 0x31b0
leaq 0x91fd(%rip), %rdi      # 0x15976
leaq 0x8c32(%rip), %rsi      # 0x153b2
leaq 0x9224(%rip), %rcx      # 0x159ab
movl $0x21e, %edx            # imm = 0x21E
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadFirstSpeechTrainCV(networkmode_t)
int Network::LoadFirstSpeechTrainCV(networkmode_t networkmode){
    assert((_fold_ind>=0)&&(_fold_ind<_fold));

    LSMLoadLayers();
    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout);


    if(_fold_ind == 0) _train_fold_ind = 1;
    else _train_fold_ind = 0;
    assert(!_CVspeeches.empty());
    _cv_train_sp_iter = _CVspeeches[_train_fold_ind].begin();
    if(_cv_train_sp_iter != _CVspeeches[_train_fold_ind].end()){
        LoadSpeeches(*_cv_train_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout,true); 
        return (*_cv_train_sp_iter)->Index();
    }else{
        cout<<"Warning, no training speech is specified!!"<<endl;
        _sp = NULL;
        return -1;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
movl 0x22c(%rdi), %eax
testl %eax, %eax
js 0xca76
movq %rdi, %rbx
cmpl 0x228(%rdi), %eax
jge 0xca76
movq %rbx, %rdi
callq 0xd2ea
pushq $0x3
popq %rax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rsp, %r8
movl %eax, (%r8)
leaq 0xc(%rsp), %rsi
callq 0xd3ee
movl 0x22c(%rbx), %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
movl %eax, 0x230(%rbx)
movq 0x238(%rbx), %rax
cmpq 0x240(%rbx), %rax
je 0xca95
xorl %edx, %edx
testl %ecx, %ecx
sete %dl
imulq $0x18, %rdx, %rdx
movq (%rax,%rdx), %rcx
movq %rcx, 0x250(%rbx)
cmpq 0x8(%rax,%rdx), %rcx
je 0xca4a
movq (%rcx), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
pushq $0x1
popq %r9
movq %rbx, %rdi
callq 0xd10c
movq 0x250(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xca70
movq 0x13577(%rip), %rdi     # 0x1ffc8
leaq 0x903c(%rip), %rsi      # 0x15a94
callq 0x32a0
movq %rax, %rdi
callq 0x3160
andq $0x0, 0x260(%rbx)
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x8fad(%rip), %rdi      # 0x15a2a
leaq 0x892e(%rip), %rsi      # 0x153b2
leaq 0x8fc1(%rip), %rcx      # 0x15a4c
movl $0x243, %edx            # imm = 0x243
callq 0x31b0
leaq 0x8fe3(%rip), %rdi      # 0x15a7f
leaq 0x890f(%rip), %rsi      # 0x153b2
leaq 0x8fa2(%rip), %rcx      # 0x15a4c
movl $0x24d, %edx            # imm = 0x24D
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadFirstSpeechTestCV(networkmode_t)
int Network::LoadFirstSpeechTestCV(networkmode_t networkmode){
    assert((_fold_ind>=0)&&(_fold_ind<_fold));

    LSMLoadLayers();
    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout); 


    assert(!_CVspeeches.empty());
    _cv_test_sp_iter = _CVspeeches[_fold_ind].begin();
    if(_cv_test_sp_iter != _CVspeeches[_fold_ind].end()){
        LoadSpeeches(*_cv_test_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout, false);
        return (*_cv_test_sp_iter)->Index();
    }else{
        _sp = NULL;
        return -1;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
movl 0x22c(%rdi), %eax
testl %eax, %eax
js 0xcd37
movq %rdi, %rbx
cmpl 0x228(%rdi), %eax
jge 0xcd37
movq %rbx, %rdi
callq 0xd2ea
pushq $0x3
popq %rax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rsp, %r8
movl %eax, (%r8)
leaq 0xc(%rsp), %rsi
callq 0xd3ee
movq 0x238(%rbx), %rax
cmpq 0x240(%rbx), %rax
je 0xcd56
movslq 0x22c(%rbx), %rcx
imulq $0x18, %rcx, %rdx
movq (%rax,%rdx), %rcx
movq %rcx, 0x258(%rbx)
cmpq 0x8(%rax,%rdx), %rcx
je 0xcd26
movq (%rcx), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xd10c
movq 0x258(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xcd31
andq $0x0, 0x260(%rbx)
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x8cec(%rip), %rdi      # 0x15a2a
leaq 0x866d(%rip), %rsi      # 0x153b2
leaq 0x8da5(%rip), %rcx      # 0x15af1
movl $0x27d, %edx            # imm = 0x27D
callq 0x31b0
leaq 0x8d22(%rip), %rdi      # 0x15a7f
leaq 0x864e(%rip), %rsi      # 0x153b2
leaq 0x8d86(%rip), %rcx      # 0x15af1
movl $0x285, %edx            # imm = 0x285
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::ReadoutJudge(std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>&)
void Network::ReadoutJudge(vector<pair<int, int> >& correct, vector<pair<int, int> >& wrong, vector<pair<int, int> >& even){
    pair<int, int> res = this->LSMJudge(); // +/- 1, true cls

    if(res.first == 1) correct.push_back(res);
    else if(res.first == -1) wrong.push_back(res);
    else if(res.first == 0) even.push_back(res);
    else{
        cout<<"In Network::ReadoutJudge(vector<pair<int, int> >&, vector<pair<int, int> >&, vector<pair<int, int> >&)\n"
            <<"Undefined return type: "<<res.first<<" returned by Network::LSMJudge()"
            <<endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r14
callq 0xd5dc
movq %rax, %rbx
movq %rax, (%rsp)
cmpl $-0x1, %ebx
je 0xcdb1
testl %ebx, %ebx
je 0xcda9
cmpl $0x1, %ebx
jne 0xcdc8
movq %rsp, %rsi
movq %r14, %rdi
jmp 0xcdb7
movq %rsp, %rsi
movq %r15, %rdi
jmp 0xcdb7
movq %rsp, %rsi
movq %r12, %rdi
callq 0xe99c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x131f9(%rip), %rdi     # 0x1ffc8
leaq 0x8e0a(%rip), %rsi      # 0x15be0
callq 0x32a0
leaq 0x8e66(%rip), %rsi      # 0x15c48
movq %rax, %rdi
callq 0x32a0
movq %rax, %rdi
movl %ebx, %esi
callq 0x3530
leaq 0x8e65(%rip), %rsi      # 0x15c60
movq %rax, %rdi
callq 0x32a0
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3160
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadNextSpeechTestCV(networkmode_t)
int Network::LoadNextSpeechTestCV(networkmode_t networkmode){
    assert(_lsm_input_layer != NULL);
    assert(_lsm_reservoir_layer != NULL);
    assert(_lsm_output_layer != NULL);

    neuronmode_t neuronmode_input = NORMAL, neuronmode_reservoir = NORMAL, neuronmode_readout = NORMAL;
    // determine the neuron mode by the network mode:
    DetermineNetworkNeuronMode(networkmode, neuronmode_input, neuronmode_reservoir, neuronmode_readout);

    _cv_test_sp_iter++;
    assert(!_CVspeeches.empty());
    if(_cv_test_sp_iter != _CVspeeches[_fold_ind].end()){
        LoadSpeeches(*_cv_test_sp_iter, neuronmode_input, neuronmode_reservoir, neuronmode_readout, false);
        return (*_cv_test_sp_iter)->Index();
    }else{
        LSMNetworkRemoveSpeech();
        return -1;
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
cmpq $0x0, 0x268(%rdi)
je 0xcee2
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xcf01
cmpq $0x0, 0x2a8(%rbx)
je 0xcf20
pushq $0x3
popq %rax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rsp, %r8
movl %eax, (%r8)
leaq 0xc(%rsp), %rsi
callq 0xd3ee
movq 0x238(%rbx), %rcx
movq 0x258(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x258(%rbx)
cmpq 0x240(%rbx), %rcx
je 0xcf3f
movslq 0x22c(%rbx), %rdx
imulq $0x18, %rdx, %rdx
cmpq 0x8(%rcx,%rdx), %rax
je 0xced1
movq (%rax), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xd10c
movq 0x258(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xcedc
movq %rbx, %rdi
callq 0xd260
pushq $-0x1
popq %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x8a3a(%rip), %rdi      # 0x15923
leaq 0x84c2(%rip), %rsi      # 0x153b2
leaq 0x8c2c(%rip), %rcx      # 0x15b23
movl $0x291, %edx            # imm = 0x291
callq 0x31b0
leaq 0x8a51(%rip), %rdi      # 0x15959
leaq 0x84a3(%rip), %rsi      # 0x153b2
leaq 0x8c0d(%rip), %rcx      # 0x15b23
movl $0x292, %edx            # imm = 0x292
callq 0x31b0
leaq 0x8a4f(%rip), %rdi      # 0x15976
leaq 0x8484(%rip), %rsi      # 0x153b2
leaq 0x8bee(%rip), %rcx      # 0x15b23
movl $0x293, %edx            # imm = 0x293
callq 0x31b0
leaq 0x8b39(%rip), %rdi      # 0x15a7f
leaq 0x8465(%rip), %rsi      # 0x153b2
leaq 0x8bcf(%rip), %rcx      # 0x15b23
movl $0x29a, %edx            # imm = 0x29A
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMPushResults(std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>> const&, int)
void Network::LSMPushResults(const vector<pair<int, int> >& correct, const vector<pair<int, int> >& wrong, const vector<pair<int, int> >& even, int iter_n){
    assert(iter_n < _readout_correct.size());
    _readout_correct[iter_n] += correct.size();
    _readout_wrong[iter_n] += wrong.size();
    _readout_even[iter_n] += even.size();

    for(auto & p : correct){
        assert(p.second < _readout_correct_breakdown[iter_n].size());
        _readout_correct_breakdown[iter_n][p.second]++;
    }
}

//* log the test error into the corresponding vector:
//* test error defined: \sum_j 1/2*(o_j - y_j)^2, where o_j = spike_j /max_k(spike_k)
void Network::LogTestError(const vector<double>& each_sample_errors, int iter_n){
    assert(iter_n < _readout_test_error.size());
    double error_sum = 0;
    for(double e : each_sample_errors)  error_sum += e;
    _readout_test_error[iter_n] = error_sum;
}

//* merge the readout results from the network
void Network::MergeReadoutResults(vector<int>& r_correct, vector<int>& r_wrong, vector<int>& r_even, vector<vector<int> >& r_correct_bd){
    assert(!r_correct.empty() &&
            r_correct.size() == _readout_correct.size() &&
            r_wrong.size() == _readout_wrong.size() &&
            r_even.size() == _readout_even.size() &&
            _readout_correct.size() == _readout_wrong.size() &&
            _readout_correct.size() == _readout_correct_breakdown.size());

    for(size_t i = 0; i < r_correct.size(); ++i){
        r_correct[i] += _readout_correct[i];
        r_wrong[i] += _readout_wrong[i];
        r_even[i] += _readout_even[i];
        r_correct_bd[i] = r_correct_bd[i] + _readout_correct_breakdown[i];  
    }

}

// Assembly:
pushq %rax
movslq %r8d, %r8
movq 0x190(%rdi), %r9
movq 0x198(%rdi), %rax
subq %r9, %rax
sarq $0x2, %rax
cmpq %r8, %rax
jbe 0xd012
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
movq %rsi, %r10
subq %rax, %r10
shrq $0x3, %r10
addl %r10d, (%r9,%r8,4)
movq 0x8(%rdx), %r9
subq (%rdx), %r9
shrq $0x3, %r9
movq 0x1a8(%rdi), %rdx
addl %r9d, (%rdx,%r8,4)
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
shrq $0x3, %rdx
movq 0x1c0(%rdi), %rcx
addl %edx, (%rcx,%r8,4)
imulq $0x18, %r8, %rcx
addq 0x1d8(%rdi), %rcx
cmpq %rsi, %rax
je 0xcff1
movslq 0x4(%rax), %rdx
movq (%rcx), %rdi
movq 0x8(%rcx), %r8
subq %rdi, %r8
sarq $0x2, %r8
cmpq %rdx, %r8
jbe 0xcff3
incl (%rdi,%rdx,4)
addq $0x8, %rax
jmp 0xcfcc
popq %rax
retq
leaq 0x8d96(%rip), %rdi      # 0x15d90
leaq 0x83b1(%rip), %rsi      # 0x153b2
leaq 0x8d06(%rip), %rcx      # 0x15d0e
movl $0x350, %edx            # imm = 0x350
callq 0x31b0
leaq 0x8cd4(%rip), %rdi      # 0x15ced
leaq 0x8392(%rip), %rsi      # 0x153b2
leaq 0x8ce7(%rip), %rcx      # 0x15d0e
movl $0x34a, %edx            # imm = 0x34A
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadSpeeches(Speech*, neuronmode_t, neuronmode_t, neuronmode_t, bool)
void Network::LoadSpeeches(Speech      * sp,
        neuronmode_t neuronmode_input,
        neuronmode_t neuronmode_reservoir,
        neuronmode_t neuronmode_readout,
        bool train
        )
{
    // assign the speech ptr here!
    assert(sp);
    _sp = sp;

    assert(_lsm_input_layer);
    _lsm_input_layer->LSMLoadSpeech(sp,&_lsm_input,neuronmode_input,INPUTCHANNEL);

    assert(_lsm_reservoir_layer);
    _lsm_reservoir_layer->LSMLoadSpeech(sp,&_lsm_reservoir,neuronmode_reservoir,RESERVOIRCHANNEL);
    
    // just set the neuron mode of the output neurons
    assert(_lsm_output_layer);
    _lsm_output_layer->LSMSetNeurons(neuronmode_readout);

    // if train the readout
    if(train == true){
        if(neuronmode_readout == NORMAL){ // original Yong's rule
            _lsm_output_layer->LSMSetTeacherSignal(sp->Class());
        }     
        else	  
			assert(0);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0xd1c5
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x260(%rdi)
movq 0x268(%rdi), %rdi
testq %rdi, %rdi
je 0xd1e4
movl %r9d, %r15d
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %ecx
leaq 0x2b0(%r14), %rdx
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x7ac2
movq 0x270(%r14), %rdi
testq %rdi, %rdi
je 0xd203
leaq 0x2b4(%r14), %rdx
pushq $0x1
popq %r8
movq %rbx, %rsi
movl %r12d, %ecx
callq 0x7ac2
movq 0x2a8(%r14), %rdi
testq %rdi, %rdi
je 0xd222
movl %ebp, %esi
callq 0x7ca4
testb %r15b, %r15b
je 0xd1bc
cmpl $0x3, %ebp
jne 0xd241
movq 0x2a8(%r14), %rdi
movl 0x80(%rbx), %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8630
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8ad9(%rip), %rdi      # 0x15ca5
leaq 0x81df(%rip), %rsi      # 0x153b2
leaq 0x864a(%rip), %rcx      # 0x15824
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x31b0
leaq 0x868e(%rip), %rdi      # 0x15879
leaq 0x81c0(%rip), %rsi      # 0x153b2
leaq 0x862b(%rip), %rcx      # 0x15824
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x31b0
leaq 0x8680(%rip), %rdi      # 0x1588a
leaq 0x81a1(%rip), %rsi      # 0x153b2
leaq 0x860c(%rip), %rcx      # 0x15824
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x31b0
leaq 0x868a(%rip), %rdi      # 0x158b3
leaq 0x8182(%rip), %rsi      # 0x153b2
leaq 0x85ed(%rip), %rcx      # 0x15824
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x31b0
leaq 0x8168(%rip), %rdi      # 0x153b0
leaq 0x8163(%rip), %rsi      # 0x153b2
leaq 0x85ce(%rip), %rcx      # 0x15824
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMNetworkRemoveSpeech()
void Network::LSMNetworkRemoveSpeech(){
    _sp = NULL;
    assert(_lsm_input_layer || _lsm_output_layer);

    if(_lsm_input_layer)
        _lsm_input_layer->LSMRemoveSpeech();
    _lsm_input_layer = NULL;

    if(_lsm_output_layer)
        _lsm_output_layer->LSMRemoveSpeech();
    _lsm_output_layer = NULL;

    if(_lsm_reservoir_layer == NULL)
        _lsm_reservoir_layer->LSMRemoveSpeech();

    _lsm_reservoir_layer = NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x260(%rdi)
movq 0x268(%rdi), %rax
movq 0x2a8(%rdi), %rdi
movq %rax, %rcx
orq %rdi, %rcx
je 0xd2cb
testq %rax, %rax
je 0xd296
movq %rax, %rdi
callq 0x85a0
movq 0x2a8(%rbx), %rdi
andq $0x0, 0x268(%rbx)
testq %rdi, %rdi
je 0xd2a8
callq 0x85a0
andq $0x0, 0x2a8(%rbx)
cmpq $0x0, 0x270(%rbx)
jne 0xd2c1
xorl %edi, %edi
callq 0x85a0
andq $0x0, 0x270(%rbx)
popq %rbx
retq
leaq 0x85cd(%rip), %rdi      # 0x1589f
leaq 0x80d9(%rip), %rsi      # 0x153b2
leaq 0x85e5(%rip), %rcx      # 0x158c5
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LSMLoadLayers()
void Network::LSMLoadLayers(){
    assert(_lsm_input_layer == NULL);
    _lsm_input_layer = SearchForNeuronGroup("input");
    assert(_lsm_input_layer != NULL);

    assert(_lsm_reservoir_layer == NULL);
    _lsm_reservoir_layer = SearchForNeuronGroup("reservoir");
    assert(_lsm_reservoir_layer != NULL);

    _lsm_output_layer = SearchForNeuronGroup("output");
    assert(_lsm_output_layer != NULL);
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x268(%rdi)
jne 0xd352
movq %rdi, %rbx
leaq 0x6fc5(%rip), %rsi      # 0x142c4
callq 0xbcc0
movq %rax, 0x268(%rbx)
testq %rax, %rax
je 0xd371
cmpq $0x0, 0x270(%rbx)
jne 0xd390
leaq 0x6fd8(%rip), %rsi      # 0x142f9
movq %rbx, %rdi
callq 0xbcc0
movq %rax, 0x270(%rbx)
testq %rax, %rax
je 0xd3af
leaq 0x812e(%rip), %rsi      # 0x1546a
movq %rbx, %rdi
callq 0xbcc0
movq %rax, 0x2a8(%rbx)
testq %rax, %rax
je 0xd3ce
popq %rbx
retq
leaq 0x8593(%rip), %rdi      # 0x158ec
leaq 0x8052(%rip), %rsi      # 0x153b2
leaq 0x859e(%rip), %rcx      # 0x15905
movl $0x1e9, %edx            # imm = 0x1E9
callq 0x31b0
leaq 0x85ab(%rip), %rdi      # 0x15923
leaq 0x8033(%rip), %rsi      # 0x153b2
leaq 0x857f(%rip), %rcx      # 0x15905
movl $0x1eb, %edx            # imm = 0x1EB
callq 0x31b0
leaq 0x85a5(%rip), %rdi      # 0x1593c
leaq 0x8014(%rip), %rsi      # 0x153b2
leaq 0x8560(%rip), %rcx      # 0x15905
movl $0x1ed, %edx            # imm = 0x1ED
callq 0x31b0
leaq 0x85a3(%rip), %rdi      # 0x15959
leaq 0x7ff5(%rip), %rsi      # 0x153b2
leaq 0x8541(%rip), %rcx      # 0x15905
movl $0x1ef, %edx            # imm = 0x1EF
callq 0x31b0
leaq 0x85a1(%rip), %rdi      # 0x15976
leaq 0x7fd6(%rip), %rsi      # 0x153b2
leaq 0x8522(%rip), %rcx      # 0x15905
movl $0x1f2, %edx            # imm = 0x1F2
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::DetermineNetworkNeuronMode(networkmode_t const&, neuronmode_t&, neuronmode_t&, neuronmode_t&)
void Network::DetermineNetworkNeuronMode(const networkmode_t & networkmode, neuronmode_t & neuronmode_input, neuronmode_t & neuronmode_reservoir, neuronmode_t & neuronmode_readout){
    if(networkmode == TRANSIENTSTATE){
        neuronmode_input = READCHANNEL;
        neuronmode_reservoir = WRITECHANNEL;
        neuronmode_readout = DEACTIVATED;
    }else if(networkmode == READOUT){
        neuronmode_input = DEACTIVATED;
        neuronmode_reservoir = READCHANNEL;
        neuronmode_readout = NORMAL;
    }else{
        cout<<"Unrecognized network mode!"<<endl;
        exit(EXIT_FAILURE);
    }

}

// Assembly:
movl (%rsi), %eax
testl %eax, %eax
je 0xd403
cmpl $0x1, %eax
jne 0xd411
pushq $0x3
popq %rax
pushq $0x1
popq %rsi
xorl %edi, %edi
jmp 0xd409
pushq $0x2
popq %rsi
pushq $0x1
popq %rdi
movl %edi, (%rdx)
movl %esi, (%rcx)
movl %eax, (%r8)
retq
pushq %rax
movq 0x12baf(%rip), %rdi     # 0x1ffc8
leaq 0x8570(%rip), %rsi      # 0x15990
callq 0x32a0
movq %rax, %rdi
callq 0x3160
pushq $0x1
popq %rdi
callq 0x3330
nop