// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/network.c
// Function: network_predict_data_multi
matrix network_predict_data_multi(network *net, data test, int n)
{
    int i,j,b,m;
    int k = net->outputs;
    matrix pred = make_matrix(test.X.rows, k);
    float *X = calloc(net->batch*test.X.rows, sizeof(float));
    for(i = 0; i < test.X.rows; i += net->batch){
        for(b = 0; b < net->batch; ++b){
            if(i+b == test.X.rows) break;
            memcpy(X+b*test.X.cols, test.X.vals[i+b], test.X.cols*sizeof(float));
        }
        for(m = 0; m < n; ++m){
            float *out = network_predict(net, X);
            for(b = 0; b < net->batch; ++b){
                if(i+b == test.X.rows) break;
                for(j = 0; j < k; ++j){
                    pred.vals[i+b][j] += out[j+b*k]/n;
                }
            }
        }
    }
    free(X);
    return pred;   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
movl 0x84(%rdi), %r15d
movslq 0x1b8(%rsp), %r12
movl %r12d, %edi
movl %r15d, %esi
callq 0x311ee
movq %rax, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
movl 0x4(%rbx), %r13d
movl %r13d, %eax
imull %r12d, %eax
movslq %eax, %rdi
movl $0x4, %esi
callq 0x3250
movq %rax, 0x8(%rsp)
testq %r12, %r12
jle 0x32edb
leaq 0x1b0(%rsp), %rax
movslq 0xc(%rax), %rcx
movq 0x10(%rax), %rax
movq %rax, 0x38(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x18(%rsp)
cvtsi2ssl 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x20(%rsp), %rax
addq $0xe0, %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
movslq %eax, %rbp
testl %r13d, %r13d
jle 0x32e02
movl %r13d, %eax
movq %rax, 0x50(%rsp)
movq %r12, %rax
subq %rbp, %rax
movq %rax, 0x58(%rsp)
movq 0x38(%rsp), %rax
leaq (%rax,%rbp,8), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rbx
xorl %r14d, %r14d
cmpq %r14, 0x58(%rsp)
je 0x32e02
movq 0x48(%rsp), %rax
movq (%rax,%r14,8), %rsi
movq %rbx, %rdi
movq 0x18(%rsp), %rdx
callq 0x32b0
incq %r14
addq 0x18(%rsp), %rbx
cmpq %r14, 0x50(%rsp)
jne 0x32dd6
cmpl $0x0, 0x4(%rsp)
jle 0x32eca
xorl %ebx, %ebx
movl $0x110, %edx            # imm = 0x110
leaq 0x68(%rsp), %rdi
movq 0x20(%rsp), %r13
movq %r13, %rsi
callq 0x32b0
movq 0x8(%rsp), %rax
movq %rax, 0xd8(%r13)
movl $0x0, 0xf8(%r13)
movq 0x60(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r13, %rdi
callq 0x319d7
movq 0x28(%r13), %r14
movl $0x110, %edx            # imm = 0x110
movq %r13, %rdi
leaq 0x68(%rsp), %rsi
callq 0x32b0
movslq 0x4(%r13), %r13
testq %r13, %r13
movq 0x28(%rsp), %r8
movss 0x14(%rsp), %xmm1
jle 0x32ebe
xorl %eax, %eax
xorl %ecx, %ecx
leaq (%rcx,%rbp), %rsi
cmpq %r12, %rsi
je 0x32ebe
testl %r15d, %r15d
jle 0x32eb3
movl %eax, %edx
leaq (%r14,%rdx,4), %rdx
movq (%r8,%rsi,8), %rsi
xorl %edi, %edi
movss (%rdx,%rdi,4), %xmm0
divss %xmm1, %xmm0
addss (%rsi,%rdi,4), %xmm0
movss %xmm0, (%rsi,%rdi,4)
incq %rdi
cmpq %rdi, %r15
jne 0x32e98
incq %rcx
addl %r15d, %eax
cmpq %r13, %rcx
jne 0x32e7e
incl %ebx
cmpl 0x4(%rsp), %ebx
jne 0x32e0f
movq 0x40(%rsp), %rax
addl %r13d, %eax
cmpl %r12d, %eax
jl 0x32da0
movq 0x8(%rsp), %rdi
callq 0x3040
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rdx
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq