// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/local_layer.c
// Function: forward_local_layer
void forward_local_layer(const local_layer l, network net)
{
    int out_h = local_out_height(l);
    int out_w = local_out_width(l);
    int i, j;
    int locations = out_h * out_w;

    for(i = 0; i < l.batch; ++i){
        copy_cpu(l.outputs, l.biases, 1, l.output + i*l.outputs, 1);
    }

    for(i = 0; i < l.batch; ++i){
        float *input = net.input + i*l.w*l.h*l.c;
        im2col_cpu(input, l.c, l.h, l.w, 
                l.size, l.stride, l.pad, net.workspace);
        float *output = l.output + i*l.outputs;
        for(j = 0; j < locations; ++j){
            float *a = l.weights + j*l.size*l.size*l.c*l.n;
            float *b = net.workspace + j;
            float *c = output + j;

            int m = l.n;
            int n = 1;
            int k = l.size*l.size*l.c;

            gemm(0,0,m,n,k,1,a,k,b,locations,1,c,locations);
        }
    }
    activate_array(l.output, l.outputs*l.batch, l.activation);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
leaq 0xc0(%rsp), %r10
movl 0x6c(%r10), %edx
movl 0x70(%r10), %r8d
movl 0xa8(%r10), %ecx
movl 0x90(%r10), %eax
movl %eax, (%rsp)
negl %eax
xorl %esi, %esi
movq %rcx, 0x78(%rsp)
negl %ecx
sbbl %esi, %esi
orl %eax, %esi
movq %rdx, 0x30(%rsp)
leal (%rsi,%rdx), %eax
movl 0x98(%r10), %r9d
cltd
idivl %r9d
movl %eax, %ecx
movl %r8d, 0x4(%rsp)
addl %r8d, %esi
movl %esi, %eax
cltd
movl %r9d, 0x1c(%rsp)
idivl %r9d
movslq 0x48(%r10), %r15
testq %r15, %r15
jle 0x3a255
movl %eax, %r13d
incl %ecx
incl %r13d
imull %ecx, %r13d
movslq 0x58(%r10), %rbx
movq 0x230(%r10), %r14
movq 0x268(%r10), %rbp
movq %rbx, %r12
shlq $0x2, %r12
movq %r15, 0x28(%rsp)
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
movq %rbp, %rcx
movl $0x1, %r8d
callq 0x29fe0
addq %r12, %rbp
decq %r15
jne 0x3a08e
movq 0x28(%rsp), %r15
testl %r15d, %r15d
leaq 0xc0(%rsp), %r10
jle 0x3a255
movl (%rsp), %eax
movl %eax, %edi
imull %edi, %edi
leaq 0x560(%rsp), %rcx
movq 0xd8(%rcx), %rax
movq %rax, 0x70(%rsp)
movq 0xf0(%rcx), %rax
movq %rax, 0x38(%rsp)
movl 0x74(%r10), %edx
movl 0x84(%r10), %esi
movl 0x4(%rsp), %eax
imull 0x30(%rsp), %eax
imull %edx, %eax
movl %eax, 0x14(%rsp)
movq 0x268(%r10), %rax
movslq 0x58(%r10), %rcx
movl %edx, 0x18(%rsp)
imull %edx, %edi
movq 0x250(%r10), %rdx
movq %rdx, 0x68(%rsp)
movl %r13d, %edx
movq %rdx, 0x58(%rsp)
movq %rdi, 0x40(%rsp)
movl %edi, %edx
movl %esi, 0x24(%rsp)
imull %esi, %edx
movl %edx, 0x20(%rsp)
movq %rcx, 0x48(%rsp)
shlq $0x2, %rcx
movq %rcx, 0x60(%rsp)
xorl %ecx, %ecx
movq %rax, 0x50(%rsp)
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rbx
movl 0x14(%rsp), %eax
movq %rcx, 0x80(%rsp)
imull %ecx, %eax
cltq
movq 0x70(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
movl 0x18(%rsp), %esi
movq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movl 0x1c(%rsp), %r9d
pushq 0x38(%rsp)
pushq 0x80(%rsp)
callq 0x28f73
addq $0x10, %rsp
testl %r13d, %r13d
movss 0x1ae5b(%rip), %xmm0    # 0x55008
movq 0x40(%rsp), %r8
jle 0x3a219
xorl %r15d, %r15d
movq 0x58(%rsp), %r14
movq 0x38(%rsp), %rbp
movq 0x8(%rsp), %r12
movslq %r15d, %r15
leaq (%rbx,%r15,4), %r9
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
movl 0x2c(%rsp), %edx
movl $0x1, %ecx
movss 0x1ae22(%rip), %xmm1    # 0x55008
pushq %r13
pushq %r12
pushq %r13
pushq %rbp
pushq %r8
callq 0xe50d
movq 0x70(%rsp), %r8
movss 0x1ae07(%rip), %xmm0    # 0x55008
movl 0x50(%rsp), %edx
addq $0x30, %rsp
addl %edx, %r15d
addq $0x4, %r12
addq $0x4, %rbp
decq %r14
jne 0x3a1c6
movq 0x80(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %rax
addq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %r15
cmpq %r15, %rcx
jne 0x3a15e
leaq 0xc0(%rsp), %r10
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
jmp 0x3a260
movq 0x268(%r10), %rdi
movl 0x58(%r10), %eax
imull %eax, %r15d
movl 0x4(%r10), %edx
movl %r15d, %esi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x28c99