// File: /workspace/github_c_makefile_star2_O1/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, %r14
movl 0x84(%rdi), %r15d
movslq 0x1b8(%rsp), %r12
movl %r12d, %edi
movl %r15d, %esi
callq 0x2f52e
movq %rax, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movslq 0x4(%r14), %rdi
imulq %r12, %rdi
movl $0x4, %esi
callq 0x3260
movq %rax, 0x8(%rsp)
testq %r12, %r12
jle 0x30f3b
leaq 0x1b0(%rsp), %rax
movslq 0xc(%rax), %rcx
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x40(%rsp)
cvtsi2ssl 0x4(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
leaq 0xe0(%r14), %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
movq %r14, 0x30(%rsp)
movslq 0x4(%r14), %rcx
movq %rax, 0x38(%rsp)
movslq %eax, %r13
movq %rcx, 0x58(%rsp)
testq %rcx, %rcx
jle 0x30e56
movq %r12, %rax
subq %r13, %rax
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rax
leaq (%rax,%r13,8), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rsp), %rbx
xorl %ebp, %ebp
cmpq %rbp, 0x50(%rsp)
je 0x30e56
movq 0x48(%rsp), %rax
movq (%rax,%rbp,8), %rsi
movq %rbx, %rdi
movq 0x40(%rsp), %r14
movq %r14, %rdx
callq 0x32c0
incq %rbp
addq %r14, %rbx
cmpq %rbp, 0x58(%rsp)
jne 0x30e29
cmpl $0x0, 0x4(%rsp)
movq 0x30(%rsp), %r14
jle 0x30f29
xorl %ebx, %ebx
movl $0x110, %edx            # imm = 0x110
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x32c0
movq 0x8(%rsp), %rax
movq %rax, 0xd8(%r14)
movl $0x0, 0xf8(%r14)
movq 0x60(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r14, %rdi
callq 0x2fcff
movq 0x28(%r14), %rbp
movl $0x110, %edx            # imm = 0x110
movq %r14, %rdi
leaq 0x68(%rsp), %rsi
callq 0x32c0
movslq 0x4(%r14), %rax
testq %rax, %rax
movq 0x18(%rsp), %r9
movss 0x14(%rsp), %xmm1
jle 0x30f1d
xorl %ecx, %ecx
xorl %edx, %edx
leaq (%rdx,%r13), %rdi
cmpq %r12, %rdi
je 0x30f1d
testl %r15d, %r15d
jle 0x30f12
movl %ecx, %esi
leaq (,%rsi,4), %rsi
addq %rbp, %rsi
movq (%r9,%rdi,8), %rdi
xorl %r8d, %r8d
movss (%rsi,%r8,4), %xmm0
divss %xmm1, %xmm0
addss (%rdi,%r8,4), %xmm0
movss %xmm0, (%rdi,%r8,4)
incq %r8
cmpq %r8, %r15
jne 0x30ef4
incq %rdx
addl %r15d, %ecx
cmpq %rax, %rdx
jne 0x30ed2
incl %ebx
cmpl 0x4(%rsp), %ebx
jne 0x30e68
movq 0x38(%rsp), %rax
addl 0x4(%r14), %eax
cmpl %r12d, %eax
jl 0x30df3
movq 0x8(%rsp), %rdi
callq 0x3040
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rdx
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq