// File: /workspace/github_cpp_makefile_star2_O3/kebwi[P]Trifid/src/SteerablePyramid.cpp
// Function: SteerablePyramid::SoftThreshold(std::vector<double, std::allocator<double>>)
void SteerablePyramid::SoftThreshold(vector<Float_t> thresholds)
{
	assert(width_ > 0 && height_ > 0);
	
	assert(thresholds.size() == numLevels_ + 1);
	for (int i = 0; i < thresholds.size(); i++)
		assert(thresholds[0] >= 0);
	
	int totalPixels = width_ * height_;
	if (thresholds[0] > 0)
		for (int i = 0; i < totalPixels; i++)
		{
			if (fabs(h0Coeffs_[i]) < thresholds[0])
				h0Coeffs_[i] = 0;
			else if (h0Coeffs_[i] > 0)
				h0Coeffs_[i] -= thresholds[0];
			else if (h0Coeffs_[i] < 0)
				h0Coeffs_[i] += thresholds[0];
		}
	
	for (int i = 0; i < numLevels_; i++)
	{
		Float_t threshold = thresholds[i + 1];
		
		if (threshold == 0)
			continue;
		
		int totalPixels = (width_ * height_) / (int)(pow(4, i));
		for (int j = 0; j < totalPixels; j++)
		{
			if (fabs(b1Coeffs_[i][j]) < threshold)
				b1Coeffs_[i][j] = 0;
			else if (b1Coeffs_[i][j] > 0)
				b1Coeffs_[i][j] -= threshold;
			else if (b1Coeffs_[i][j] < 0)
				b1Coeffs_[i][j] += threshold;
				
			if (fabs(b2Coeffs_[i][j]) < threshold)
				b2Coeffs_[i][j] = 0;
			else if (b2Coeffs_[i][j] > 0)
				b2Coeffs_[i][j] -= threshold;
			else if (b2Coeffs_[i][j] < 0)
				b2Coeffs_[i][j] += threshold;
				
			if (fabs(b3Coeffs_[i][j]) < threshold)
				b3Coeffs_[i][j] = 0;
			else if (b3Coeffs_[i][j] > 0)
				b3Coeffs_[i][j] -= threshold;
			else if (b3Coeffs_[i][j] < 0)
				b3Coeffs_[i][j] += threshold;
				
			if (fabs(b4Coeffs_[i][j]) < threshold)
				b4Coeffs_[i][j] = 0;
			else if (b4Coeffs_[i][j] > 0)
				b4Coeffs_[i][j] -= threshold;
			else if (b4Coeffs_[i][j] < 0)
				b4Coeffs_[i][j] += threshold;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x30(%rdi), %edx
testl %edx, %edx
jle 0x1ea77
movq %rdi, %r14
movl 0x34(%rdi), %edi
testl %edi, %edi
jle 0x1ea77
movq %rsi, %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rsi
movq %rsi, %r8
subq %rax, %r8
sarq $0x3, %r8
movslq 0x38(%r14), %rcx
leaq 0x1(%rcx), %r9
cmpq %r9, %r8
jne 0x1ea96
movsd (%rax), %xmm1
cmpq %rax, %rsi
je 0x1e87e
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x1eab5
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1e8e5
imull %edx, %edi
movq (%r14), %rdx
cmpl $0x2, %edi
movl $0x1, %esi
cmovgel %edi, %esi
xorl %edi, %edi
movapd 0xb76d(%rip), %xmm1     # 0x2a010
movsd (%rdx,%rdi,8), %xmm2
movapd %xmm2, %xmm5
andpd %xmm1, %xmm5
movsd (%rax), %xmm3
xorpd %xmm4, %xmm4
ucomisd %xmm5, %xmm3
ja 0x1e8d8
ucomisd %xmm0, %xmm2
jbe 0x1e8ca
subsd %xmm3, %xmm2
jmp 0x1e8d4
ucomisd %xmm2, %xmm0
jbe 0x1e8dd
addsd %xmm3, %xmm2
movapd %xmm2, %xmm4
movsd %xmm4, (%rdx,%rdi,8)
incq %rdi
cmpq %rdi, %rsi
jne 0x1e8a3
testl %ecx, %ecx
jle 0x1ea6c
xorl %r15d, %r15d
xorpd %xmm3, %xmm3
movq (%rbx), %rax
movsd 0x8(%rax,%r15,8), %xmm1
ucomisd %xmm3, %xmm1
jne 0x1e90a
jnp 0x1ea5c
movl 0x34(%r14), %ebp
imull 0x30(%r14), %ebp
leal (%r15,%r15), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm1, (%rsp)
callq 0x32a0
movsd (%rsp), %xmm5
movapd 0xb6da(%rip), %xmm4     # 0x2a010
xorpd %xmm3, %xmm3
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
testl %eax, %eax
jle 0x1ea5c
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
movq (%rcx,%r15,8), %rcx
movq (%rdx,%r15,8), %rdx
movq 0x18(%r14), %rsi
movq (%rsi,%r15,8), %rsi
movq 0x20(%r14), %rdi
movq (%rdi,%r15,8), %rdi
movl %eax, %eax
xorl %r8d, %r8d
movsd (%rcx,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm4, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm5
ja 0x1e9a2
ucomisd %xmm3, %xmm0
jbe 0x1e994
subsd %xmm5, %xmm0
jmp 0x1e99e
ucomisd %xmm0, %xmm3
jbe 0x1e9a8
addsd %xmm5, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%rcx,%r8,8)
movsd (%rdx,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm4, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm5
ja 0x1e9da
ucomisd %xmm3, %xmm0
jbe 0x1e9cc
subsd %xmm5, %xmm0
jmp 0x1e9d6
ucomisd %xmm0, %xmm3
jbe 0x1e9e0
addsd %xmm5, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%rdx,%r8,8)
movsd (%rsi,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm4, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm5
ja 0x1ea12
ucomisd %xmm3, %xmm0
jbe 0x1ea04
subsd %xmm5, %xmm0
jmp 0x1ea0e
ucomisd %xmm0, %xmm3
jbe 0x1ea18
addsd %xmm5, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%rsi,%r8,8)
movsd (%rdi,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm4, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm5
ja 0x1ea4a
ucomisd %xmm3, %xmm0
jbe 0x1ea3c
subsd %xmm5, %xmm0
jmp 0x1ea46
ucomisd %xmm0, %xmm3
jbe 0x1ea50
addsd %xmm5, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r8,8)
incq %r8
cmpq %r8, %rax
jne 0x1e970
incq %r15
movslq 0x38(%r14), %rax
cmpq %rax, %r15
jl 0x1e8f4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf651(%rip), %rdi      # 0x2e0cf
leaq 0xe89d(%rip), %rsi      # 0x2d322
leaq 0xf6e3(%rip), %rcx      # 0x2e16f
movl $0x635, %edx            # imm = 0x635
callq 0x31c0
leaq 0xf708(%rip), %rdi      # 0x2e1a5
leaq 0xe87e(%rip), %rsi      # 0x2d322
leaq 0xf6c4(%rip), %rcx      # 0x2e16f
movl $0x637, %edx            # imm = 0x637
callq 0x31c0
leaq 0xf70d(%rip), %rdi      # 0x2e1c9
leaq 0xe85f(%rip), %rsi      # 0x2d322
leaq 0xf6a5(%rip), %rcx      # 0x2e16f
movl $0x639, %edx            # imm = 0x639
callq 0x31c0