// File: /workspace/github_c_makefile_star2_O3/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 0xf0ef
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xf10e
cmpq $0x0, 0x2a8(%rbx)
je 0xf12d
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 0x250(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0xa12c
movq 0x238(%rbx), %rax
movq 0x250(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, 0x250(%rbx)
cmpq 0x240(%rbx), %rax
je 0xf14c
movslq 0x230(%rbx), %rcx
leaq (%rcx,%rcx,2), %rsi
cmpq 0x8(%rax,%rsi,8), %rdx
je 0xf06c
movq (%rdx), %rsi
jmp 0xf0b0
leal 0x1(%rcx), %edx
movl %edx, 0x230(%rbx)
cmpl 0x22c(%rbx), %edx
jne 0xf088
addl $0x2, %ecx
movl %ecx, 0x230(%rbx)
movl %ecx, %edx
cmpl 0x228(%rbx), %edx
jge 0xf0e0
movslq %edx, %rcx
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x250(%rbx)
cmpq 0x8(%rax,%rdx,8), %rcx
je 0xf16b
movq (%rcx), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
movl $0x1, %r9d
callq 0xf6cc
movq 0x250(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0xf822
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xf0da
leaq 0x984d(%rip), %rdi      # 0x18943
leaq 0x92d5(%rip), %rsi      # 0x183d2
leaq 0x99db(%rip), %rcx      # 0x18adf
movl $0x25a, %edx            # imm = 0x25A
callq 0x31b0
leaq 0x9864(%rip), %rdi      # 0x18979
leaq 0x92b6(%rip), %rsi      # 0x183d2
leaq 0x99bc(%rip), %rcx      # 0x18adf
movl $0x25b, %edx            # imm = 0x25B
callq 0x31b0
leaq 0x9862(%rip), %rdi      # 0x18996
leaq 0x9297(%rip), %rsi      # 0x183d2
leaq 0x999d(%rip), %rcx      # 0x18adf
movl $0x25c, %edx            # imm = 0x25C
callq 0x31b0
leaq 0x994c(%rip), %rdi      # 0x18a9f
leaq 0x9278(%rip), %rsi      # 0x183d2
leaq 0x997e(%rip), %rcx      # 0x18adf
movl $0x264, %edx            # imm = 0x264
callq 0x31b0
leaq 0x925e(%rip), %rdi      # 0x183d0
leaq 0x9259(%rip), %rsi      # 0x183d2
leaq 0x995f(%rip), %rcx      # 0x18adf
movl $0x272, %edx            # imm = 0x272
callq 0x31b0