// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/tag.c
// Function: test_tag
void test_tag(char *cfgfile, char *weightfile, char *filename)
{
    network *net = load_network(cfgfile, weightfile, 0);
    set_batch_network(net, 1);
    srand(2222222);
    int i = 0;
    char **names = get_labels("data/tags.txt");
    clock_t time;
    int indexes[10];
    char buff[256];
    char *input = buff;
    int size = net->w;
    while(1){
        if(filename){
            strncpy(input, filename, 256);
        }else{
            printf("Enter Image Path: ");
            fflush(stdout);
            input = fgets(input, 256, stdin);
            if(!input) return;
            strtok(input, "\n");
        }
        image im = load_image_color(input, 0, 0);
        image r = resize_min(im, size);
        resize_network(net, r.w, r.h);
        printf("%d %d\n", r.w, r.h);

        float *X = r.data;
        time=clock();
        float *predictions = network_predict(net, X);
        top_predictions(net, 10, indexes);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        for(i = 0; i < 10; ++i){
            int index = indexes[i];
            printf("%.1f%%: %s\n", predictions[index]*100, names[index]);
        }
        if(r.data != im.data) free_image(r);
        free_image(im);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x3a9b0
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x31e0
movl $0x0, -0x24(%rbp)
leaq 0x1eb63(%rip), %rdi     # 0x75a63
callq 0x343c0
movq %rax, -0x30(%rbp)
leaq -0x160(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x20(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x16c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x56f45
movq -0x168(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x3060
jmp 0x56fa6
leaq 0x1e9a6(%rip), %rdi     # 0x758f2
movb $0x0, %al
callq 0x3130
movq 0x2c076(%rip), %rax     # 0x82fd0
movq (%rax), %rdi
callq 0x32e0
movq -0x168(%rbp), %rdi
movq 0x2c068(%rip), %rax     # 0x82fd8
movq (%rax), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x3200
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
jne 0x56f93
jmp 0x57160
movq -0x168(%rbp), %rdi
leaq 0x1ee0d(%rip), %rsi     # 0x75dae
callq 0x3380
movq -0x168(%rbp), %rsi
leaq -0x188(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movl -0x16c(%rbp), %esi
leaq -0x1a0(%rbp), %rdi
leaq -0x188(%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
movq -0x20(%rbp), %rdi
movl -0x1a0(%rbp), %esi
movl -0x19c(%rbp), %edx
callq 0x3aa00
movl -0x1a0(%rbp), %esi
movl -0x19c(%rbp), %edx
leaq 0x1e119(%rip), %rdi     # 0x75130
movb $0x0, %al
callq 0x3130
movq -0x190(%rbp), %rax
movq %rax, -0x1a8(%rbp)
callq 0x30f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
callq 0x3b160
movq %rax, -0x1b0(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rdx
movl $0xa, %esi
callq 0x3b120
movq -0x168(%rbp), %rax
movq %rax, -0x1c0(%rbp)
callq 0x30f0
movq %rax, %rdi
subq -0x38(%rbp), %rdi
callq 0x4b50
movq -0x1c0(%rbp), %rsi
cvtss2sd %xmm0, %xmm0
leaq 0x1e83d(%rip), %rdi     # 0x758cc
movb $0x1, %al
callq 0x3130
movl $0x0, -0x24(%rbp)
cmpl $0xa, -0x24(%rbp)
jge 0x570f8
movslq -0x24(%rbp), %rax
movl -0x60(%rbp,%rax,4), %eax
movl %eax, -0x1b4(%rbp)
movq -0x1b0(%rbp), %rax
movslq -0x1b4(%rbp), %rcx
movss 0x1a14d(%rip), %xmm0    # 0x71214
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x30(%rbp), %rax
movslq -0x1b4(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1e98b(%rip), %rdi     # 0x75a71
movb $0x1, %al
callq 0x3130
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5709d
movq -0x190(%rbp), %rax
cmpq -0x178(%rbp), %rax
je 0x5712d
leaq -0x1a0(%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 -0x188(%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
cmpq $0x0, -0x18(%rbp)
je 0x5715b
jmp 0x57160
jmp 0x56f27
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopl (%rax)