// File: /workspace/github_c_makefile_star2_O1/SimpleDoger[P]Darknet_CPU_Only/coco.c
// Function: test_coco
void test_coco(char *cfgfile, char *weightfile, char *filename, float thresh)
{
    image **alphabet = load_alphabet();
    network *net = load_network(cfgfile, weightfile, 0);
    layer l = net->layers[net->n-1];
    set_batch_network(net, 1);
    srand(2222222);
    float nms = .4;
    clock_t time;
    char buff[256];
    char *input = buff;
    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 sized = resize_image(im, net->w, net->h);
        float *X = sized.data;
        time=clock();
        network_predict(net, X);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));

        int nboxes = 0;
        detection *dets = get_network_boxes(net, 1, 1, thresh, 0, 0, 0, &nboxes);
        if (nms) do_nms_sort(dets, l.side*l.side*l.n, l.classes, nms);

        draw_detections(im, dets, l.side*l.side*l.n, thresh, coco_classes, alphabet, 80);
        save_image(im, "prediction");
        show_image(im, "predictions", 0);
        free_detections(dets, nboxes);
        free_image(im);
        free_image(sized);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movss %xmm0, 0x1c(%rsp)
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x15ff7
movq %rax, 0x40(%rsp)
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2f9e4
movq %rax, %r15
movq 0x20(%rax), %rax
movslq (%r15), %rcx
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
movl -0x40c(%rax,%rcx), %ebp
movl -0x3a4(%rax,%rcx), %edx
movl %edx, 0x24(%rsp)
imull %ebp, %ebp
imull -0x41c(%rax,%rcx), %ebp
movq %r15, %rdi
movl $0x1, %esi
callq 0x302d4
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x3230
leaq 0x60(%rsp), %r13
testq %rbx, %rbx
je 0x4c6c0
movl $0x100, %edx            # imm = 0x100
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3080
jmp 0x4c70f
leaq 0xb943(%rip), %rdi      # 0x5800a
xorl %eax, %eax
callq 0x3170
movq 0x1d8fb(%rip), %rax     # 0x69fd0
movq (%rax), %rdi
callq 0x3320
movq 0x1d8f4(%rip), %rax     # 0x69fd8
movq (%rax), %rdx
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x3240
testq %rax, %rax
je 0x4c888
movq %rax, %r13
movq %rax, %rdi
leaq 0xbdff(%rip), %rsi      # 0x58509
callq 0x33c0
leaq 0x28(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x160b6
movl 0x90(%r15), %edx
movl 0x94(%r15), %esi
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %rdi
callq 0x1676b
movq 0x58(%rsp), %r14
callq 0x3130
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x307ea
callq 0x3130
subq %r12, %rax
movq %rax, %rdi
callq 0xe8d4
cvtss2sd %xmm0, %xmm0
leaq 0xb866(%rip), %rdi      # 0x57fe4
movq %r13, %rsi
movb $0x1, %al
callq 0x3170
movl $0x0, 0x20(%rsp)
xorps %xmm1, %xmm1
movq %r15, %rdi
movl $0x1, %esi
movl $0x1, %edx
movss 0x1c(%rsp), %xmm0
xorl %ecx, %ecx
xorl %r8d, %r8d
leaq 0x20(%rsp), %r9
callq 0x30bbb
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
movl 0x24(%rsp), %edx
movss 0xc4f3(%rip), %xmm0     # 0x58cbc
callq 0x36827
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl %ebp, %esi
movss 0x1c(%rsp), %xmm0
leaq 0x1db4d(%rip), %rdx     # 0x6a340
movq 0x40(%rsp), %rcx
movl $0x50, %r8d
callq 0x160ca
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xc7cb(%rip), %rdi      # 0x58fe8
callq 0x17a72
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xc7b7(%rip), %rdi      # 0x58ff3
xorl %esi, %esi
callq 0x3f2e
movl 0x20(%rsp), %esi
movq %r14, %rdi
callq 0x30c1d
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
testq %rbx, %rbx
je 0x4c6a9
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq