// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x500, %rsp            # imm = 0x500
leaq 0x4b0(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x10(%rbp), %rsi
movq %rsi, -0x68(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x473f0
movq -0x68(%rbp), %rsi
movl %eax, -0x14(%rbp)
movq %rsp, %rdi
movl $0x94, %ecx
rep  movsq (%rsi), %es:(%rdi)
callq 0x47440
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x68(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x48(%rcx), %eax
jge 0x47826
movq -0x68(%rbp), %rdx
movl 0x58(%rdx), %edi
movq 0x230(%rdx), %rsi
movq 0x268(%rdx), %rcx
movl -0x1c(%rbp), %eax
imull 0x58(%rdx), %eax
cltq
shlq $0x2, %rax
addq %rax, %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x477dc
movl $0x0, -0x1c(%rbp)
movq -0x68(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl 0x48(%rcx), %eax
jge 0x479c9
movq -0x68(%rbp), %r10
movq -0x70(%rbp), %rax
movq 0xd8(%rax), %rcx
movl -0x1c(%rbp), %edx
imull 0x70(%r10), %edx
imull 0x6c(%r10), %edx
imull 0x74(%r10), %edx
movslq %edx, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl 0x74(%r10), %esi
movl 0x6c(%r10), %edx
movl 0x70(%r10), %ecx
movl 0x90(%r10), %r8d
movl 0x98(%r10), %r9d
movl 0xa8(%r10), %r10d
movq 0xf0(%rax), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2e650
movq -0x68(%rbp), %rdx
movq 0x268(%rdx), %rax
movl -0x1c(%rbp), %ecx
imull 0x58(%rdx), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x479b9
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %rax
movq 0x250(%rcx), %rdx
movl -0x20(%rbp), %esi
imull 0x90(%rcx), %esi
imull 0x90(%rcx), %esi
imull 0x74(%rcx), %esi
imull 0x84(%rcx), %esi
movslq %esi, %rsi
shlq $0x2, %rsi
addq %rsi, %rdx
movq %rdx, -0x40(%rbp)
movq 0xf0(%rax), %rax
movslq -0x20(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movslq -0x20(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rax
movq %rax, -0x50(%rbp)
movl 0x84(%rcx), %eax
movl %eax, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
movl 0x90(%rcx), %eax
imull 0x90(%rcx), %eax
imull 0x74(%rcx), %eax
movl %eax, -0x5c(%rbp)
movl -0x54(%rbp), %edx
movl -0x58(%rbp), %ecx
movl -0x5c(%rbp), %r8d
movq -0x40(%rbp), %r9
movl -0x5c(%rbp), %r14d
movq -0x48(%rbp), %rbx
movl -0x24(%rbp), %r11d
movq -0x50(%rbp), %r10
movl -0x24(%rbp), %eax
xorl %esi, %esi
movss 0x29682(%rip), %xmm1    # 0x7100c
movl %esi, %edi
movaps %xmm1, %xmm0
movl %r14d, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movl %eax, 0x20(%rsp)
callq 0x3aa0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x478cd
jmp 0x479bb
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4782d
movq -0x68(%rbp), %rax
movq 0x268(%rax), %rdi
movl 0x58(%rax), %esi
imull 0x48(%rax), %esi
movl 0x4(%rax), %edx
callq 0x2dfa0
addq $0x500, %rsp            # imm = 0x500
popq %rbx
popq %r14
popq %rbp
retq
nop