// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x4b0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpl $0x13, (%rax)
jne 0x4b31b
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0xd8(%rcx), %rsi
movq 0x268(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x8(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x268(%rax), %rsi
movq 0x2c0(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
movq -0x10(%rbp), %rax
cmpl $0x0, 0xf8(%rax)
je 0x4b4a6
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movl 0x48(%rax), %esi
movl 0x80(%rax), %edx
movl 0x78(%rax), %ecx
imull 0x7c(%rax), %ecx
movq 0x290(%rax), %r8
callq 0x2f0c0
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movq 0x290(%rax), %rsi
movl 0x48(%rax), %edx
movl 0x80(%rax), %ecx
movl 0x78(%rax), %r8d
imull 0x7c(%rax), %r8d
movq 0x298(%rax), %r9
callq 0x2f1b0
movq -0x8(%rbp), %rax
movl 0x80(%rax), %edi
movq 0x2b0(%rax), %rsi
movss 0x2a16d(%rip), %xmm0    # 0x75530
movl $0x1, %edx
callq 0x2f6f0
movq -0x8(%rbp), %rax
movl 0x80(%rax), %edi
movq 0x290(%rax), %rsi
movq 0x2b0(%rax), %rcx
movss 0x2a13f(%rip), %xmm0    # 0x7552c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x8(%rbp), %rax
movl 0x80(%rax), %edi
movq 0x2b8(%rax), %rsi
movss 0x2a11c(%rip), %xmm0    # 0x75530
movl $0x1, %edx
callq 0x2f6f0
movq -0x8(%rbp), %rax
movl 0x80(%rax), %edi
movq 0x298(%rax), %rsi
movq 0x2b8(%rax), %rcx
movss 0x2a0ee(%rip), %xmm0    # 0x7552c
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f680
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movq 0x290(%rax), %rsi
movq 0x298(%rax), %rdx
movl 0x48(%rax), %ecx
movl 0x80(%rax), %r8d
movl 0x78(%rax), %r9d
imull 0x7c(%rax), %r9d
callq 0x2f440
movq -0x8(%rbp), %rax
movl 0x58(%rax), %edi
imull 0x48(%rax), %edi
movq 0x268(%rax), %rsi
movq 0x2c8(%rax), %rcx
movl $0x1, %r8d
movl %r8d, %edx
callq 0x2f960
jmp 0x4b4d7
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movq 0x2b0(%rax), %rsi
movq 0x2b8(%rax), %rdx
movl 0x48(%rax), %ecx
movl 0x80(%rax), %r8d
movl 0x78(%rax), %r9d
imull 0x7c(%rax), %r9d
callq 0x2f440
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movq 0x240(%rax), %rsi
movl 0x48(%rax), %edx
movl 0x80(%rax), %ecx
movl 0x78(%rax), %r8d
imull 0x7c(%rax), %r8d
callq 0x88e0
movq -0x8(%rbp), %rax
movq 0x268(%rax), %rdi
movq 0x230(%rax), %rsi
movl 0x48(%rax), %edx
movl 0x80(%rax), %ecx
movl 0x78(%rax), %r8d
imull 0x7c(%rax), %r8d
callq 0x8840
addq $0x10, %rsp
popq %rbp
retq
nop