// File: /workspace/github_c_makefile_star2_O0/SimpleDoger[P]Darknet_CPU_Only/lsd.c
// Function: inter_dcgan
void inter_dcgan(char *cfgfile, char *weightfile)
{
    network *net = load_network(cfgfile, weightfile, 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;
        }
    }
    image start = random_unit_vector_image(net->w, net->h, net->c);
    image end = random_unit_vector_image(net->w, net->h, net->c);
        image im = make_image(net->w, net->h, net->c);
        image orig = copy_image(start);

    int c = 0;
    int count = 0;
    int max_count = 15;
    while(1){
        ++c;
        
        if(count == max_count){
            count = 0;
            free_image(start);
            start = end;
            end = random_unit_vector_image(net->w, net->h, net->c);
            if(c > 300){
                end = orig;
            }
            if(c>300 + max_count) return;
        }
        ++count;

        slerp(start.data, end.data, (float)count / max_count, im.w*im.h*im.c, im.data);

        float *X = im.data;
        time=clock();
        network_predict(net, X);
        image out = get_network_image_layer(net, imlayer);
        //yuv_to_rgb(out);
        normalize_image(out);
        printf("%s: Predicted in %f seconds.\n", input, sec(clock()-time));
        //char buff[256];
        sprintf(buff, "out%05d", c);
        save_image(out, "out");
        save_image(out, buff);
        show_image(out, "out", 0);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x39a70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x3a9b0
movl $0x21e88e, %edi         # imm = 0x21E88E
callq 0x31e0
leaq -0x120(%rbp), %rax
movq %rax, -0x128(%rbp)
movl $0x0, -0x130(%rbp)
movl $0x0, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x55325
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x12c(%rbp), %rcx
imulq $0x4a0, %rcx, %rcx      # imm = 0x4A0
addq %rcx, %rax
cmpl $0x3, 0x80(%rax)
jne 0x55312
movl -0x12c(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x12c(%rbp), %esi
leaq 0x1de6d(%rip), %rdi     # 0x73176
movb $0x0, %al
callq 0x3130
jmp 0x55325
jmp 0x55314
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x552c0
movq -0x18(%rbp), %rax
movl 0x94(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x98(%rax), %ecx
leaq -0x148(%rbp), %rdi
callq 0x551a0
movq -0x18(%rbp), %rax
movl 0x94(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x98(%rax), %ecx
leaq -0x160(%rbp), %rdi
callq 0x551a0
movq -0x18(%rbp), %rax
movl 0x94(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x98(%rax), %ecx
leaq -0x178(%rbp), %rdi
callq 0xe3e0
leaq -0x190(%rbp), %rdi
leaq -0x148(%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 0xea60
movl $0x0, -0x194(%rbp)
movl $0x0, -0x198(%rbp)
movl $0xf, -0x19c(%rbp)
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
movl -0x198(%rbp), %eax
cmpl -0x19c(%rbp), %eax
jne 0x55512
movl $0x0, -0x198(%rbp)
leaq -0x148(%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 -0x160(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x150(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rax
movl 0x94(%rax), %esi
movq -0x18(%rbp), %rax
movl 0x90(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x98(%rax), %ecx
leaq -0x1b8(%rbp), %rdi
callq 0x551a0
movq -0x1b8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x150(%rbp)
cmpl $0x12c, -0x194(%rbp)    # imm = 0x12C
jle 0x554f1
movq -0x190(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x188(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x150(%rbp)
movl -0x194(%rbp), %eax
movl -0x19c(%rbp), %ecx
addl $0x12c, %ecx            # imm = 0x12C
cmpl %ecx, %eax
jle 0x55510
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq
jmp 0x55512
movl -0x198(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x198(%rbp)
movq -0x138(%rbp), %rdi
movq -0x150(%rbp), %rsi
cvtsi2ssl -0x198(%rbp), %xmm0
cvtsi2ssl -0x19c(%rbp), %xmm1
divss %xmm1, %xmm0
movl -0x178(%rbp), %edx
imull -0x174(%rbp), %edx
imull -0x170(%rbp), %edx
movq -0x168(%rbp), %rcx
callq 0x55060
movq -0x168(%rbp), %rax
movq %rax, -0x1c0(%rbp)
callq 0x30f0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
callq 0x3b160
movq -0x18(%rbp), %rsi
movl -0x130(%rbp), %edx
leaq -0x1d8(%rbp), %rdi
callq 0x3af30
leaq -0x1d8(%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 0x10e50
movq -0x128(%rbp), %rax
movq %rax, -0x1e0(%rbp)
callq 0x30f0
movq %rax, %rdi
subq -0x20(%rbp), %rdi
callq 0x4b50
movq -0x1e0(%rbp), %rsi
cvtss2sd %xmm0, %xmm0
leaq 0x202d6(%rip), %rdi     # 0x758cc
movb $0x1, %al
callq 0x3130
leaq -0x120(%rbp), %rdi
movl -0x194(%rbp), %edx
leaq 0x202d9(%rip), %rsi     # 0x758ea
movb $0x0, %al
callq 0x33f0
leaq -0x1d8(%rbp), %rax
leaq 0x21434(%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 -0x120(%rbp), %rdi
leaq -0x1d8(%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 0x11330
leaq -0x1d8(%rbp), %rax
leaq 0x213dc(%rip), %rdi     # 0x76a5a
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
jmp 0x553ed
nopw %cs:(%rax,%rax)