// File: /workspace/github_c_makefile_star2_O1/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 0x2f9e4
movq %rax, %rbx
movq 0x20(%rax), %rsi
movl $0x94, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
callq 0x10ce9
movl %ebp, 0x4a8(%rsp)
testl %ebp, %ebp
jle 0x5231c
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 0x1529e
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0x10c8(%rip), %xmm0     # 0x53234
callq 0x18a00
movl $0x64, %r13d
movl 0x4a4(%rsp), %ebx
callq 0x34f0
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 0x15841
callq 0x34f0
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 0x16d91
movq 0x4e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
movss 0xe0d(%rip), %xmm0      # 0x53008
movss 0x106d(%rip), %xmm1     # 0x53270
movaps %xmm1, %xmm2
callq 0x1a8a2
callq 0x34f0
movl %r14d, %ecx
subl 0x4d0(%rsp), %ecx
cltd
idivl %ecx
movl %r14d, %r15d
movq %rbp, %r14
movl %edx, %ebp
callq 0x34f0
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 0x17132
movq 0x4e0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4d0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
decl %r13d
jne 0x5217e
movq %rbp, %rdi
leaq 0x72a9(%rip), %rsi      # 0x59557
movq 0x4c8(%rsp), %rdx
movl 0x4ac(%rsp), %ebx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3430
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbp, %rdi
callq 0x17a72
movq 0x4c0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x4b0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x15b37
incl %ebx
cmpl 0x4a8(%rsp), %ebx
movl 0x4a0(%rsp), %r15d
jne 0x5212c
addq $0x5d8, %rsp            # imm = 0x5D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq