// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/cifar.c
// Function: test_cifar_multi
void test_cifar_multi(char *filename, char *weightfile)
{
    network *net = load_network(filename, weightfile, 0);
    set_batch_network(net, 1);
    srand(time(0));

    float avg_acc = 0;
    data test = load_cifar10_data("data/cifar/cifar-10-batches-bin/test_batch.bin");

    int i;
    for(i = 0; i < test.X.rows; ++i){
        image im = float_to_image(32, 32, 3, test.X.vals[i]);

        float pred[10] = {0};

        float *p = network_predict(net, im.data);
        axpy_cpu(10, 1, p, 1, pred, 1);
        flip_image(im);
        p = network_predict(net, im.data);
        axpy_cpu(10, 1, p, 1, pred, 1);

        int index = max_index(pred, 10);
        int class = max_index(test.y.vals[i], 10);
        if(index == class) avg_acc += 1;
        free_image(im);
        printf("%4d: %.2f%%\n", i, 100.*avg_acc/(i+1));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x3a9b0
xorl %eax, %eax
movl %eax, %edi
callq 0x3290
movl %eax, %edi
callq 0x31e0
xorps %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x1df4c(%rip), %rsi     # 0x75ac3
callq 0x38080
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0x57d16
movq -0x50(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %r8
leaq -0x80(%rbp), %rdi
movl $0x20, %edx
movl $0x3, %ecx
movl %edx, %esi
callq 0xfbb0
leaq -0xb0(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x3190
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3b160
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
leaq -0xb0(%rbp), %rcx
movl $0xa, %edi
movss 0x1941a(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
leaq -0x80(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x104c0
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3b160
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
leaq -0xb0(%rbp), %rcx
movl $0xa, %edi
movss 0x193bb(%rip), %xmm0    # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
leaq -0xb0(%rbp), %rdi
movl $0xa, %esi
callq 0x5c30
movl %eax, -0xbc(%rbp)
movq -0x40(%rbp), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0xa, %esi
callq 0x5c30
movl %eax, -0xc0(%rbp)
movl -0xbc(%rbp), %eax
cmpl -0xc0(%rbp), %eax
jne 0x57cb2
movss 0x19364(%rip), %xmm0    # 0x7100c
addss -0x1c(%rbp), %xmm0
movss %xmm0, -0x1c(%rbp)
leaq -0x80(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xedb0
movl -0x64(%rbp), %esi
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1dda8(%rip), %xmm0    # 0x75a90
mulsd %xmm1, %xmm0
movl -0x64(%rbp), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq 0x1ddf1(%rip), %rdi     # 0x75af2
movb $0x1, %al
callq 0x3130
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x57b83
addq $0xe0, %rsp
popq %rbp
retq
nop