// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/classifier.c
// Function: file_output_classifier
void file_output_classifier(char *datacfg, char *filename, char *weightfile, char *listfile)
{
    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, "names", "data/labels.list");
    int classes = option_find_int(options, "classes", 2);

    list *plist = get_paths(listfile);

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

    for(i = 0; i < m; ++i){
        image im = load_image_color(paths[i], 0, 0);
        image resized = resize_min(im, net->w);
        image crop = crop_image(resized, (resized.w - net->w)/2, (resized.h - net->h)/2, net->w, net->h);

        float *pred = network_predict(net, crop.data);
        if(net->hierarchy) hierarchy_predictions(pred, net->outputs, net->hierarchy, 0, 1);

        if(resized.data != im.data) free_image(resized);
        free_image(im);
        free_image(crop);

        printf("%s", paths[i]);
        for(j = 0; j < classes; ++j){
            printf("\t%g", pred[j]);
        }
        printf("\n");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %rbx
movq %rax, %rdi
movl $0x1, %esi
callq 0x302d4
xorl %edi, %edi
callq 0x32d0
movl %eax, %edi
callq 0x3230
movq %r15, %rdi
callq 0x34b9c
leaq 0xb539(%rip), %rsi      # 0x5719b
movq %rax, %rdi
movl $0x2, %edx
callq 0x34d9f
movl %eax, 0x1c(%rsp)
movq %r14, %rdi
callq 0x296f8
movq %rax, %r15
movq %rax, %rdi
callq 0x10fa0
movq %rax, %r14
movslq (%r15), %r12
movq %r15, %rdi
callq 0x10f56
movq %r12, 0x40(%rsp)
testq %r12, %r12
jle 0x4be14
movl 0x1c(%rsp), %r15d
leaq 0xcf89(%rip), %r12      # 0x58c37
xorl %ebp, %ebp
movq %rbx, 0x38(%rsp)
movq (%r14,%rbp,8), %rsi
leaq 0x48(%rsp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x160b6
movl 0x94(%rbx), %esi
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x1920a
movl 0x90(%rbx), %r8d
movl 0x94(%rbx), %ecx
movl 0x20(%rsp), %eax
movl 0x24(%rsp), %edi
subl %ecx, %eax
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
subl %r8d, %edi
movl %edi, %edx
shrl $0x1f, %edx
addl %edi, %edx
sarl %edx
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x60(%rsp), %rdi
callq 0x181f7
movq 0x70(%rsp), %rsi
movq %rbx, %rdi
callq 0x307ea
movq %rax, %r13
movq 0xd0(%rbx), %rdx
testq %rdx, %rdx
je 0x4bd65
movl 0x84(%rbx), %esi
movq %r13, %rdi
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x3cc56
movq 0x30(%rsp), %rax
cmpq 0x58(%rsp), %rax
je 0x4bd89
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x60(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq %r14, %rbx
movq (%r14,%rbp,8), %rsi
leaq 0xabb4(%rip), %rdi      # 0x5697b
xorl %eax, %eax
callq 0x3170
cmpl $0x0, 0x1c(%rsp)
jle 0x4bdf4
xorl %r14d, %r14d
xorps %xmm0, %xmm0
cvtss2sd (%r13,%r14,4), %xmm0
movq %r12, %rdi
movb $0x1, %al
callq 0x3170
incq %r14
cmpq %r14, %r15
jne 0x4bdd8
movl $0xa, %edi
callq 0x3060
incq %rbp
cmpq 0x40(%rsp), %rbp
movq %rbx, %r14
movq 0x38(%rsp), %rbx
jne 0x4bcb5
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq