// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/darknet.c
// Function: mkimg
void mkimg(char *cfgfile, char *weightfile, int h, int w, int num, char *prefix)
{
    network *net = load_network(cfgfile, weightfile, 0);
    image *ims = get_weights(net->layers[0]);
    int n = net->layers[0].n;
    int z;
    for(z = 0; z < num; ++z){
        image im = make_image(h, w, 3);
        fill_image(im, .5);
        int i;
        for(i = 0; i < 100; ++i){
            image r = copy_image(ims[rand()%n]);
            rotate_image_cw(r, rand()%4);
            random_distort_image(r, 1, 1.5, 1.5);
            int dx = rand()%(w-r.w);
            int dy = rand()%(h-r.h);
            ghost_image(r, im, dx, dy);
            free_image(r);
        }
        char buff[256];
        sprintf(buff, "%s/gen_%d", prefix, z);
        save_image(im, buff);
        free_image(im);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5d8, %rsp            # imm = 0x5D8
movq %r9, 0x4c8(%rsp)
movl %r8d, %ebp
movl %ecx, %r14d
movl %edx, %r15d
xorl %edx, %edx
callq 0x316bc
movq %rax, %rbx
movq 0x20(%rax), %rsi
movl $0x94, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x11671
movl %ebp, 0x4a8(%rsp)
testl %ebp, %ebp
jle 0x54829
movq %rax, %r12
movq 0x20(%rbx), %rax
movl 0x84(%rax), %eax
movl %eax, 0x4a4(%rsp)
leaq 0x4d0(%rsp), %rbp
xorl %ebx, %ebx
movl %r15d, 0x4a0(%rsp)
movl %ebx, 0x4ac(%rsp)
leaq 0x4b0(%rsp), %rdi
movl %r15d, %esi
movl %r14d, %edx
movl $0x3, %ecx
callq 0x15d43
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0xbeb(%rip), %xmm0      # 0x55264
callq 0x1918e
movl $0x64, %r13d
movl 0x4a4(%rsp), %ebx
callq 0x34e0
cltd
idivl %ebx
movslq %edx, %rax
leaq (%rax,%rax,2), %rax
movq 0x10(%r12,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
movups (%r12,%rax,8), %xmm0
movups %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x1626c
callq 0x34e0
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x4, %ecx
subl %ecx, %eax
movq 0x4e0(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %eax, %edi
callq 0x1766f
movq 0x4e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0x900(%rip), %xmm0      # 0x55008
movss 0xb8c(%rip), %xmm1      # 0x5529c
movaps %xmm1, %xmm2
callq 0x1b0ee
callq 0x34e0
movl %r14d, %ecx
subl 0x4d0(%rsp), %ecx
cltd
idivl %ecx
movl %r14d, %r15d
movq %rbp, %r14
movl %edx, %ebp
callq 0x34e0
movl 0x4a0(%rsp), %ecx
subl 0x4d4(%rsp), %ecx
cltd
idivl %ecx
movq 0x4c0(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x4e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebp, %edi
movq %r14, %rbp
movl %r15d, %r14d
movl %edx, %esi
callq 0x17a03
movq 0x4e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1657b
decl %r13d
jne 0x5468b
movq %rbp, %rdi
leaq 0x6efc(%rip), %rsi      # 0x5b6b7
movq 0x4c8(%rsp), %rdx
movl 0x4ac(%rsp), %ebx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3420
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x18301
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x1657b
incl %ebx
cmpl 0x4a8(%rsp), %ebx
movl 0x4a0(%rsp), %r15d
jne 0x54639
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq