// File: /workspace/github_c_makefile_star2_O3/SimpleDoger[P]Darknet_CPU_Only/batchnorm_layer.c
// Function: forward_batchnorm_layer
void forward_batchnorm_layer(layer l, network net)
{
    if(l.type == BATCHNORM) copy_cpu(l.outputs*l.batch, net.input, 1, l.output, 1);
    copy_cpu(l.outputs*l.batch, l.output, 1, l.x, 1);
    if(net.train){
        mean_cpu(l.output, l.batch, l.out_c, l.out_h*l.out_w, l.mean);
        variance_cpu(l.output, l.mean, l.batch, l.out_c, l.out_h*l.out_w, l.variance);

        scal_cpu(l.out_c, .99, l.rolling_mean, 1);
        axpy_cpu(l.out_c, .01, l.mean, 1, l.rolling_mean, 1);
        scal_cpu(l.out_c, .99, l.rolling_variance, 1);
        axpy_cpu(l.out_c, .01, l.variance, 1, l.rolling_variance, 1);

        normalize_cpu(l.output, l.mean, l.variance, l.batch, l.out_c, l.out_h*l.out_w);   
        copy_cpu(l.outputs*l.batch, l.output, 1, l.x_norm, 1);
    } else {
        normalize_cpu(l.output, l.rolling_mean, l.rolling_variance, l.batch, l.out_c, l.out_h*l.out_w);
    }
    scale_bias(l.output, l.scales, l.batch, l.out_c, l.out_h*l.out_w);
    add_bias(l.output, l.biases, l.batch, l.out_c, l.out_h*l.out_w);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x4f0(%rsp), %rbx
leaq 0x50(%rsp), %rbp
movl 0x48(%rbp), %r13d
cmpl $0x13, (%rbp)
movl 0x58(%rbp), %r15d
jne 0x3c683
imull %r13d, %r15d
movq 0xd8(%rbx), %rsi
movq 0x268(%rbp), %r14
movl %r15d, %edi
movl $0x1, %edx
movq %r14, %rcx
movl $0x1, %r8d
callq 0x29fe0
jmp 0x3c68e
movq 0x268(%rbp), %r14
imull %r13d, %r15d
movq 0x2c0(%rbp), %rcx
movl %r15d, %edi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %r8d
callq 0x29fe0
cmpl $0x0, 0xf8(%rbx)
je 0x3c7d5
movl %r15d, 0xc(%rsp)
movl 0x7c(%rbp), %r15d
movl 0x80(%rbp), %r12d
imull 0x78(%rbp), %r15d
movl %r13d, 0x8(%rsp)
movq 0x290(%rbp), %r13
movq %r14, %rdi
movl 0x8(%rsp), %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %r13, %r8
callq 0x297db
movq 0x298(%rbp), %r9
movq %r9, 0x10(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movl %r15d, %r8d
callq 0x29876
movq 0x2b0(%rbp), %rbx
movss 0x1d636(%rip), %xmm0    # 0x59d54
movl %r12d, %edi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x29d61
movss 0x1bf22(%rip), %xmm0    # 0x58658
movl %r12d, %edi
movq %r13, %rsi
movl $0x1, %edx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x29d31
movq 0x2b8(%rbp), %rbx
movl %r12d, %edi
movss 0x1d5f3(%rip), %xmm0    # 0x59d54
movq %rbx, %rsi
movl $0x1, %edx
callq 0x29d61
movl %r12d, %edi
movss 0x1bedf(%rip), %xmm0    # 0x58658
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
movl $0x1, %edx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x29d31
movq %r14, %rdi
movq %r13, %rsi
movl 0x8(%rsp), %r13d
movq %rbp, %rdx
leaq 0x50(%rsp), %rbp
movl %r13d, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x29a4f
movq 0x2c8(%rbp), %rcx
movl 0xc(%rsp), %edi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %r8d
callq 0x29fe0
jmp 0x3c804
movq 0x2b0(%rbp), %rsi
movq 0x2b8(%rbp), %rdx
movl 0x7c(%rbp), %r15d
movl 0x80(%rbp), %r12d
imull 0x78(%rbp), %r15d
movq %r14, %rdi
movl %r13d, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x29a4f
movq 0x240(%rbp), %rsi
movq %r14, %rdi
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
callq 0x11390
movq 0x230(%rbp), %rsi
movq %r14, %rdi
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1131e