// File: /workspace/github_cpp_makefile_star2_O3/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 0x1e802
movq %rdi, %r15
cmpl $0x0, 0x34(%rdi)
jle 0x1e802
movq %rdx, %rbx
movq %rsi, %r14
movslq 0x38(%r15), %rsi
incq %rsi
movq %r14, %rdi
callq 0xa036
movslq 0x38(%r15), %rsi
incq %rsi
movq %rbx, %rdi
callq 0xa036
movl 0x38(%r15), %edx
movq (%r14), %rcx
testl %edx, %edx
js 0x1e548
movq (%rbx), %rax
leaq 0x1(%rdx), %rsi
xorl %edi, %edi
xorl %r8d, %r8d
movq %rdi, (%rax,%r8,8)
movq %rdi, (%rcx,%r8,8)
incq %r8
cmpq %r8, %rsi
jne 0x1e538
movl 0x34(%r15), %eax
imull 0x30(%r15), %eax
movsd (%rcx), %xmm0
testl %eax, %eax
jle 0x1e583
movq (%r15), %rsi
movl %eax, %edi
xorl %r8d, %r8d
movapd 0xbaa7(%rip), %xmm1     # 0x2a010
movsd (%rsi,%r8,8), %xmm2
andpd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, (%rcx)
incq %r8
cmpq %r8, %rdi
jne 0x1e569
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
testl %edx, %edx
jle 0x1e698
xorl %r12d, %r12d
movl 0x34(%r15), %ebp
imull 0x30(%r15), %ebp
leal (%r12,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movapd 0xba51(%rip), %xmm2     # 0x2a010
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq (%r14), %rcx
testl %eax, %eax
jle 0x1e65c
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rsi
movq (%rdx,%r12,8), %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(%rcx,%r12,8), %xmm0
movl %eax, %r9d
xorl %r10d, %r10d
movsd (%rdx,%r10,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
movsd (%rsi,%r10,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rcx,%r12,8)
movsd (%rdi,%r10,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
movsd (%r8,%r10,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rcx,%r12,8)
incq %r10
cmpq %r10, %r9
jne 0x1e600
leal (,%rax,4), %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
movsd 0x8(%rcx,%r12,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
leaq 0x1(%r12), %rsi
movslq 0x38(%r15), %rdx
movq %rsi, %r12
cmpq %rdx, %rsi
jl 0x1e59d
testl %edx, %edx
setg %dl
jmp 0x1e69a
xorl %edx, %edx
movq (%rbx), %rsi
movsd (%rsi), %xmm0
testl %eax, %eax
jle 0x1e6d4
movq (%r15), %rdi
movl %eax, %r8d
xorl %r9d, %r9d
movapd 0xb95a(%rip), %xmm1     # 0x2a010
movsd (%rdi,%r9,8), %xmm2
subsd (%rcx), %xmm2
andpd %xmm1, %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, (%rsi)
incq %r9
cmpq %r9, %r8
jne 0x1e6b6
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rsi)
testb %dl, %dl
je 0x1e7f9
xorl %r12d, %r12d
movl 0x34(%r15), %ebp
imull 0x30(%r15), %ebp
leal (%r12,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x32a0
movapd 0xb900(%rip), %xmm2     # 0x2a010
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq (%rbx), %rcx
testl %eax, %eax
jle 0x1e7c8
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rdi
movq (%rdx,%r12,8), %rdx
movq (%r14), %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
movsd 0x8(%rcx,%r12,8), %xmm0
xorl %r11d, %r11d
movsd (%rdx,%r11,8), %xmm1
subsd (%rsi,%r12,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
movsd (%rdi,%r11,8), %xmm0
subsd (%rsi,%r12,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rcx,%r12,8)
movsd (%r8,%r11,8), %xmm1
subsd (%rsi,%r12,8), %xmm1
andpd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
movsd (%r9,%r11,8), %xmm0
subsd (%rsi,%r12,8), %xmm0
andpd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rcx,%r12,8)
incq %r11
cmpq %r11, %r10
jne 0x1e754
shll $0x2, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x8(%rcx,%r12,8), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rcx,%r12,8)
leaq 0x1(%r12), %rax
movslq 0x38(%r15), %rcx
movq %rax, %r12
cmpq %rcx, %rax
jl 0x1e6ee
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf8c6(%rip), %rdi      # 0x2e0cf
leaq 0xeb12(%rip), %rsi      # 0x2d322
leaq 0xf90b(%rip), %rcx      # 0x2e122
movl $0x603, %edx            # imm = 0x603
callq 0x31c0
nop