// File: /workspace/github_c_makefile_star2_O1/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), %r15
leaq 0x50(%rsp), %rbx
cmpl $0x13, (%rbx)
jne 0x3a3a5
movl 0x48(%rbx), %edi
imull 0x58(%rbx), %edi
movq 0xd8(%r15), %rsi
movq 0x268(%rbx), %rcx
movl $0x1, %edx
movl $0x1, %r8d
callq 0x2879c
movl 0x48(%rbx), %r13d
movl 0x58(%rbx), %ebp
imull %r13d, %ebp
movq 0x268(%rbx), %r14
movq 0x2c0(%rbx), %rcx
movl %ebp, %edi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %r8d
callq 0x2879c
cmpl $0x0, 0xf8(%r15)
je 0x3a4fb
movl 0x7c(%rbx), %r15d
movl 0x80(%rbx), %r12d
imull 0x78(%rbx), %r15d
movq 0x290(%rbx), %r8
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebp, (%rsp)
movq %r8, %rbp
callq 0x2817b
movq 0x298(%rbx), %r9
movq %r9, 0x10(%rsp)
movq %r14, %rdi
movq %rbp, %rsi
movq %rbp, 0x8(%rsp)
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
callq 0x2821f
movl %r13d, 0x4(%rsp)
movq 0x2b0(%rbx), %r13
movss 0x1d824(%rip), %xmm0    # 0x57c6c
movl %r12d, %edi
movq %r13, %rsi
movl $0x1, %edx
callq 0x28619
movss 0x1c128(%rip), %xmm0    # 0x56588
movl %r12d, %edi
movq %rbp, %rsi
movl $0x1, %edx
movq %r13, %rcx
movl $0x1, %r8d
callq 0x285e9
movq 0x2b8(%rbx), %r13
movl %r12d, %edi
movss 0x1d7e1(%rip), %xmm0    # 0x57c6c
movq %r13, %rsi
movl $0x1, %edx
callq 0x28619
movl %r12d, %edi
movss 0x1c0e5(%rip), %xmm0    # 0x56588
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
movl $0x1, %edx
movq %r13, %rcx
movl 0x4(%rsp), %r13d
movl $0x1, %r8d
callq 0x285e9
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %rbp, %rdx
movl %r13d, %ecx
movl %r12d, %r8d
movl %r15d, %r9d
callq 0x28403
movq 0x2c8(%rbx), %rcx
movl (%rsp), %edi
movq %r14, %rsi
movl $0x1, %edx
movl $0x1, %r8d
callq 0x2879c
jmp 0x3a524
movq 0x2b0(%rbx), %rsi
movq 0x2b8(%rbx), %rdx
movl 0x7c(%rbx), %r9d
movl 0x80(%rbx), %r8d
imull 0x78(%rbx), %r9d
movq %r14, %rdi
movl %r13d, %ecx
callq 0x28403
movq 0x240(%rbx), %rsi
movl 0x7c(%rbx), %ebp
movl 0x80(%rbx), %r15d
imull 0x78(%rbx), %ebp
movq %r14, %rdi
movl %r13d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x10a08
movq 0x230(%rbx), %rsi
movq %r14, %rdi
movl %r13d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10996