// File: /workspace/github_cpp_makefile_star2_O3/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 0xbb7c
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 0x150e0
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
callq 0x2b21a
leaq 0x170(%rbx), %r14
leaq 0xa8(%rsp), %rsi
movq %r14, %rdi
callq 0x21422
leaq 0xa8(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x21d46
leaq 0x58(%rsp), %rsi
movl $0x40000000, (%rsi)     # imm = 0x40000000
leaq 0x8(%rsp), %rdi
callq 0x2a860
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x2b21a
leaq 0x198(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x21422
leaq 0xa8(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
callq 0x19a36
leaq 0x168(%rbx), %rdx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x214ae
leaq 0x8(%rsp), %rdi
callq 0x2a8f8
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x2b4d4
leaq 0x1c0(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x21422
leaq 0xa8(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x21d46
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x22482
leaq 0x1e8(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x21422
leaq 0x30(%rbx), %r14
leaq 0xa8(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
callq 0x19a36
leaq 0x58(%rsp), %rdi
movl $0x1, %ecx
movq %r14, %rsi
xorl %edx, %edx
callq 0x19dec
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r15, %rsi
callq 0x22482
leaq 0x80(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %rsi
callq 0x19dec
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x21568
addq $0xa0, %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x21422
leaq 0xa8(%rsp), %rdi
callq 0x19a36
leaq 0x80(%rsp), %rdi
callq 0x19a36
leaq 0x8(%rsp), %rdi
callq 0x19a36
leaq 0x58(%rsp), %rdi
callq 0x19a36
leaq 0x30(%rsp), %rdi
callq 0x19a36
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x26e33(%rip), %rsi     # 0x3bf1a
leaq 0xa8(%rsp), %rdi
movl $0x3e, %edx
movl $0x3, %ecx
callq 0x387b6
leaq 0x26e4e(%rip), %rsi     # 0x3bf53
leaq 0xa8(%rsp), %rdi
movl $0x32, %edx
callq 0x93b0
leaq 0xa8(%rsp), %rdi
callq 0x389de
jmp 0x14ecc
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x389de
jmp 0x151be
jmp 0x151aa
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x19a36
jmp 0x15155
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x19a36
jmp 0x15167
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19a36
jmp 0x15176
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x151b9
jmp 0x151aa
jmp 0x15189
jmp 0x151b1
jmp 0x151aa
jmp 0x15189
jmp 0x151aa
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x19a36
jmp 0x151b4
jmp 0x151aa
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x151b9
movq %rax, %rbx
jmp 0x151be
jmp 0x151b1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x19a36
leaq 0x30(%rsp), %rdi
callq 0x19a36
movq %rbx, %rdi
callq 0x95d0