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

    list *options = read_data_cfg(datacfg);

    char *test_list = option_find_str(options, "test", "data/test.list");
    int top = option_find_int(options, "top", 1);

    list *plist = get_paths(test_list);

    char **paths = (char **)list_to_array(plist);
    int m = plist->size;
    free_list(plist);
    int *indexes = calloc(top, sizeof(int));

    for(i = 0; i < m; ++i){
        double time = what_time_is_it_now();
        char *path = paths[i];
        image im = load_image_color(path, 0, 0);
        image r = letterbox_image(im, net->w, net->h);
        float *predictions = network_predict(net, r.data);
        if(net->hierarchy) hierarchy_predictions(predictions, net->outputs, net->hierarchy, 1, 1);
        top_k(predictions, net->outputs, top, indexes);

        printf("%s", path);
        for(j = 0; j < top; ++j){
            printf("\t%d", indexes[j]);
        }
        printf("\n");

        free_image(im);
        free_image(r);

        fprintf(stderr, "%lf seconds, %d images, %d total\n", what_time_is_it_now() - time, i+1, m);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %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)
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 0x12397(%rip), %rsi     # 0x76999
leaq 0x11ea0(%rip), %rdx     # 0x764a9
callq 0x42920
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x120f3(%rip), %rsi     # 0x76710
movl $0x1, %edx
callq 0x42990
movl %eax, -0x3c(%rbp)
movq -0x38(%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
movslq -0x3c(%rbp), %rdi
movl $0x4, %esi
callq 0x3220
movq %rax, -0x60(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x54(%rbp), %eax
jge 0x6483d
movb $0x0, %al
callq 0x3f10
movsd %xmm0, -0x68(%rbp)
movq -0x50(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rsi
leaq -0x88(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movq -0x28(%rbp), %rax
movl 0x94(%rax), %esi
movq -0x28(%rbp), %rax
movl 0x90(%rax), %edx
leaq -0xa0(%rbp), %rdi
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 0x12c60
movq -0x28(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x3b160
movq %rax, -0xa8(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0xd0(%rax)
je 0x6473a
movq -0xa8(%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
movq -0xa8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x84(%rax), %esi
movl -0x3c(%rbp), %edx
movq -0x60(%rbp), %rcx
callq 0x4b70
movq -0x70(%rbp), %rsi
leaq 0xfc09(%rip), %rdi      # 0x7436b
movb $0x0, %al
callq 0x3130
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x6479c
movq -0x60(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %esi
leaq 0x11d2e(%rip), %rdi     # 0x764b8
movb $0x0, %al
callq 0x3130
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x64770
leaq 0x1160b(%rip), %rdi     # 0x75dae
movb $0x0, %al
callq 0x3130
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 -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 0x1e7fd(%rip), %rax     # 0x82ff8
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movb $0x0, %al
callq 0x3f10
movq -0xb0(%rbp), %rdi
subsd -0x68(%rbp), %xmm0
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movl -0x54(%rbp), %ecx
leaq 0x11c94(%rip), %rsi     # 0x764bc
movb $0x1, %al
callq 0x3240
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6466f
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)