// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::LoadNextSpeechTrainCV(networkmode_t)
int Network::LoadNextSpeechTrainCV(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); 

    _lsm_output_layer->LSMRemoveTeacherSignal((*_cv_train_sp_iter)->Class());
    _cv_train_sp_iter++;
    assert(!_CVspeeches.empty());
    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{
        ++_train_fold_ind;
        if(_train_fold_ind == _fold_ind)  ++_train_fold_ind;

        if(_train_fold_ind < _fold){
            _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{
                assert(0);
                return -1;
            }
        }else{
            LSMNetworkRemoveSpeech();
            return -1;
        }
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, 0xc(%rsp)
cmpq $0x0, 0x268(%rdi)
je 0xcbe3
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xcc02
cmpq $0x0, 0x2a8(%rbx)
je 0xcc21
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 0x250(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0x8692
movq 0x238(%rbx), %rax
movq 0x250(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, 0x250(%rbx)
cmpq 0x240(%rbx), %rax
je 0xcc40
movslq 0x230(%rbx), %rcx
imulq $0x18, %rcx, %rsi
cmpq 0x8(%rax,%rsi), %rdx
je 0xcb64
movq (%rdx), %rsi
jmp 0xcba8
leal 0x1(%rcx), %edx
movl %edx, 0x230(%rbx)
cmpl 0x22c(%rbx), %edx
jne 0xcb80
addl $0x2, %ecx
movl %ecx, 0x230(%rbx)
movl %ecx, %edx
cmpl 0x228(%rbx), %edx
jge 0xcbd6
movslq %edx, %rcx
imulq $0x18, %rcx, %rdx
movq (%rax,%rdx), %rcx
movq %rcx, 0x250(%rbx)
cmpq 0x8(%rax,%rdx), %rcx
je 0xcc5f
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
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0xd260
pushq $-0x1
popq %rax
jmp 0xcbd0
leaq 0x8d39(%rip), %rdi      # 0x15923
leaq 0x87c1(%rip), %rsi      # 0x153b2
leaq 0x8ec7(%rip), %rcx      # 0x15abf
movl $0x25a, %edx            # imm = 0x25A
callq 0x31b0
leaq 0x8d50(%rip), %rdi      # 0x15959
leaq 0x87a2(%rip), %rsi      # 0x153b2
leaq 0x8ea8(%rip), %rcx      # 0x15abf
movl $0x25b, %edx            # imm = 0x25B
callq 0x31b0
leaq 0x8d4e(%rip), %rdi      # 0x15976
leaq 0x8783(%rip), %rsi      # 0x153b2
leaq 0x8e89(%rip), %rcx      # 0x15abf
movl $0x25c, %edx            # imm = 0x25C
callq 0x31b0
leaq 0x8e38(%rip), %rdi      # 0x15a7f
leaq 0x8764(%rip), %rsi      # 0x153b2
leaq 0x8e6a(%rip), %rcx      # 0x15abf
movl $0x264, %edx            # imm = 0x264
callq 0x31b0
leaq 0x874a(%rip), %rdi      # 0x153b0
leaq 0x8745(%rip), %rsi      # 0x153b2
leaq 0x8e4b(%rip), %rcx      # 0x15abf
movl $0x272, %edx            # imm = 0x272
callq 0x31b0