// File: /workspace/github_c_makefile_star2_O2/SimpleDoger[P]Darknet_CPU_Only/deconvolutional_layer.c
// Function: forward_deconvolutional_layer
void forward_deconvolutional_layer(const layer l, network net)
{
    int i;

    int m = l.size*l.size*l.n;
    int n = l.h*l.w;
    int k = l.c;

    fill_cpu(l.outputs*l.batch, 0, l.output, 1);

    for(i = 0; i < l.batch; ++i){
        float *a = l.weights;
        float *b = net.input + i*l.c*l.h*l.w;
        float *c = net.workspace;

        gemm_cpu(1,0,m,n,k,1,a,m,b,n,0,c,n);

        col2im_cpu(net.workspace, l.out_c, l.out_h, l.out_w, l.size, l.stride, l.pad, l.output+i*l.outputs);
    }
    if (l.batch_normalize) {
        forward_batchnorm_layer(l, net);
    } else {
        add_bias(l.output, l.biases, l.batch, l.n, l.out_w*l.out_h);
    }
    activate_array(l.output, l.batch*l.n*l.out_w*l.out_h, l.activation);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x70(%rsp), %rcx
movl 0x90(%rcx), %eax
movl %eax, 0x1c(%rsp)
movl %eax, %edx
imull %edx, %edx
movl 0x84(%rcx), %eax
movl %eax, 0xc(%rsp)
imull %eax, %edx
movq %rdx, 0x30(%rsp)
movl 0x6c(%rcx), %ebx
movl 0x70(%rcx), %ebp
movl %ebp, %eax
imull %ebx, %eax
movq %rax, 0x28(%rsp)
movl 0x74(%rcx), %r14d
movl 0x48(%rcx), %r15d
movl 0x58(%rcx), %eax
movl %r15d, %edi
movl %eax, 0x10(%rsp)
imull %eax, %edi
movq 0x268(%rcx), %rsi
pushq $0x1
popq %rdx
xorps %xmm0, %xmm0
movq %rsi, 0x20(%rsp)
callq 0x1b449
movl %r14d, 0x14(%rsp)
imull %r14d, %ebx
imull %ebp, %ebx
movl %ebx, 0x18(%rsp)
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpl %r15d, %ebp
jge 0x5525
leaq 0x70(%rsp), %r12
movq 0x250(%r12), %r9
movslq %r13d, %r13
leaq (,%r13,4), %rax
leaq 0x510(%rsp), %rcx
addq 0xd8(%rcx), %rax
movl %r15d, %ebx
movq 0xf0(%rcx), %r15
subq $0x8, %rsp
xorps %xmm1, %xmm1
pushq $0x1
popq %rdi
xorl %esi, %esi
movq 0x38(%rsp), %rdx
movq 0x30(%rsp), %rcx
movl 0x1c(%rsp), %r8d
movss 0x46b46(%rip), %xmm0    # 0x4c008
pushq %rcx
pushq %r15
pushq %rcx
pushq %rax
pushq %rdx
callq 0x3831
addq $0x30, %rsp
movl 0x80(%r12), %esi
movl 0x78(%r12), %edx
movl 0x7c(%r12), %ecx
movl 0x98(%r12), %r9d
movl 0xa8(%r12), %eax
movslq %r14d, %r14
movq 0x20(%rsp), %rdi
leaq (%rdi,%r14,4), %r10
movq %r15, %rdi
movl %ebx, %r15d
movl 0x1c(%rsp), %r8d
pushq %r10
pushq %rax
callq 0x1a969
popq %rax
popq %rcx
incl %ebp
addl 0x18(%rsp), %r13d
addl 0x10(%rsp), %r14d
jmp 0x5465
leaq 0x70(%rsp), %r13
cmpl $0x0, 0x40(%r13)
je 0x5584
subq $0x5b0, %rsp            # imm = 0x5B0
movl $0x94, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x4a0(%rsp), %rdi
pushq $0x22
popq %rcx
leaq 0xac0(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x2fc4e
addq $0x5b0, %rsp            # imm = 0x5B0
movq 0x268(%r13), %r12
movl 0x48(%r13), %ebx
movl 0x78(%r13), %ebp
movl 0x84(%r13), %r15d
movl 0x7c(%r13), %r14d
jmp 0x55b5
movq 0x230(%r13), %rsi
movl 0x78(%r13), %ebp
movl 0x7c(%r13), %r14d
movl %ebp, %r8d
imull %r14d, %r8d
movq 0x20(%rsp), %r12
movq %r12, %rdi
movl %r15d, %edx
movl %r15d, %ebx
movl 0xc(%rsp), %r15d
movl %r15d, %ecx
callq 0x6cd3
imull %r14d, %ebp
imull %ebx, %r15d
imull %ebp, %r15d
movl 0x4(%r13), %edx
movq %r12, %rdi
movl %r15d, %esi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a4f8