// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/image.c
// Function: collapse_images_vert
image collapse_images_vert(image *ims, int n)
{
    int color = 1;
    int border = 1;
    int h,w,c;
    w = ims[0].w;
    h = (ims[0].h + border) * n - border;
    c = ims[0].c;
    if(c != 3 || !color){
        w = (w+border)*c - border;
        c = 1;
    }

    image filters = make_image(w, h, c);
    int i,j;
    for(i = 0; i < n; ++i){
        int h_offset = i*(ims[0].h+border);
        image copy = copy_image(ims[i]);
        //normalize_image(copy);
        if(c == 3 && color){
            embed_image(copy, filters, 0, h_offset);
        }
        else{
            for(j = 0; j < copy.c; ++j){
                int w_offset = j*(ims[0].w+border);
                image layer = get_image_layer(copy, j);
                embed_image(layer, filters, w_offset, h_offset);
                free_image(layer);
            }
        }
        free_image(copy);
    }
    return filters;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movl (%rsi), %eax
movl 0x4(%rsi), %ecx
incl %ecx
imull %edx, %ecx
decl %ecx
movq %rsi, 0x60(%rsp)
movl 0x8(%rsi), %edi
leal 0x1(%rax), %edx
imull %edi, %edx
decl %edx
xorl %esi, %esi
movl %edi, 0x4c(%rsp)
cmpl $0x3, %edi
sete %sil
leal 0x1(%rsi,%rsi), %esi
cmovel %eax, %edx
movl %ecx, 0x4(%rbx)
movl %edx, (%rbx)
movl %esi, 0x8(%rbx)
imull %esi, %ecx
imull %edx, %ecx
movslq %ecx, %rdi
movl $0x4, %esi
callq 0x3250
movq %rbx, 0x40(%rsp)
movq %rax, 0x10(%rbx)
testl %ebp, %ebp
jle 0x1b69b
movl %ebp, %eax
movq %rax, 0x68(%rsp)
xorl %edx, %edx
movq 0x60(%rsp), %rcx
movl 0x4(%rcx), %eax
incl %eax
movl %edx, %r15d
imull %eax, %r15d
movq %rdx, 0x70(%rsp)
leaq (%rdx,%rdx,2), %rax
movq 0x10(%rcx,%rax,8), %r14
movups (%rcx,%rax,8), %xmm0
movl (%rcx,%rax,8), %edx
movl 0x4(%rcx,%rax,8), %esi
movl 0x8(%rcx,%rax,8), %ebx
movaps %xmm0, 0xa0(%rsp)
movl %esi, 0x50(%rsp)
movl %esi, %eax
movl %edx, 0x54(%rsp)
imull %edx, %eax
movl %eax, 0x3c(%rsp)
imull %ebx, %eax
movslq %eax, %r12
movl $0x4, %esi
movq %r12, %rdi
callq 0x3250
movq %rax, 0xb0(%rsp)
shlq $0x2, %r12
movq %rax, 0x58(%rsp)
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x32b0
cmpl $0x3, 0x4c(%rsp)
jne 0x1b592
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x28(%rsp)
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
movl %r15d, %esi
callq 0x162c2
jmp 0x1b679
testl %ebx, %ebx
jle 0x1b679
movslq 0x3c(%rsp), %r12
movl %r12d, %eax
shlq $0x2, %rax
movq %rax, 0x78(%rsp)
movl %ebx, %eax
movq %rax, 0x80(%rsp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x60(%rsp), %rax
movl (%rax), %ebp
movl 0x50(%rsp), %eax
movl %eax, 0x8c(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x88(%rsp)
movl $0x1, 0x90(%rsp)
movl $0x4, %esi
movq %r12, %rdi
callq 0x3250
movq %rax, %r14
movq %rax, 0x98(%rsp)
testl %r12d, %r12d
jle 0x1b618
movslq %r13d, %rax
movq 0x58(%rsp), %rcx
leaq (%rcx,%rax,4), %rsi
movq %r14, %rdi
movq 0x78(%rsp), %rdx
callq 0x32b0
incl %ebp
movl %ebx, %edi
imull %ebp, %edi
movq 0x40(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x28(%rsp)
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x88(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %r15d, %esi
callq 0x162c2
testq %r14, %r14
je 0x1b663
movq %r14, %rdi
callq 0x3040
incq %rbx
addl 0x3c(%rsp), %r13d
cmpq %rbx, 0x80(%rsp)
jne 0x1b5ba
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1b688
callq 0x3040
movq 0x70(%rsp), %rdx
incq %rdx
cmpq 0x68(%rsp), %rdx
jne 0x1b4d4
movq 0x40(%rsp), %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq