// File: /workspace/github_c_makefile_star2_O1/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 0xf377
movq %rdi, %rbx
cmpq $0x0, 0x270(%rdi)
je 0xf396
cmpq $0x0, 0x2a8(%rbx)
je 0xf3b5
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 0xfc4e
movq 0x250(%rbx), %rax
movq 0x2a8(%rbx), %rdi
movq (%rax), %rax
movl 0x80(%rax), %esi
callq 0xa31a
movq 0x238(%rbx), %rax
movq 0x250(%rbx), %rdx
addq $0x8, %rdx
movq %rdx, 0x250(%rbx)
cmpq 0x240(%rbx), %rax
je 0xf3d4
movslq 0x230(%rbx), %rcx
leaq (%rcx,%rcx,2), %rsi
cmpq 0x8(%rax,%rsi,8), %rdx
je 0xf2f2
movq (%rdx), %rsi
jmp 0xf338
leal 0x1(%rcx), %edx
movl %edx, 0x230(%rbx)
cmpl 0x22c(%rbx), %edx
jne 0xf30c
addl $0x2, %ecx
movl %ecx, 0x230(%rbx)
movslq 0x230(%rbx), %rcx
cmpl 0x228(%rbx), %ecx
jge 0xf368
leaq (%rcx,%rcx,2), %rdx
movq (%rax,%rdx,8), %rcx
movq %rcx, 0x250(%rbx)
cmpq 0x8(%rax,%rdx,8), %rcx
je 0xf3f3
movq (%rcx), %rsi
movl 0x8(%rsp), %edx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movq %rbx, %rdi
movl $0x1, %r9d
callq 0xf964
movq 0x250(%rbx), %rax
movq (%rax), %rax
movl 0x84(%rax), %eax
addq $0x10, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0xfaba
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xf362
leaq 0x9525(%rip), %rdi      # 0x188a3
leaq 0x8fad(%rip), %rsi      # 0x18332
leaq 0x96b3(%rip), %rcx      # 0x18a3f
movl $0x25a, %edx            # imm = 0x25A
callq 0x31b0
leaq 0x953c(%rip), %rdi      # 0x188d9
leaq 0x8f8e(%rip), %rsi      # 0x18332
leaq 0x9694(%rip), %rcx      # 0x18a3f
movl $0x25b, %edx            # imm = 0x25B
callq 0x31b0
leaq 0x953a(%rip), %rdi      # 0x188f6
leaq 0x8f6f(%rip), %rsi      # 0x18332
leaq 0x9675(%rip), %rcx      # 0x18a3f
movl $0x25c, %edx            # imm = 0x25C
callq 0x31b0
leaq 0x9624(%rip), %rdi      # 0x189ff
leaq 0x8f50(%rip), %rsi      # 0x18332
leaq 0x9656(%rip), %rcx      # 0x18a3f
movl $0x264, %edx            # imm = 0x264
callq 0x31b0
leaq 0x8f36(%rip), %rdi      # 0x18330
leaq 0x8f31(%rip), %rsi      # 0x18332
leaq 0x9637(%rip), %rcx      # 0x18a3f
movl $0x272, %edx            # imm = 0x272
callq 0x31b0