// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/classifier.c
// Function: label_classifier
void label_classifier(char *datacfg, char *filename, char *weightfile)
{
    int i;
    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");
    char *test_list = option_find_str(options, "test", "data/train.list");
    int classes = option_find_int(options, "classes", 2);

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

    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(resized.data != im.data) free_image(resized);
        free_image(im);
        free_image(crop);
        int ind = max_index(pred, classes);

        printf("%s\n", labels[ind]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
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 0x10c25(%rip), %rsi     # 0x74fa5
leaq 0x12069(%rip), %rdx     # 0x763f0
callq 0x42920
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x125fe(%rip), %rsi     # 0x76999
leaq 0x12016(%rip), %rdx     # 0x763b8
callq 0x42920
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x106a1(%rip), %rsi     # 0x74a57
movl $0x2, %edx
callq 0x42990
movl %eax, -0x44(%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
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x645a0
movq -0x60(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x80(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movq -0x28(%rbp), %rax
movl 0x94(%rax), %esi
leaq -0x98(%rbp), %rdi
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 0x12eb0
movl -0x98(%rbp), %eax
movq -0x28(%rbp), %rcx
subl 0x94(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x94(%rbp), %eax
movq -0x28(%rbp), %rcx
subl 0x90(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x28(%rbp), %rax
movl 0x94(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x90(%rax), %r8d
leaq -0xb0(%rbp), %rdi
leaq -0x98(%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 -0x28(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x3b160
movq %rax, -0xb8(%rbp)
movq -0x88(%rbp), %rax
cmpq -0x70(%rbp), %rax
je 0x64519
leaq -0x98(%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 -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
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 -0xb8(%rbp), %rdi
movl -0x44(%rbp), %esi
callq 0x5c30
movl %eax, -0xbc(%rbp)
movq -0x50(%rbp), %rax
movslq -0xbc(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0xfe12(%rip), %rdi      # 0x7439d
movb $0x0, %al
callq 0x3130
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x64403
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)