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

    clock_t time;
    char buff[256];
    char *input = buff;
    int i, imlayer = 0;

    for (i = 0; i < net->n; ++i) {
        if (net->layers[i].out_c == 3) {
            imlayer = i;
            printf("%d\n", i);
            break;
        }
    }

    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 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);
        if(gray) grayscale_image_3c(crop);

        float *X = crop.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image_layer(net, imlayer);
        //yuv_to_rgb(out);
        constrain_image(out);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        save_image(out, "out");
        show_image(out, "out", 1);
        show_image(crop, "crop", 0);

        free_image(im);
        free_image(resized);
        free_image(crop);
        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)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%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)
movl $0x0, -0x140(%rbp)
movl $0x0, -0x13c(%rbp)
movl -0x13c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x55a9c
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x13c(%rbp), %rcx
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
addq %rcx, %rax
cmpl $0x3, 0x80(%rax)
jne 0x55a89
movl -0x13c(%rbp), %eax
movl %eax, -0x140(%rbp)
movl -0x13c(%rbp), %esi
leaq 0x1d6f6(%rip), %rdi     # 0x73176
movb $0x0, %al
callq 0x3130
jmp 0x55a9c
jmp 0x55a8b
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x55a37
jmp 0x55a9e
cmpq $0x0, -0x18(%rbp)
je 0x55abc
movq -0x138(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x3060
jmp 0x55b1d
leaq 0x1fe2f(%rip), %rdi     # 0x758f2
movb $0x0, %al
callq 0x3130
movq 0x2d4ff(%rip), %rax     # 0x82fd0
movq (%rax), %rdi
callq 0x32e0
movq -0x138(%rbp), %rdi
movq 0x2d4f1(%rip), %rax     # 0x82fd8
movq (%rax), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x3200
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
jne 0x55b0a
jmp 0x55dac
movq -0x138(%rbp), %rdi
leaq 0x20296(%rip), %rsi     # 0x75dae
callq 0x3380
movq -0x138(%rbp), %rsi
leaq -0x158(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xf510
movq -0x28(%rbp), %rax
movl 0x94(%rax), %esi
leaq -0x170(%rbp), %rdi
leaq -0x158(%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 -0x170(%rbp), %eax
movq -0x28(%rbp), %rcx
subl 0x94(%rcx), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %esi
movl -0x16c(%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 -0x188(%rbp), %rdi
leaq -0x170(%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
cmpl $0x0, -0x1c(%rbp)
je 0x55c0a
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 0x13f40
movq -0x178(%rbp), %rax
movq %rax, -0x190(%rbp)
callq 0x30f0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x190(%rbp), %rsi
callq 0x3b160
movq -0x28(%rbp), %rsi
movl -0x140(%rbp), %edx
leaq -0x1a8(%rbp), %rdi
callq 0x3af30
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 0x10db0
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 0x1fc2f(%rip), %rdi     # 0x758cc
movb $0x1, %al
callq 0x3130
leaq -0x1a8(%rbp), %rax
leaq 0x20da8(%rip), %rdi     # 0x76a5a
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x11330
leaq -0x1a8(%rbp), %rax
leaq 0x20d7c(%rip), %rdi     # 0x76a5a
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 -0x188(%rbp), %rax
leaq 0x1f0a1(%rip), %rdi     # 0x74db0
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 -0x158(%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 -0x170(%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 0x55da7
jmp 0x55dac
jmp 0x55a9e
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw %cs:(%rax,%rax)