// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x30(%rbp)
movq -0x30(%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, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq 0xfdb3(%rip), %rsi      # 0x74a57
movl $0x2, %edx
callq 0x42990
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x31450
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x9020
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8fb0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x64ee7
movq -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x70(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movq -0x30(%rbp), %rax
movl 0x94(%rax), %esi
leaq -0x88(%rbp), %rdi
leaq -0x70(%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 0x12eb0
movl -0x88(%rbp), %eax
movq -0x30(%rbp), %rcx
subl 0x94(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x84(%rbp), %eax
movq -0x30(%rbp), %rcx
subl 0x90(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x30(%rbp), %rax
movl 0x94(%rax), %ecx
movq -0x30(%rbp), %rax
movl 0x90(%rax), %r8d
leaq -0xa0(%rbp), %rdi
leaq -0x88(%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 -0x30(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x3b160
movq %rax, -0xa8(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x64dff
movq -0xa8(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x84(%rax), %esi
movq -0x30(%rbp), %rax
movq 0xd0(%rax), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x4efb0
movq -0x78(%rbp), %rax
cmpq -0x60(%rbp), %rax
je 0x64e2e
leaq -0x88(%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
leaq -0x70(%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
leaq -0xa0(%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 -0x50(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xf4e3(%rip), %rdi      # 0x7436b
movb $0x0, %al
callq 0x3130
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x64ecb
movq -0xa8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x11625(%rip), %rdi     # 0x764de
movb $0x1, %al
callq 0x3130
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x64e96
leaq 0x10edc(%rip), %rdi     # 0x75dae
movb $0x0, %al
callq 0x3130
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x64ce4
addq $0xc0, %rsp
popq %rbp
retq