// File: /workspace/github_c_makefile_star2_O2/stonezwr[P]SpiKL-IP/network.C
// Function: Network::CrossValidation(int)
void Network::CrossValidation(int fold){
    int i, j, k, cls, sample;
    std::srand(0);

    assert(fold>1);
    _fold = fold;
    _CVspeeches = vector<vector<Speech*> >(fold, vector<Speech*>());
    cls = CLS;
    sample = _speeches.size();
    cout<<"sample: "<<sample<<endl;
    vector<int> ** index;
    index = new vector<int>*[cls];
    for(i = 0; i < cls; i++){
        index[i] = new vector<int>;
        for(j = 0; j < SAMPLES_PER_CLASS; j++) 
			index[i]->push_back(j+i*SAMPLES_PER_CLASS);
        random_shuffle(index[i]->begin(),index[i]->end());
    }

    for(k = 0; k < fold; k++)
        for(j = (k*SAMPLES_PER_CLASS)/fold; j < ((k+1)*SAMPLES_PER_CLASS)/fold; j++)
            for(i = 0; i < cls; i++){
                _CVspeeches[k].push_back(_speeches[(*index[i])[j]]);
            }

    for(i = 0; i < cls; i++) delete index[i];
    delete [] index;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %edi, %edi
callq 0x3290
cmpl $0x1, %ebx
jle 0xd82d
movl %ebx, 0x228(%r14)
movl %ebx, 0x1c(%rsp)
movl %ebx, %esi
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x50(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movq %rsi, 0x20(%rsp)
callq 0xe9ba
leaq 0x238(%r14), %rdi
leaq 0x50(%rsp), %r13
movq %r13, %rsi
callq 0xfc96
movq %r13, %rdi
callq 0xe90c
leaq 0x30(%rsp), %rdi
callq 0xefb2
movq 0x210(%r14), %r15
subq 0x208(%r14), %r15
shrq $0x3, %r15
movq 0x128e7(%rip), %rdi     # 0x1ffc8
leaq 0x85ea(%rip), %rsi      # 0x15cd2
callq 0x32a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x3530
movq %rax, %rdi
callq 0x3160
movl $0xd0, %edi
callq 0x3030
movq %rax, %r12
xorl %ebx, %ebx
xorl %ebp, %ebp
cmpq $0x1a, %rbp
je 0xd76c
pushq $0x18
popq %rdi
callq 0x32c0
movq %rax, %r15
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rbp, 0x10(%rsp)
movq %rax, (%r12,%rbp,8)
xorl %ebp, %ebp
cmpl $0xa, %ebp
je 0xd753
leal (%rbx,%rbp), %eax
movl %eax, 0x50(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x402a
incl %ebp
jmp 0xd738
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0xea10
movq 0x10(%rsp), %rbp
incq %rbp
addl $0xa, %ebx
jmp 0xd711
xorl %ecx, %ecx
xorl %edi, %edi
cmpq 0x20(%rsp), %rcx
je 0xd7e9
leaq 0x1(%rcx), %rax
movq %rax, 0x28(%rsp)
imull $0xa, %eax, %eax
xorl %edx, %edx
movl 0x1c(%rsp), %esi
divl %esi
movl %eax, %r13d
movl %edi, 0x10(%rsp)
movl %edi, %eax
xorl %edx, %edx
divl %esi
movl %eax, %r15d
imulq $0x18, %rcx, %rbp
cmpq %r13, %r15
jae 0xd7db
xorl %ebx, %ebx
cmpq $0x1a, %rbx
je 0xd7d6
movq 0x238(%r14), %rdi
addq %rbp, %rdi
movq (%r12,%rbx,8), %rax
movq (%rax), %rax
movslq (%rax,%r15,4), %rsi
shlq $0x3, %rsi
addq 0x208(%r14), %rsi
callq 0xe97e
incq %rbx
jmp 0xd7a6
incq %r15
jmp 0xd79f
movl 0x10(%rsp), %edi
addl $0xa, %edi
movq 0x28(%rsp), %rcx
jmp 0xd770
xorl %r15d, %r15d
pushq $0x18
popq %rbx
cmpq $0x1a, %r15
je 0xd816
movq (%r12,%r15,8), %r14
testq %r14, %r14
je 0xd806
movq %r14, %rdi
callq 0x520c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x32d0
incq %r15
jmp 0xd7ef
movq %r12, %rdi
callq 0x3390
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8474(%rip), %rdi      # 0x15ca8
leaq 0x7b77(%rip), %rsi      # 0x153b2
leaq 0x846d(%rip), %rcx      # 0x15caf
movl $0x321, %edx            # imm = 0x321
callq 0x31b0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xefb2
movq %rbx, %rdi
callq 0x3540
nop