// File: /workspace/github_cpp_makefile_star2_O1/btbujiangjun[P]abcdl/src/fnn/Layer.cpp
// Function: abcdl::fnn::BatchNormalizationLayer::forward(abcdl::fnn::Layer*)
void BatchNormalizationLayer::forward(Layer* pre_layer){
    auto input = pre_layer->get_activate_data();
    CHECK(input.cols() == this->_weight.cols());
    _means = input.mean(abcdl::algebra::Axis_type::COL);
    _variances = (input - _means).pow(2).mean(abcdl::algebra::Axis_type::COL);
    _scales = (_variances + _epsilon).sqrt().inverse();
    _normalize = (input - _means) * _scales;
    this->_activate_data = _normalize * this->_weight.get_row(0) + this->_weight.get_row(1); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0xbc7c
movq 0xa0(%r14), %r12
movq %r12, -0x18(%r15)
movq 0xa8(%r14), %r13
movq %r13, -0x10(%r15)
imulq %r13, %r12
movq %r12, %rax
shrq $0x3e, %rax
shlq $0x2, %r12
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r12, %rdi
callq 0x9030
movq %rax, -0x8(%r15)
movq 0xb0(%r14), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x92b0
cmpq 0x38(%rbx), %r13
jne 0x153dc
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x2b36e
leaq 0x170(%rbx), %r14
leaq 0xa8(%rsp), %rsi
movq %r14, %rdi
callq 0x216ea
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x21fde
leaq 0x58(%rsp), %rsi
movl $0x40000000, (%rsi)     # imm = 0x40000000
leaq 0x8(%rsp), %rdi
callq 0x2a9ba
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x2b36e
leaq 0x198(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x216ea
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x168(%rbx), %rdx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x21764
leaq 0x8(%rsp), %rdi
callq 0x2aa52
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x2b60a
leaq 0x1c0(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x216ea
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x21fde
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x226fc
leaq 0x1e8(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x216ea
leaq 0x30(%rbx), %r14
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x58(%rsp), %rdi
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0x1a044
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r15, %rsi
callq 0x226fc
leaq 0x80(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %rsi
callq 0x1a044
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x2181e
addq $0xa0, %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x216ea
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
leaq 0x80(%rsp), %rdi
callq 0x19c8e
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x58(%rsp), %rdi
callq 0x19c8e
leaq 0x30(%rsp), %rdi
callq 0x19c8e
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x26b37(%rip), %rsi     # 0x3bf1a
leaq 0xa8(%rsp), %rdi
movl $0x3e, %edx
movl $0x3, %ecx
callq 0x3894e
leaq 0x26b52(%rip), %rsi     # 0x3bf53
leaq 0xa8(%rsp), %rdi
movl $0x32, %edx
callq 0x93b0
leaq 0xa8(%rsp), %rdi
callq 0x38b76
jmp 0x151c8
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x38b76
jmp 0x154ba
jmp 0x154a6
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
jmp 0x15451
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x19c8e
jmp 0x15463
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19c8e
jmp 0x15472
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x154b5
jmp 0x154a6
jmp 0x15485
jmp 0x154ad
jmp 0x154a6
jmp 0x15485
jmp 0x154a6
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x19c8e
jmp 0x154b0
jmp 0x154a6
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x154b5
movq %rax, %rbx
jmp 0x154ba
jmp 0x154ad
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19c8e
leaq 0x30(%rsp), %rdi
callq 0x19c8e
movq %rbx, %rdi
callq 0x95d0