// File: /workspace/github_cpp_makefile_star2_O1/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::CalcStats(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&) const
void SteerablePyramid::CalcStats(vector<Float_t> &means, vector<Float_t> &stdDevs) const
{
	assert(width_ > 0 && height_ > 0);
	
	//Init the vectors
	means.resize(numLevels_ + 1);
	stdDevs.resize(numLevels_ + 1);
	for (int i = 0; i <= numLevels_; i++)
		means[i] = stdDevs[i] = 0;
	
	//Get the H0 means
	int totalPixels = width_ * height_;
	for (int i = 0; i < totalPixels; i++)
		means[0] += fabs(h0Coeffs_[i]);
	means[0] /= totalPixels;
	
	//Get the B means
	for (int i = 0; i < numLevels_; i++)
	{
		totalPixels = (width_ * height_) / (int)(pow(4, i));
		for (int j = 0; j < totalPixels; j++)
		{
			means[i + 1] += fabs(b1Coeffs_[i][j]);
			means[i + 1] += fabs(b2Coeffs_[i][j]);
			means[i + 1] += fabs(b3Coeffs_[i][j]);
			means[i + 1] += fabs(b4Coeffs_[i][j]);
		}
		means[i + 1] /= (totalPixels * 4);
	}
	
	//Get the H0 std devs
	for (int i = 0; i < totalPixels; i++)
		stdDevs[0] += fabs(h0Coeffs_[i] - means[0]);
	stdDevs[0] /= totalPixels;
	
	//Get the B std devs
	for (int i = 0; i < numLevels_; i++)
	{
		totalPixels = (width_ * height_) / (int)(pow(4, i));
		for (int j = 0; j < totalPixels; j++)
		{
			stdDevs[i + 1] += fabs(b1Coeffs_[i][j] - means[i]);
			stdDevs[i + 1] += fabs(b2Coeffs_[i][j] - means[i]);
			stdDevs[i + 1] += fabs(b3Coeffs_[i][j] - means[i]);
			stdDevs[i + 1] += fabs(b4Coeffs_[i][j] - means[i]);
		}
		stdDevs[i + 1] /= (totalPixels * 4);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x0, 0x30(%rdi)
jle 0x1ea92
movq %rdi, %r15
cmpl $0x0, 0x34(%rdi)
jle 0x1ea92
movq %rdx, %rbx
movq %rsi, %r14
movslq 0x38(%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0xa084
movslq 0x38(%r15), %rsi
incq %rsi
movq %rbx, %rdi
callq 0xa084
movl 0x38(%r15), %eax
testl %eax, %eax
js 0x1e7cc
movq (%rbx), %rcx
movq (%r14), %rdx
incq %rax
xorl %esi, %esi
xorl %edi, %edi
movq %rsi, (%rcx,%rdi,8)
movq %rsi, (%rdx,%rdi,8)
incq %rdi
cmpq %rdi, %rax
jne 0x1e7bc
movl 0x34(%r15), %eax
imull 0x30(%r15), %eax
testl %eax, %eax
jle 0x1e808
movq (%r15), %rcx
movq (%r14), %rdx
movsd (%rdx), %xmm0
movl %eax, %esi
xorl %edi, %edi
movapd 0xc821(%rip), %xmm1     # 0x2b010
movsd (%rcx,%rdi,8), %xmm2
andpd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, (%rdx)
incq %rdi
cmpq %rdi, %rsi
jne 0x1e7ef
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%r14), %rcx
movsd (%rcx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rcx)
cmpl $0x0, 0x38(%r15)
jle 0x1e923
xorl %r12d, %r12d
movl 0x34(%r15), %ebp
imull 0x30(%r15), %ebp
leal (%r12,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movapd 0xc7c2(%rip), %xmm2     # 0x2b010
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
testl %eax, %eax
jle 0x1e8eb
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rsi
movq (%rcx,%r12,8), %rcx
movq (%r14), %rdx
movq (%rsi,%r12,8), %rsi
movq 0x18(%r15), %rdi
movq (%rdi,%r12,8), %rdi
movq 0x20(%r15), %r8
movq (%r8,%r12,8), %r8
movsd 0x8(%rdx,%r12,8), %xmm0
movl %eax, %r9d
xorl %r10d, %r10d
movsd (%rcx,%r10,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rdx,%r12,8)
movsd (%rsi,%r10,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rdx,%r12,8)
movsd (%rdi,%r10,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rdx,%r12,8)
movsd (%r8,%r10,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rdx,%r12,8)
incq %r10
cmpq %r10, %r9
jne 0x1e88f
leal (,%rax,4), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movq (%r14), %rcx
movsd 0x8(%rcx,%r12,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
leaq 0x1(%r12), %rcx
movslq 0x38(%r15), %rdx
movq %rcx, %r12
cmpq %rdx, %rcx
jl 0x1e82c
testl %eax, %eax
jle 0x1e95b
movq (%r15), %rcx
movq (%r14), %rdx
movq (%rbx), %rsi
movl %eax, %edi
xorl %r8d, %r8d
movapd 0xc6d3(%rip), %xmm0     # 0x2b010
movsd (%rcx,%r8,8), %xmm1
subsd (%rdx), %xmm1
andpd %xmm0, %xmm1
addsd (%rsi), %xmm1
movsd %xmm1, (%rsi)
incq %r8
cmpq %r8, %rdi
jne 0x1e93d
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%rbx), %rax
movsd (%rax), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rax)
cmpl $0x0, 0x38(%r15)
jle 0x1ea89
xorl %r12d, %r12d
movl 0x34(%r15), %ebp
imull 0x30(%r15), %ebp
leal (%r12,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movapd 0xc66f(%rip), %xmm2     # 0x2b010
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
testl %eax, %eax
jle 0x1ea55
movq 0x8(%r15), %rcx
movq 0x10(%r15), %rdi
movq (%rcx,%r12,8), %rcx
movq (%r14), %rdx
movq (%rbx), %rsi
movq (%rdi,%r12,8), %rdi
movq 0x18(%r15), %r8
movq (%r8,%r12,8), %r8
movq 0x20(%r15), %r9
movq (%r9,%r12,8), %r9
movl %eax, %r10d
xorl %r11d, %r11d
movsd (%rcx,%r11,8), %xmm0
subsd (%rdx,%r12,8), %xmm0
andpd %xmm2, %xmm0
addsd 0x8(%rsi,%r12,8), %xmm0
movsd %xmm0, 0x8(%rsi,%r12,8)
movsd (%rdi,%r11,8), %xmm1
subsd (%rdx,%r12,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsi,%r12,8)
movsd (%r8,%r11,8), %xmm0
subsd (%rdx,%r12,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsi,%r12,8)
movsd (%r9,%r11,8), %xmm1
subsd (%rdx,%r12,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsi,%r12,8)
incq %r11
cmpq %r11, %r10
jne 0x1e9de
shll $0x2, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq (%rbx), %rax
movsd 0x8(%rax,%r12,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rax,%r12,8)
leaq 0x1(%r12), %rax
movslq 0x38(%r15), %rcx
movq %rax, %r12
cmpq %rcx, %rax
jl 0x1e97f
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x105ce(%rip), %rdi     # 0x2f067
leaq 0xf81a(%rip), %rsi      # 0x2e2ba
leaq 0x10613(%rip), %rcx     # 0x2f0ba
movl $0x603, %edx            # imm = 0x603
callq 0x31c0
nop