// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/segmenter.c
// Function: predict_segmenter
void predict_segmenter(char *datafile, char *cfg, char *weights, char *filename)
{
    network *net = load_network(cfg, weights, 0);
    set_batch_network(net, 1);
    srand(2222222);

    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 = letterbox_image(im, net->w, net->h);

        float *X = sized.data;
        time=clock();
        float *predictions = network_predict(net, X);
        image pred = get_network_image(net);
        image prmask = mask_to_rgb(pred);
        printf("Predicted: %f\n", predictions[0]);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        show_image(sized, "orig", 1);
        show_image(prmask, "pred", 0);
        free_image(im);
        free_image(sized);
        free_image(prmask);
        if (filename) break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
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, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x3a9b0
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x31e0
leaq -0x130(%rbp), %rax
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x60732
movq -0x138(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x3060
jmp 0x60793
leaq 0x151b9(%rip), %rdi     # 0x758f2
movb $0x0, %al
callq 0x3130
movq 0x22889(%rip), %rax     # 0x82fd0
movq (%rax), %rdi
callq 0x32e0
movq -0x138(%rbp), %rdi
movq 0x2287b(%rip), %rax     # 0x82fd8
movq (%rax), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x3200
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
jne 0x60780
jmp 0x60985
movq -0x138(%rbp), %rdi
leaq 0x15620(%rip), %rsi     # 0x75dae
callq 0x3380
movq -0x138(%rbp), %rsi
leaq -0x150(%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 -0x168(%rbp), %rdi
leaq -0x150(%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 -0x158(%rbp), %rax
movq %rax, -0x170(%rbp)
callq 0x30f0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0x3b160
movq %rax, -0x178(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x3afe0
leaq -0x1a8(%rbp), %rdi
leaq -0x190(%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 0xe230
movq -0x178(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x15b69(%rip), %rdi     # 0x763d3
movb $0x1, %al
callq 0x3130
movq -0x138(%rbp), %rax
movq %rax, -0x1b0(%rbp)
callq 0x30f0
movq %rax, %rdi
subq -0x30(%rbp), %rdi
callq 0x4b50
movq -0x1b0(%rbp), %rsi
cvtss2sd %xmm0, %xmm0
leaq 0x1502a(%rip), %rdi     # 0x758cc
movb $0x1, %al
callq 0x3130
leaq -0x168(%rbp), %rax
leaq 0x15b2b(%rip), %rdi     # 0x763e2
movl $0x1, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x112c0
leaq -0x1a8(%rbp), %rax
leaq 0x15ae6(%rip), %rdi     # 0x763ce
xorl %esi, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x112c0
leaq -0x150(%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 -0x168(%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 -0x1a8(%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, -0x20(%rbp)
je 0x60980
jmp 0x60985
jmp 0x60714
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nop