// File: /workspace/github_c_makefile_star2_O1/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 $0x78, %rsp
leaq 0xb0(%rsp), %rsi
movl 0x6c(%rsi), %edi
movl 0x70(%rsi), %r8d
movl 0xa8(%rsi), %edx
movl 0x90(%rsi), %eax
movl %eax, (%rsp)
negl %eax
xorl %ecx, %ecx
movq %rdx, 0x68(%rsp)
negl %edx
sbbl %ecx, %ecx
orl %eax, %ecx
movq %rdi, 0x30(%rsp)
leal (%rcx,%rdi), %eax
movl 0x98(%rsi), %edi
cltd
idivl %edi
movl %eax, 0x10(%rsp)
movl %r8d, 0x4(%rsp)
addl %r8d, %ecx
movl %ecx, %eax
cltd
movl %edi, 0x24(%rsp)
idivl %edi
movl %eax, %r13d
movslq 0x48(%rsi), %rcx
movq %rcx, 0x8(%rsp)
testq %rcx, %rcx
jle 0x37eef
leaq 0xb0(%rsp), %rax
movslq 0x58(%rax), %r14
movq 0x230(%rax), %rbp
movq 0x268(%rax), %rbx
movq %r14, %r15
shlq $0x2, %r15
movq 0x8(%rsp), %r12
movl %r14d, %edi
movq %rbp, %rsi
movl $0x1, %edx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x2879c
addq %r15, %rbx
decq %r12
jne 0x37ece
cmpl $0x0, 0x8(%rsp)
jle 0x3806e
movl 0x10(%rsp), %eax
incl %eax
incl %r13d
imull %eax, %r13d
leaq 0x550(%rsp), %rax
movl (%rsp), %ecx
movl %ecx, %edi
imull %edi, %edi
movq 0xd8(%rax), %rcx
movq %rcx, 0x60(%rsp)
movq 0xf0(%rax), %rax
movq %rax, 0x40(%rsp)
leaq 0xb0(%rsp), %rax
movl 0x74(%rax), %ecx
movl 0x84(%rax), %edx
movl 0x4(%rsp), %esi
imull 0x30(%rsp), %esi
imull %ecx, %esi
movl %esi, 0x1c(%rsp)
movq 0x268(%rax), %rsi
movq %rsi, 0x38(%rsp)
movslq 0x58(%rax), %rsi
movl %ecx, 0x20(%rsp)
imull %ecx, %edi
movq 0x250(%rax), %rax
movq %rax, 0x50(%rsp)
movl %r13d, %eax
movq %rax, 0x48(%rsp)
movq %rdi, 0x10(%rsp)
movl %edi, %eax
movl %edx, 0x2c(%rsp)
imull %edx, %eax
movl %eax, 0x28(%rsp)
shlq $0x2, %rsi
movq %rsi, 0x58(%rsp)
xorl %ecx, %ecx
movq 0x50(%rsp), %rbx
movl 0x1c(%rsp), %eax
movq %rcx, 0x70(%rsp)
imull %ecx, %eax
cltq
movq 0x60(%rsp), %rcx
leaq (%rcx,%rax,4), %rdi
movl 0x20(%rsp), %esi
movq 0x30(%rsp), %rdx
movl 0x4(%rsp), %ecx
movl (%rsp), %r8d
movl 0x24(%rsp), %r9d
pushq 0x40(%rsp)
pushq 0x70(%rsp)
callq 0x278bf
addq $0x10, %rsp
testl %r13d, %r13d
movss 0x1b022(%rip), %xmm0    # 0x53008
movq 0x10(%rsp), %r8
jle 0x38051
xorl %ebp, %ebp
movq 0x48(%rsp), %r14
movq 0x40(%rsp), %r15
movq 0x38(%rsp), %r12
movslq %ebp, %rbp
leaq (%rbx,%rbp,4), %r9
subq $0x8, %rsp
xorl %edi, %edi
xorl %esi, %esi
movl 0x34(%rsp), %edx
movl $0x1, %ecx
movss 0x1afea(%rip), %xmm1    # 0x53008
pushq %r13
pushq %r12
pushq %r13
pushq %r15
pushq %r8
callq 0xdd4d
movq 0x40(%rsp), %r8
movss 0x1afce(%rip), %xmm0    # 0x53008
movl 0x58(%rsp), %edx
addq $0x30, %rsp
addl %edx, %ebp
addq $0x4, %r12
addq $0x4, %r15
decq %r14
jne 0x37ffe
movq 0x70(%rsp), %rcx
incq %rcx
movq 0x58(%rsp), %rax
addq %rax, 0x38(%rsp)
cmpq 0x8(%rsp), %rcx
jne 0x37f9d
leaq 0xb0(%rsp), %rax
movq 0x268(%rax), %rdi
movq 0x8(%rsp), %rsi
imull 0x58(%rax), %esi
movl 0x4(%rax), %edx
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x275e5