LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 $0x18, %rsp
movq %r9, %r12
movl %r8d, %r13d
movl %ecx, 0xc(%rsp)
movl %edx, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movl %esi, 0x2bc(%rdi)
addq $0x178, %rdi            # imm = 0x178
callq 0x113e8
leaq 0x88(%r15), %rbx
movq 0x88(%r15), %r14
cmpq %rbx, %r14
je 0xe40b
movq %r15, 0x10(%rsp)
movzbl 0x8(%rsp), %r15d
movq 0x10(%r14), %rdi
movq (%rdi), %rax
movl %ebp, %esi
movq %r12, %rdx
movl %r15d, %ecx
movl %r13d, %r8d
callq *(%rax)
movq (%r14), %r14
cmpq %rbx, %r14
jne 0xe3e7
movq (%rbx), %r14
movq 0x10(%rsp), %r15
cmpq %rbx, %r14
movl 0x8(%rsp), %r12d
je 0xe426
movq 0x10(%r14), %rdi
callq 0x71f2
movq (%r14), %r14
cmpq %rbx, %r14
jne 0xe415
testb %r12b, %r12b
je 0xe479
cmpl $0x1, 0x2c0(%r15)
jne 0xe479
movq 0x160(%r15), %rbx
addq $0x160, %r15            # imm = 0x160
cmpq %r15, %rbx
movl 0xc(%rsp), %r14d
je 0xe463
movq 0x10(%rbx), %rdi
movl %ebp, %esi
movl %r14d, %edx
callq 0xc082
movq (%rbx), %rbx
cmpq %r15, %rbx
jne 0xe44d
movq %r15, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x113e8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x88(%rdi), %r15
cmpq %r14, %r15
je 0xe991
movq 0x10(%r15), %rdi
callq 0x711a
movq (%r15), %r15
jmp 0xe97e
leaq 0x100(%rbx), %r14
movq 0x100(%rbx), %r15
cmpq %r14, %r15
je 0xe9b2
movq 0x10(%r15), %rdi
callq 0xc1ca
movq (%r15), %r15
jmp 0xe99f
leaq 0x160(%rbx), %rdi
callq 0x113e8
leaq 0x178(%rbx), %rdi
callq 0x113e8
movq $0x0, 0x260(%rbx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xea95
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xeab4
cmpq $0x0, 0x2a8(%rbx)
je 0xead3
movl %esi, %ebp
movl $0x3, %eax
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 0xf9bc
testb %bpl, %bpl
je 0xea5b
movq 0x220(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0xa12c
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 0xf6cc
movq 0x220(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x9ea7(%rip), %rdi      # 0x18943
leaq 0x992f(%rip), %rsi      # 0x183d2
leaq 0x9f60(%rip), %rcx      # 0x18a0a
movl $0x233, %edx            # imm = 0x233
callq 0x31b0
leaq 0x9ebe(%rip), %rdi      # 0x18979
leaq 0x9910(%rip), %rsi      # 0x183d2
leaq 0x9f41(%rip), %rcx      # 0x18a0a
movl $0x234, %edx            # imm = 0x234
callq 0x31b0
leaq 0x9ebc(%rip), %rdi      # 0x18996
leaq 0x98f1(%rip), %rsi      # 0x183d2
leaq 0x9f22(%rip), %rcx      # 0x18a0a
movl $0x235, %edx            # imm = 0x235
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0xebce
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xebed
cmpq $0x0, 0x2a8(%rbx)
je 0xec0c
movl %esi, %ebp
movl $0x3, %eax
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 0xf9bc
testb %bpl, %bpl
je 0xeb71
movq 0x220(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0xa12c
movq 0x220(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x220(%rbx)
cmpq 0x210(%rbx), %rax
je 0xebba
movq (%rax), %rsi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movzbl %bpl, %r9d
movq %rbx, %rdi
callq 0xf6cc
movq 0x220(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xebc7
movq %rbx, %rdi
callq 0xf822
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x9d6e(%rip), %rdi      # 0x18943
leaq 0x97f6(%rip), %rsi      # 0x183d2
leaq 0x9de8(%rip), %rcx      # 0x189cb
movl $0x21c, %edx            # imm = 0x21C
callq 0x31b0
leaq 0x9d85(%rip), %rdi      # 0x18979
leaq 0x97d7(%rip), %rsi      # 0x183d2
leaq 0x9dc9(%rip), %rcx      # 0x189cb
movl $0x21d, %edx            # imm = 0x21D
callq 0x31b0
leaq 0x9d83(%rip), %rdi      # 0x18996
leaq 0x97b8(%rip), %rsi      # 0x183d2
leaq 0x9daa(%rip), %rcx      # 0x189cb
movl $0x21e, %edx            # imm = 0x21E
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, 0x14(%rsp)
movl 0x22c(%rdi), %eax
testl %eax, %eax
js 0xef7b
movq %rdi, %rbx
cmpl 0x228(%rdi), %eax
jge 0xef7b
movq %rbx, %rdi
callq 0xf8b8
movl $0x3, %eax
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 0xf9bc
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 0xef9a
xorl %edx, %edx
testl %ecx, %ecx
sete %dl
leaq (%rdx,%rdx,2), %rdx
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x250(%rbx)
cmpq 0x8(%rax,%rdx,8), %rcx
je 0xef21
movq (%rcx), %rsi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x8(%rsp), %r8d
movq %rbx, %rdi
movl $0x1, %r9d
callq 0xf6cc
movq 0x250(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xef73
movq 0x120a8(%rip), %r14     # 0x20fd0
leaq 0x9b85(%rip), %rsi      # 0x18ab4
movl $0x2a, %edx
movq %r14, %rdi
callq 0x3340
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31e0
movq $0x0, 0x260(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x9ac8(%rip), %rdi      # 0x18a4a
leaq 0x9449(%rip), %rsi      # 0x183d2
leaq 0x9adc(%rip), %rcx      # 0x18a6c
movl $0x243, %edx            # imm = 0x243
callq 0x31b0
leaq 0x9afe(%rip), %rdi      # 0x18a9f
leaq 0x942a(%rip), %rsi      # 0x183d2
leaq 0x9abd(%rip), %rcx      # 0x18a6c
movl $0x24d, %edx            # imm = 0x24D
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xf24a
movq %rdi, %rbx
cmpl 0x228(%rdi), %eax
jge 0xf24a
movq %rbx, %rdi
callq 0xf8b8
movl $0x3, %eax
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 0xf9bc
movq 0x238(%rbx), %rax
cmpq 0x240(%rbx), %rax
je 0xf269
movslq 0x22c(%rbx), %rcx
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x258(%rbx)
cmpq 0x8(%rax,%rdx,8), %rcx
je 0xf234
movq (%rcx), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xf6cc
movq 0x258(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xf244
movq $0x0, 0x260(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
leaq 0x97f9(%rip), %rdi      # 0x18a4a
leaq 0x917a(%rip), %rsi      # 0x183d2
leaq 0x98b2(%rip), %rcx      # 0x18b11
movl $0x27d, %edx            # imm = 0x27D
callq 0x31b0
leaq 0x982f(%rip), %rdi      # 0x18a9f
leaq 0x915b(%rip), %rsi      # 0x183d2
leaq 0x9893(%rip), %rcx      # 0x18b11
movl $0x285, %edx            # imm = 0x285
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0xfc3e
movq %rax, %rbx
movq %rax, (%rsp)
cmpl $-0x1, %ebx
je 0xf2e9
testl %ebx, %ebx
je 0xf2ce
cmpl $0x1, %ebx
jne 0xf307
movq 0x8(%r14), %rsi
cmpq 0x10(%r14), %rsi
je 0xf399
movq %rbx, (%rsi)
addq $0x8, 0x8(%r14)
jmp 0xf3a4
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0xf389
movq %rbx, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0xf3a4
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0xf391
movq %rbx, (%rsi)
addq $0x8, 0x8(%r12)
jmp 0xf3a4
movq 0x11cc2(%rip), %r14     # 0x20fd0
leaq 0x98eb(%rip), %rsi      # 0x18c00
movl $0x67, %edx
movq %r14, %rdi
callq 0x3340
leaq 0x993f(%rip), %rsi      # 0x18c68
movl $0x17, %edx
movq %r14, %rdi
callq 0x3340
movq %r14, %rdi
movl %ebx, %esi
callq 0x3560
movq %rax, %rbx
leaq 0x9936(%rip), %rsi      # 0x18c80
movl $0x20, %edx
movq %rax, %rdi
callq 0x3340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x31e0
movq %rsp, %rdx
movq %r15, %rdi
jmp 0xf39f
movq %rsp, %rdx
movq %r12, %rdi
jmp 0xf39f
movq %rsp, %rdx
movq %r14, %rdi
callq 0x120be
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf480
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xf49f
cmpq $0x0, 0x2a8(%rbx)
je 0xf4be
movl $0x3, %eax
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 0xf9bc
movq 0x238(%rbx), %rcx
movq 0x258(%rbx), %rax
addq $0x8, %rax
movq %rax, 0x258(%rbx)
cmpq 0x240(%rbx), %rcx
je 0xf4dd
movslq 0x22c(%rbx), %rdx
leaq (%rdx,%rdx,2), %rdx
cmpq 0x8(%rcx,%rdx,8), %rax
je 0xf46d
movq (%rax), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
xorl %r9d, %r9d
callq 0xf6cc
movq 0x258(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
jmp 0xf47a
movq %rbx, %rdi
callq 0xf822
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
retq
leaq 0x94bc(%rip), %rdi      # 0x18943
leaq 0x8f44(%rip), %rsi      # 0x183d2
leaq 0x96ae(%rip), %rcx      # 0x18b43
movl $0x291, %edx            # imm = 0x291
callq 0x31b0
leaq 0x94d3(%rip), %rdi      # 0x18979
leaq 0x8f25(%rip), %rsi      # 0x183d2
leaq 0x968f(%rip), %rcx      # 0x18b43
movl $0x292, %edx            # imm = 0x292
callq 0x31b0
leaq 0x94d1(%rip), %rdi      # 0x18996
leaq 0x8f06(%rip), %rsi      # 0x183d2
leaq 0x9670(%rip), %rcx      # 0x18b43
movl $0x293, %edx            # imm = 0x293
callq 0x31b0
leaq 0x95bb(%rip), %rdi      # 0x18a9f
leaq 0x8ee7(%rip), %rsi      # 0x183d2
leaq 0x9651(%rip), %rcx      # 0x18b43
movl $0x29a, %edx            # imm = 0x29A
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0xf5b5
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)
cmpq %rax, %rsi
je 0xf594
movq 0x1d8(%rdi), %rdx
leaq (%r8,%r8,2), %rdi
movq (%rdx,%rdi,8), %rcx
movq 0x8(%rdx,%rdi,8), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
movslq 0x4(%rax), %rdi
cmpq %rdi, %rdx
jbe 0xf596
incl (%rcx,%rdi,4)
addq $0x8, %rax
cmpq %rsi, %rax
jne 0xf57f
popq %rax
retq
leaq 0x9813(%rip), %rdi      # 0x18db0
leaq 0x8e2e(%rip), %rsi      # 0x183d2
leaq 0x9783(%rip), %rcx      # 0x18d2e
movl $0x350, %edx            # imm = 0x350
callq 0x31b0
leaq 0x9751(%rip), %rdi      # 0x18d0d
leaq 0x8e0f(%rip), %rsi      # 0x183d2
leaq 0x9764(%rip), %rcx      # 0x18d2e
movl $0x34a, %edx            # imm = 0x34A
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0xf787
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x260(%rdi)
movq 0x268(%rdi), %rdi
testq %rdi, %rdi
je 0xf7a6
movl %r9d, %r15d
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %ecx
leaq 0x2b0(%r14), %rdx
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x9210
movq 0x270(%r14), %rdi
testq %rdi, %rdi
je 0xf7c5
leaq 0x2b4(%r14), %rdx
movq %rbx, %rsi
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x9210
movq 0x2a8(%r14), %rdi
testq %rdi, %rdi
je 0xf7e4
movl %ebp, %esi
callq 0x9474
testb %r15b, %r15b
je 0xf77e
cmpl $0x3, %ebp
jne 0xf803
movq 0x2a8(%r14), %rdi
movl 0x80(%rbx), %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa0ca
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9537(%rip), %rdi      # 0x18cc5
leaq 0x8c3d(%rip), %rsi      # 0x183d2
leaq 0x90a8(%rip), %rcx      # 0x18844
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x31b0
leaq 0x90ec(%rip), %rdi      # 0x18899
leaq 0x8c1e(%rip), %rsi      # 0x183d2
leaq 0x9089(%rip), %rcx      # 0x18844
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x31b0
leaq 0x90de(%rip), %rdi      # 0x188aa
leaq 0x8bff(%rip), %rsi      # 0x183d2
leaq 0x906a(%rip), %rcx      # 0x18844
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x31b0
leaq 0x90e8(%rip), %rdi      # 0x188d3
leaq 0x8be0(%rip), %rsi      # 0x183d2
leaq 0x904b(%rip), %rcx      # 0x18844
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x31b0
leaq 0x8bc6(%rip), %rdi      # 0x183d0
leaq 0x8bc1(%rip), %rsi      # 0x183d2
leaq 0x902c(%rip), %rcx      # 0x18844
movl $0x1cf, %edx            # imm = 0x1CF
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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
movq $0x0, 0x260(%rdi)
movq 0x268(%rdi), %rax
movq 0x2a8(%rdi), %rdi
movq %rax, %rcx
orq %rdi, %rcx
je 0xf899
testq %rax, %rax
je 0xf85b
movq %rax, %rdi
callq 0xa030
movq 0x2a8(%rbx), %rdi
movq $0x0, 0x268(%rbx)
testq %rdi, %rdi
je 0xf870
callq 0xa030
movq $0x0, 0x2a8(%rbx)
cmpq $0x0, 0x270(%rbx)
jne 0xf88c
xorl %edi, %edi
callq 0xa030
movq $0x0, 0x270(%rbx)
popq %rbx
retq
leaq 0x901f(%rip), %rdi      # 0x188bf
leaq 0x8b2b(%rip), %rsi      # 0x183d2
leaq 0x9037(%rip), %rcx      # 0x188e5
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0xf920
movq %rdi, %rbx
leaq 0x7a17(%rip), %rsi      # 0x172e4
callq 0xdc86
movq %rax, 0x268(%rbx)
testq %rax, %rax
je 0xf93f
cmpq $0x0, 0x270(%rbx)
jne 0xf95e
leaq 0x7a2a(%rip), %rsi      # 0x17319
movq %rbx, %rdi
callq 0xdc86
movq %rax, 0x270(%rbx)
testq %rax, %rax
je 0xf97d
leaq 0x8b80(%rip), %rsi      # 0x1848a
movq %rbx, %rdi
callq 0xdc86
movq %rax, 0x2a8(%rbx)
testq %rax, %rax
je 0xf99c
popq %rbx
retq
leaq 0x8fe5(%rip), %rdi      # 0x1890c
leaq 0x8aa4(%rip), %rsi      # 0x183d2
leaq 0x8ff0(%rip), %rcx      # 0x18925
movl $0x1e9, %edx            # imm = 0x1E9
callq 0x31b0
leaq 0x8ffd(%rip), %rdi      # 0x18943
leaq 0x8a85(%rip), %rsi      # 0x183d2
leaq 0x8fd1(%rip), %rcx      # 0x18925
movl $0x1eb, %edx            # imm = 0x1EB
callq 0x31b0
leaq 0x8ff7(%rip), %rdi      # 0x1895c
leaq 0x8a66(%rip), %rsi      # 0x183d2
leaq 0x8fb2(%rip), %rcx      # 0x18925
movl $0x1ed, %edx            # imm = 0x1ED
callq 0x31b0
leaq 0x8ff5(%rip), %rdi      # 0x18979
leaq 0x8a47(%rip), %rsi      # 0x183d2
leaq 0x8f93(%rip), %rcx      # 0x18925
movl $0x1ef, %edx            # imm = 0x1EF
callq 0x31b0
leaq 0x8ff3(%rip), %rdi      # 0x18996
leaq 0x8a28(%rip), %rsi      # 0x183d2
leaq 0x8f74(%rip), %rcx      # 0x18925
movl $0x1f2, %edx            # imm = 0x1F2
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xf9d5
cmpl $0x1, %eax
jne 0xf9e7
movl $0x3, %eax
movl $0x1, %esi
xorl %edi, %edi
jmp 0xf9df
movl $0x2, %esi
movl $0x1, %edi
movl %edi, (%rdx)
movl %esi, (%rcx)
movl %eax, (%r8)
retq
pushq %rax
movq 0x115e1(%rip), %rdi     # 0x20fd0
leaq 0x8fba(%rip), %rsi      # 0x189b0
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
nop
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::PrintSpikeCount(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Network::PrintSpikeCount(string layer){
    NeuronGroup * ng = SearchForNeuronGroup(layer.c_str());
    assert(ng);
#ifdef CV
    assert(*_cv_test_sp_iter);
    ng->PrintSpikeCount((*_cv_test_sp_iter)->Class());
#else
    assert(*_sp_iter);
    ng->PrintSpikeCount((*_sp_iter)->Class());
#endif

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rsi
callq 0xdc86
testq %rax, %rax
je 0xfbff
movq 0x220(%rbx), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xfc1e
movl 0x80(%rcx), %esi
movq %rax, %rdi
popq %rbx
jmp 0x9f16
leaq 0x9b9b(%rip), %rdi      # 0x197a1
leaq 0x87c5(%rip), %rsi      # 0x183d2
leaq 0x8fbc(%rip), %rcx      # 0x18bd0
movl $0x2f7, %edx            # imm = 0x2F7
callq 0x31b0
leaq 0x8fd1(%rip), %rdi      # 0x18bf6
leaq 0x87a6(%rip), %rsi      # 0x183d2
leaq 0x8f9d(%rip), %rcx      # 0x18bd0
movl $0x2fc, %edx            # imm = 0x2FC
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::DetermineSynType(char const*, synapsetype_t&, char const*)
void Network::DetermineSynType(const char * syn_type, synapsetype_t & ret_syn_type, const char * func_name){
    if(strcmp(syn_type, "reservoir") == 0){
        // Write reservoir syns into the file
        ret_syn_type = RESERVOIR_SYN;
    }else if(strcmp(syn_type, "readout") == 0){
        ret_syn_type = READOUT_SYN;
    }else if(strcmp(syn_type, "input") == 0){
        ret_syn_type = INPUT_SYN;
    }else{
        cout<<"In Network::"<<func_name<<", undefined synapse type: "<<syn_type<<endl;
        exit(EXIT_FAILURE);
    } 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
leaq 0x6e96(%rip), %rsi      # 0x17319
movq %rbx, %rdi
callq 0x33f0
testl %eax, %eax
je 0x10504
leaq 0x94d6(%rip), %rsi      # 0x1996c
movq %rbx, %rdi
callq 0x33f0
testl %eax, %eax
je 0x10508
leaq 0x6e3b(%rip), %rsi      # 0x172e4
movq %rbx, %rdi
callq 0x33f0
movl $0x1, %ecx
testl %eax, %eax
je 0x1050d
movq 0x10b0f(%rip), %rdi     # 0x20fd0
leaq 0x8b62(%rip), %rsi      # 0x1902a
callq 0x32c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x32c0
leaq 0x8b58(%rip), %rsi      # 0x19037
movq %rax, %rdi
callq 0x32c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
xorl %ecx, %ecx
jmp 0x1050d
movl $0x2, %ecx
movl %ecx, (%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::NormalizeContinuousWeights(char const*)
void Network::NormalizeContinuousWeights(const char * syn_type){
    synapsetype_t  tar_syn_type = INVALID;
    DetermineSynType(syn_type, tar_syn_type, "NormalizeContinuousWeights()");
    assert(tar_syn_type != INVALID);
    vector<Synapse*> tmp;

    vector<Synapse*> & synapses = tar_syn_type == RESERVOIR_SYN ? _rsynapses : 
        (tar_syn_type == READOUT_SYN ? _rosynapses : tmp);
    assert(!synapses.empty()); 

    // right now the function should be run for reservoir synapses!
    double g_sum = 0.0;
    for(size_t i = 0; i < synapses.size(); ++i){
        assert(synapses[i]);
        double w = synapses[i]->Weight();
        g_sum += w*w;
    }

    // normalize the weight:
    assert(g_sum > 0);
    g_sum = sqrt(g_sum);
    for(size_t i = 0; i < synapses.size(); ++i){
        // compute the normalized weight:
        double new_w = synapses[i]->Weight()/g_sum;
        // set the new weight:
        synapses[i]->Weight(new_w);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
movl $0x3, (%r14)
leaq 0x8b1f(%rip), %rcx      # 0x19052
movq %r14, %rdx
callq 0x1046e
movl (%r14), %eax
cmpl $0x3, %eax
je 0x10641
xorl %ecx, %ecx
leaq 0x10(%rsp), %rdx
movq %rcx, (%rdx)
leaq 0x8(%rsp), %rsi
movq %rcx, (%rsi)
leaq 0x118(%rbx), %rcx
leaq 0x130(%rbx), %r14
leaq 0x120(%rbx), %rdi
addq $0x138, %rbx            # imm = 0x138
cmpl $0x2, %eax
cmovneq %rdx, %r14
cmovneq %rsi, %rbx
testl %eax, %eax
cmoveq %rcx, %r14
movq (%r14), %rax
cmoveq %rdi, %rbx
movq (%rbx), %rcx
cmpq %rcx, %rax
je 0x10660
subq %rax, %rcx
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
testq %rsi, %rsi
je 0x10622
movsd 0x38(%rsi), %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0x105ae
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1067f
jb 0x105e2
sqrtsd %xmm0, %xmm0
jmp 0x105e7
callq 0x3220
movq (%rbx), %rax
movq (%r14), %rcx
subq %rcx, %rax
je 0x1061a
sarq $0x3, %rax
cmpq $0x1, %rax
adcq $0x0, %rax
xorl %edx, %edx
movq (%rcx,%rdx,8), %rsi
movsd 0x38(%rsi), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rsi)
incq %rdx
cmpq %rdx, %rax
jne 0x10600
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x8aa7(%rip), %rdi      # 0x190d0
leaq 0x7da2(%rip), %rsi      # 0x183d2
leaq 0x8a50(%rip), %rcx      # 0x19087
movl $0x3aa, %edx            # imm = 0x3AA
callq 0x31b0
leaq 0x8a27(%rip), %rdi      # 0x1906f
leaq 0x7d83(%rip), %rsi      # 0x183d2
leaq 0x8a31(%rip), %rcx      # 0x19087
movl $0x3a0, %edx            # imm = 0x3A0
callq 0x31b0
leaq 0x8a57(%rip), %rdi      # 0x190be
leaq 0x7d64(%rip), %rsi      # 0x183d2
leaq 0x8a12(%rip), %rcx      # 0x19087
movl $0x3a5, %edx            # imm = 0x3A5
callq 0x31b0
leaq 0x8a56(%rip), %rdi      # 0x190dc
leaq 0x7d45(%rip), %rsi      # 0x183d2
leaq 0x89f3(%rip), %rcx      # 0x19087
movl $0x3b0, %edx            # imm = 0x3B0
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::RemoveZeroWeights(char const*)
void Network::RemoveZeroWeights(const char * type){
    synapsetype_t  syn_type = INVALID;
    DetermineSynType(type, syn_type, "RemoveZeroWeights()");
    assert(syn_type != INVALID);

    if(syn_type == RESERVOIR_SYN){
        NeuronGroup * reservoir = SearchForNeuronGroup("reservoir");
        reservoir->RemoveZeroSyns(syn_type);
    }
    else if(syn_type == READOUT_SYN){
        NeuronGroup * output = SearchForNeuronGroup("output");
        if(!output){
            cout<<"In Network::RemoveZeroWeights(), no 'output' layer is found!!"<<endl;
            assert(output);
        }
        output->RemoveZeroSyns(syn_type);
    }
    else{
        assert(0); // your code shoule never go here.
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %r14
movl $0x3, (%r14)
leaq 0x8a2e(%rip), %rcx      # 0x190e6
movq %r14, %rdx
callq 0x1046e
movl (%r14), %eax
testl %eax, %eax
je 0x106ea
cmpl $0x2, %eax
jne 0x1070a
leaq 0x7db7(%rip), %rsi      # 0x1848a
movq %rbx, %rdi
callq 0xdc86
testq %rax, %rax
je 0x1074d
movq %rax, %rdi
movl $0x2, %esi
jmp 0x106fe
leaq 0x6c28(%rip), %rsi      # 0x17319
movq %rbx, %rdi
callq 0xdc86
movq %rax, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa2d6
cmpl $0x3, %eax
jne 0x1072e
leaq 0x8ca4(%rip), %rdi      # 0x193ba
leaq 0x7cb5(%rip), %rsi      # 0x183d2
leaq 0x89d6(%rip), %rcx      # 0x190fa
movl $0x3be, %edx            # imm = 0x3BE
callq 0x31b0
leaq 0x7c9b(%rip), %rdi      # 0x183d0
leaq 0x7c96(%rip), %rsi      # 0x183d2
leaq 0x89b7(%rip), %rcx      # 0x190fa
movl $0x3cd, %edx            # imm = 0x3CD
callq 0x31b0
movq 0x1087c(%rip), %rdi     # 0x20fd0
leaq 0x89cd(%rip), %rsi      # 0x19128
callq 0x32c0
movq %rax, %rdi
callq 0x3160
leaq 0x7d1b(%rip), %rdi      # 0x1848a
leaq 0x7c5c(%rip), %rsi      # 0x183d2
leaq 0x897d(%rip), %rcx      # 0x190fa
movl $0x3c8, %edx            # imm = 0x3C8
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/network.C
// Function: Network::WriteSynWeightsToFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char*)
void Network::WriteSynWeightsToFile(const string& pre_g, const string& post_g, char * filename){
    NeuronGroup * pre = SearchForNeuronGroup(pre_g.c_str());
    NeuronGroup * post = SearchForNeuronGroup(post_g.c_str());
    if(pre == NULL){
        cout<<"Warning::Cannot find neuron group named: "<<pre_g
            <<" for writing the weights"<<endl;
        return;
    }
    if(post == NULL){
        cout<<"Warning::Cannot find neuron group named: "<<post_g
            <<" for writing the weights"<<endl;
        return;
    }
    ofstream f_out(filename);
    if(!f_out.is_open()){
        cout<<"WriteSynWeightsToFile(), cannot open the file : "<<filename<<endl;
        exit(EXIT_FAILURE);
    }

    int index = 0;
    pre->WriteSynWeightsToFile(f_out, index, post_g);
    f_out.close();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
movq (%rsi), %rsi
callq 0xdc86
movq %rax, %r15
movq (%rbx), %rsi
movq %r13, %rdi
callq 0xdc86
testq %r15, %r15
je 0x10b0f
testq %rax, %rax
je 0x10b38
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movl $0x10, %edx
callq 0x3320
leaq 0x80(%rsp), %rdi
callq 0x30b0
testb %al, %al
je 0x10bb0
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %rbx, %rcx
callq 0x99b6
leaq 0x10(%rsp), %rdi
callq 0x3410
movq 0x104f5(%rip), %rax     # 0x20fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x18(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x10(%rsp,%rcx)
callq 0x3240
leaq 0x108(%rsp), %rdi
callq 0x3120
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x104ba(%rip), %rbx     # 0x20fd0
leaq 0x86f5(%rip), %rsi      # 0x19212
movl $0x29, %edx
movq %rbx, %rdi
callq 0x3340
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
jmp 0x10b5d
movq 0x10491(%rip), %r14     # 0x20fd0
leaq 0x86cc(%rip), %rsi      # 0x19212
movl $0x29, %edx
movq %r14, %rdi
callq 0x3340
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x3340
movq %rax, %rbx
leaq 0x86d0(%rip), %rsi      # 0x1923c
movl $0x18, %edx
movq %rax, %rdi
callq 0x3340
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x32b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x31e0
movq 0x10419(%rip), %rdi     # 0x20fd0
leaq 0x8697(%rip), %rsi      # 0x19255
movl $0x30, %edx
callq 0x3340
movq 0x10401(%rip), %rdi     # 0x20fd0
movq %r14, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0x1, %edi
callq 0x3370
jmp 0x10beb
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3570
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/./util.h
// Function: std::vector<int, std::allocator<int>> operator+<int>(std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&)
std::vector<T> operator+(const std::vector<T>& a, const std::vector<T>& b)
{
    if(a.empty())   return b;
    if(b.empty())   return a;
    assert(a.size() == b.size());
    std::vector<T> res;
    res.reserve(a.size());
    std::transform(a.begin(), a.end(), b.begin(), std::back_inserter(res), std::plus<T>());
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
cmpq %rsi, %rax
je 0x1151d
movq (%r14), %rcx
movq 0x8(%r14), %rdx
cmpq %rdx, %rcx
je 0x1151a
subq %rax, %rsi
subq %rcx, %rdx
cmpq %rdx, %rsi
jne 0x11531
sarq $0x2, %rsi
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq 0x122bc
movq (%r15), %rdi
movq 0x8(%r15), %rsi
movq (%r14), %rdx
movq %rbx, %rcx
callq 0x12357
jmp 0x11528
movq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x11778
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x7ffb(%rip), %rdi      # 0x19533
leaq 0x8009(%rip), %rsi      # 0x19548
leaq 0x800b(%rip), %rcx      # 0x19551
movl $0x45, %edx
callq 0x31b0
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x11567
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32f0
movq %r14, %rdi
callq 0x3570
nop
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/parser.C
// Function: Parser::ParseNeuronGroup(char*, int, char*, double)
void Parser::ParseNeuronGroup(char * name, int num, char * e_i, double v_mem){
	cout<<std::string(name)<<endl;
    assert(_network->CheckExistence(name) == false);
    assert(num > 1);
    assert((strcmp(e_i,"excitatory")==0)||(strcmp(e_i,"inhibitory")==0));
    bool excitatory;
    if(strcmp(e_i,"excitatory") == 0) excitatory = true;
    else excitatory = false;
    _network->AddNeuronGroup(name, num, excitatory, v_mem);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movsd %xmm0, 0x10(%rsp)
movq %rcx, %r12
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x18(%rsp), %r13
leaq 0xf(%rsp), %rdx
movq %r13, %rdi
callq 0xa7e4
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0xe4f0(%rip), %rdi      # 0x20fd0
callq 0x3340
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
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12b2a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
movq (%r15), %rdi
movq %r14, %rsi
callq 0xcd10
testb %al, %al
jne 0x12b8f
cmpl $0x1, %ebx
jle 0x12bae
leaq 0x4ff9(%rip), %rsi      # 0x17b3e
movq %r12, %rdi
callq 0x33f0
movl %eax, %ebp
testl %eax, %eax
je 0x12b66
leaq 0x4fef(%rip), %rsi      # 0x17b49
movq %r12, %rdi
callq 0x33f0
testl %eax, %eax
jne 0x12bcd
xorl %ecx, %ecx
testl %ebp, %ebp
sete %cl
movq (%r15), %rdi
movq %r14, %rsi
movl %ebx, %edx
movsd 0x10(%rsp), %xmm0
callq 0xcf70
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6b5d(%rip), %rdi      # 0x196f3
leaq 0x6a22(%rip), %rsi      # 0x195bf
leaq 0x6b77(%rip), %rcx      # 0x1971b
movl $0x71, %edx
callq 0x31b0
leaq 0x6ba1(%rip), %rdi      # 0x19756
leaq 0x6a03(%rip), %rsi      # 0x195bf
leaq 0x6b58(%rip), %rcx      # 0x1971b
movl $0x72, %edx
callq 0x31b0
leaq 0x6b8a(%rip), %rdi      # 0x1975e
leaq 0x69e4(%rip), %rsi      # 0x195bf
leaq 0x6b39(%rip), %rcx      # 0x1971b
movl $0x73, %edx
callq 0x31b0
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12c0a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x32f0
movq %rbx, %rdi
callq 0x3570
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/parser.C
// Function: Parser::ParseLSMSynapse(char*, char*, int, int, int, int, char*)
void Parser::ParseLSMSynapse(char * from, char * to, int fromN, int toN, int value, int random, char * fixed_learning){
    bool fixed;
    if(strcmp(fixed_learning,"fixed") == 0) fixed = true;
    else if(strcmp(fixed_learning,"learning") == 0) fixed = false;
    else{
        cout<<fixed_learning<<endl;
        assert(0);
    }
    _network->LSMAddSynapse(from, to, fromN, toN, value, random, fixed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, 0x4(%rsp)
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
movq 0x48(%rsp), %rdi
leaq 0x5995(%rip), %rsi      # 0x185d2
callq 0x33f0
movl %eax, %ebx
testl %eax, %eax
je 0x12c5d
leaq 0x6b4c(%rip), %rsi      # 0x1979b
movq 0x48(%rsp), %rdi
callq 0x33f0
testl %eax, %eax
jne 0x12c96
movl 0x40(%rsp), %eax
xorl %r10d, %r10d
testl %ebx, %ebx
sete %r10b
movq (%r13), %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %r14d, %ecx
movl %ebp, %r8d
movl 0x4(%rsp), %r9d
pushq %r10
pushq %rax
callq 0xdb90
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe333(%rip), %rdi      # 0x20fd0
movq 0x48(%rsp), %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
leaq 0x571a(%rip), %rdi      # 0x183d0
leaq 0x6902(%rip), %rsi      # 0x195bf
leaq 0x6ae0(%rip), %rcx      # 0x197a4
movl $0x81, %edx
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/simulator.C
// Function: Simulator::InitializeFile(char const*)
void Simulator::InitializeFile(const char * filename){
    FILE * Foutp = fopen(filename,"w");
    assert(Foutp != NULL);
    fprintf(Foutp,"%d\t%d\n",-1,-1);
    fclose(Foutp);
}

// Assembly:
pushq %rbx
movq %rsi, %rdi
leaq 0x63bc(%rip), %rsi      # 0x19993
callq 0x3360
testq %rax, %rax
je 0x13608
movq %rax, %rbx
leaq 0x63e5(%rip), %rsi      # 0x199d0
movq %rax, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x3420
movq %rbx, %rdi
popq %rbx
jmp 0x32d0
leaq 0x6386(%rip), %rdi      # 0x19995
leaq 0x624e(%rip), %rsi      # 0x19864
leaq 0x6386(%rip), %rcx      # 0x199a3
movl $0x6a, %edx
callq 0x31b0
nop
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/readout.C
// Function: Readout::SetRefer(int)
void Readout::SetRefer(int flag){ // To set the reference array according the application
    if(flag == 0){
        for (int i = 0; i < 26; ++i)
        {
            if(i < 2) 
                refer.push_back(i);
            else if(i == 2)
                refer.push_back(10);
            else if(i < 12)
                refer.push_back(refer[i-1] + 1);
            else if(i == 12)
                refer.push_back(2);
            else if(i == 13)
                refer.push_back(20);
            else if(i < 19)
                refer.push_back(refer[i-1] + 1);
            else if(i == 19)
                refer.push_back(3);
            else
                refer.push_back(refer[i-1] + 1);
        }
        // for (int i = 0; i < 26; ++i)
        // {
        // 	cout<<refer[i]<<endl;
        // }
    }
    // refer = {0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 3, 4, 5, 6, 7, 8, 9};
    else{
        for (int i = 0; i < CLS; ++i)
        {
            refer.push_back(i);
        }
        //	refer = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    }     


}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x4(%rsp), %r15
testl %esi, %esi
je 0x13753
movl $0x0, (%r15)
xorl %eax, %eax
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13733
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x10(%rbx)
jmp 0x1373e
movq %r14, %rdi
movq %r15, %rdx
callq 0x4500
movl 0x4(%rsp), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0x19, %ecx
jl 0x1371d
jmp 0x13848
movl $0x0, (%r15)
xorl %eax, %eax
movq %rsp, %r12
cmpl $0x1, %eax
jg 0x1377e
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
jne 0x137be
movq %r14, %rdi
movq %r15, %rdx
callq 0x4500
jmp 0x13834
cmpl $0x2, %eax
jne 0x137a0
movl $0xa, (%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13829
movl $0xa, (%rsi)
jmp 0x137c0
cmpl $0xb, %eax
ja 0x137ca
movq 0x8(%rbx), %rcx
movl %eax, %eax
movl -0x4(%rcx,%rax,4), %eax
incl %eax
movl %eax, (%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13829
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x10(%rbx)
jmp 0x13834
cmpl $0xd, %eax
je 0x137ed
cmpl $0xc, %eax
jne 0x13806
movl $0x2, (%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13829
movl $0x2, (%rsi)
jmp 0x137c0
movl $0x14, (%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13829
movl $0x14, (%rsi)
jmp 0x137c0
cmpl $0x12, %eax
jbe 0x137a5
cmpl $0x13, %eax
jne 0x137a5
movl $0x3, (%rsp)
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x13829
movl $0x3, (%rsi)
jmp 0x137c0
movq %r14, %rdi
movq %r12, %rdx
callq 0x463c
movl 0x4(%rsp), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x4(%rsp)
cmpl $0x19, %ecx
jl 0x1375f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/stonezwr[P]SpiKL-IP/readout.C
// Function: Readout::FindVal(std::vector<int, std::allocator<int>> const&, int)
int val){  //Find a specific value in the vector and return the indices of that value
    vector<int> v_out;
    for (size_t i = 0; i < v.size(); ++i)
    {
        if(v[i] == val){
            //cout<<v[i]<<"\t"<<val<<endl;
            v_out.push_back(i);
        }
    }
    return v_out;	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
cmpq %rax, %rcx
je 0x13ac2
movq %rdx, %r14
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
cmpl %ebp, (%rax,%r12,4)
jne 0x13ab0
movl %r12d, 0xc(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x13a9e
movl %r12d, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x13ab0
movq %rbx, %rdi
movq %r15, %rdx
callq 0x463c
movq (%r14), %rax
movq 0x8(%r14), %rcx
incq %r12
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r12
jb 0x13a7c
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x13ae9
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x32f0
movq %r14, %rdi
callq 0x3570
nop