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

    list *options = read_data_cfg(datacfg);

    char *label_list = option_find_str(options, "labels", "data/labels.list");
    char *valid_list = option_find_str(options, "valid", "data/train.list");
    int classes = option_find_int(options, "classes", 2);
    int topk = option_find_int(options, "top", 1);

    char **labels = get_labels(label_list);
    list *plist = get_paths(valid_list);

    char **paths = (char **)list_to_array(plist);
    int m = plist->size;
    free_list(plist);

    float avg_acc = 0;
    float avg_topk = 0;
    int *indexes = calloc(topk, sizeof(int));

    for(i = 0; i < m; ++i){
        int class = -1;
        char *path = paths[i];
        for(j = 0; j < classes; ++j){
            if(strstr(path, labels[j])){
                class = j;
                break;
            }
        }
        int w = net->w;
        int h = net->h;
        int shift = 32;
        image im = load_image_color(paths[i], w+shift, h+shift);
        image images[10];
        images[0] = crop_image(im, -shift, -shift, w, h);
        images[1] = crop_image(im, shift, -shift, w, h);
        images[2] = crop_image(im, 0, 0, w, h);
        images[3] = crop_image(im, -shift, shift, w, h);
        images[4] = crop_image(im, shift, shift, w, h);
        flip_image(im);
        images[5] = crop_image(im, -shift, -shift, w, h);
        images[6] = crop_image(im, shift, -shift, w, h);
        images[7] = crop_image(im, 0, 0, w, h);
        images[8] = crop_image(im, -shift, shift, w, h);
        images[9] = crop_image(im, shift, shift, w, h);
        float *pred = calloc(classes, sizeof(float));
        for(j = 0; j < 10; ++j){
            float *p = network_predict(net, images[j].data);
            if(net->hierarchy) hierarchy_predictions(p, net->outputs, net->hierarchy, 1, 1);
            axpy_cpu(classes, 1, p, 1, pred, 1);
            free_image(images[j]);
        }
        free_image(im);
        top_k(pred, classes, topk, indexes);
        free(pred);
        if(indexes[0] == class) avg_acc += 1;
        for(j = 0; j < topk; ++j){
            if(indexes[j] == class) avg_topk += 1;
        }

        printf("%d: top 1: %f, top %d: %f\n", i, avg_acc/(i+1), topk, avg_topk/(i+1));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x3a9b0
xorl %eax, %eax
movl %eax, %edi
callq 0x3290
movl %eax, %edi
callq 0x31e0
movq -0x8(%rbp), %rdi
callq 0x426b0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x11bd6(%rip), %rsi     # 0x74346
leaq 0x13c79(%rip), %rdx     # 0x763f0
callq 0x42920
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x111e8(%rip), %rsi     # 0x73973
leaq 0x13c26(%rip), %rdx     # 0x763b8
callq 0x42920
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x122b1(%rip), %rsi     # 0x74a57
movl $0x2, %edx
callq 0x42990
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x13f52(%rip), %rsi     # 0x76710
movl $0x1, %edx
callq 0x42990
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
callq 0x343c0
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
callq 0x31450
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x9020
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x58(%rbp), %rdi
callq 0x8fb0
xorps %xmm0, %xmm0
movss %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x6c(%rbp)
movslq -0x48(%rbp), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x78(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x62f45
movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF
movq -0x60(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x62895
movq -0x88(%rbp), %rdi
movq -0x50(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3480
cmpq $0x0, %rax
je 0x62888
movl -0x20(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x62895
jmp 0x6288a
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x6285a
movq -0x28(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x28(%rbp), %rax
movl 0x90(%rax), %eax
movl %eax, -0x90(%rbp)
movl $0x20, -0x94(%rbp)
movq -0x60(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x8c(%rbp), %edx
addl -0x94(%rbp), %edx
movl -0x90(%rbp), %ecx
addl -0x94(%rbp), %ecx
leaq -0xb0(%rbp), %rdi
callq 0xf510
xorl %esi, %esi
subl -0x94(%rbp), %esi
xorl %edx, %edx
subl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x1b8(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x1b8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x190(%rbp)
movl -0x94(%rbp), %esi
xorl %edx, %edx
subl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x1d0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x1d0(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x178(%rbp)
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x1e8(%rbp), %rdi
leaq -0xb0(%rbp), %rax
xorl %edx, %edx
movq (%rax), %rsi
movq %rsi, (%rsp)
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movl %edx, %esi
callq 0x11ca0
movq -0x1e8(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x160(%rbp)
xorl %esi, %esi
subl -0x94(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x200(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x200(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x1f0(%rbp), %rax
movq %rax, -0x148(%rbp)
movl -0x94(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x218(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x218(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0xb0(%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
xorl %esi, %esi
subl -0x94(%rbp), %esi
xorl %edx, %edx
subl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x230(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x230(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x228(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x220(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x94(%rbp), %esi
xorl %edx, %edx
subl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x248(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x248(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x240(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x238(%rbp), %rax
movq %rax, -0x100(%rbp)
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x260(%rbp), %rdi
leaq -0xb0(%rbp), %rax
xorl %edx, %edx
movq (%rax), %rsi
movq %rsi, (%rsp)
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
movl %edx, %esi
callq 0x11ca0
movq -0x260(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x258(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x250(%rbp), %rax
movq %rax, -0xe8(%rbp)
xorl %esi, %esi
subl -0x94(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x278(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x278(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x270(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x268(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl -0x94(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
leaq -0x290(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq (%rax), %r9
movq %r9, (%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11ca0
movq -0x290(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x288(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x280(%rbp), %rax
movq %rax, -0xb8(%rbp)
movslq -0x44(%rbp), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x298(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0xa, -0x20(%rbp)
jge 0x62e53
movq -0x28(%rbp), %rdi
movslq -0x20(%rbp), %rcx
leaq -0x1a0(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
callq 0x3b160
movq %rax, -0x2a0(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x62dee
movq -0x2a0(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x84(%rax), %esi
movq -0x28(%rbp), %rax
movq 0xd0(%rax), %rdx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0x4efb0
movl -0x44(%rbp), %edi
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rcx
movss 0xe205(%rip), %xmm0     # 0x7100c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movslq -0x20(%rbp), %rcx
leaq -0x1a0(%rbp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %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 -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x62d86
leaq -0xb0(%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
movq -0x298(%rbp), %rdi
movl -0x44(%rbp), %esi
movl -0x48(%rbp), %edx
movq -0x78(%rbp), %rcx
callq 0x4b70
movq -0x298(%rbp), %rdi
callq 0x3030
movq -0x78(%rbp), %rax
movl (%rax), %eax
cmpl -0x7c(%rbp), %eax
jne 0x62eb7
movss 0xe15f(%rip), %xmm0     # 0x7100c
addss -0x68(%rbp), %xmm0
movss %xmm0, -0x68(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x62ef5
movq -0x78(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x7c(%rbp), %eax
jne 0x62ee8
movss 0xe12e(%rip), %xmm0     # 0x7100c
addss -0x6c(%rbp), %xmm0
movss %xmm0, -0x6c(%rbp)
jmp 0x62eea
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x62ebe
movl -0x1c(%rbp), %esi
movss -0x68(%rbp), %xmm0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movl -0x48(%rbp), %edx
movss -0x6c(%rbp), %xmm1
movl -0x1c(%rbp), %eax
addl $0x1, %eax
cvtsi2ss %eax, %xmm2
divss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x13530(%rip), %rdi     # 0x76460
movb $0x2, %al
callq 0x3130
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6282d
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
nop