// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
xorl %edi, %edi
callq 0x4350
cmpl $0x1, -0xc(%rbp)
jle 0x217cc
jmp 0x217eb
leaq 0x1443d(%rip), %rdi     # 0x35c10
leaq 0x13b40(%rip), %rsi     # 0x3531a
movl $0x321, %edx            # imm = 0x321
leaq 0x14431(%rip), %rcx     # 0x35c17
callq 0x4210
movq -0x90(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x228(%rax)
movslq -0xc(%rbp), %rax
movq %rax, -0xa8(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x23860
leaq -0x51(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x24440
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x98(%rbp), %rcx
leaq -0x38(%rbp), %rdi
callq 0x24460
jmp 0x21855
movq -0x90(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
leaq -0x38(%rbp), %rsi
callq 0x244e0
leaq -0x38(%rbp), %rdi
callq 0x23e50
leaq -0x51(%rbp), %rdi
callq 0x24510
leaq -0x50(%rbp), %rdi
callq 0x23eb0
movq -0x90(%rbp), %rdi
movl $0x1a, -0x1c(%rbp)
addq $0x208, %rdi            # imm = 0x208
callq 0x24530
movl %eax, -0x20(%rbp)
movq 0x2b71d(%rip), %rdi     # 0x4cfc8
leaq 0x14388(%rip), %rsi     # 0x35c3a
callq 0x4360
movq %rax, %rdi
movl -0x20(%rbp), %esi
callq 0x46c0
movq %rax, %rdi
movq 0x2b6ec(%rip), %rsi     # 0x4cfb8
callq 0x43b0
movslq -0x1c(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x4030
movq %rax, -0x70(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x219e0
movl $0x18, %edi
callq 0x4380
movq %rax, %rdi
movq %rdi, -0xb0(%rbp)
callq 0x5550
movq -0xb0(%rbp), %rdx
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl $0x0, -0x14(%rbp)
cmpl $0xa, -0x14(%rbp)
jge 0x21995
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl -0x14(%rbp), %eax
imull $0xa, -0x10(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
leaq -0x74(%rbp), %rsi
callq 0x5830
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x21940
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x24510
leaq -0x50(%rbp), %rdi
callq 0x23eb0
jmp 0x21b3e
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x56f0
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x57c0
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x24550
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x21901
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x21ac6
imull $0xa, -0x18(%rbp), %eax
cltd
idivl -0xc(%rbp)
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0xb4(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull $0xa, %eax, %eax
cltd
idivl -0xc(%rbp)
movl %eax, %ecx
movl -0xb4(%rbp), %eax
cmpl %ecx, %eax
jge 0x21ab6
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x21aa6
movq -0x90(%rbp), %rdi
addq $0x238, %rdi            # imm = 0x238
movslq -0x18(%rbp), %rsi
callq 0x243b0
movq %rax, %rcx
movq -0x90(%rbp), %rax
movq %rcx, -0xc0(%rbp)
addq $0x208, %rax            # imm = 0x208
movq %rax, -0xc8(%rbp)
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq -0x14(%rbp), %rsi
callq 0x5620
movq -0xc8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x24620
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x24280
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x21a2b
jmp 0x21aa8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x219fe
jmp 0x21ab8
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x219e7
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x21b18
movq -0x70(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, %rax
je 0x21b0b
movq -0xd0(%rbp), %rdi
callq 0x9550
movq -0xd0(%rbp), %rdi
movl $0x18, %esi
callq 0x4390
jmp 0x21b0d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x21acd
movq -0x70(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, %rax
je 0x21b35
movq -0xd8(%rbp), %rdi
callq 0x44d0
addq $0xe0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x46d0
nopw (%rax,%rax)