// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl 0x30(%rdi), %esi
testl %esi, %esi
jle 0x18afb
movq %rdi, %r14
movl 0x34(%rdi), %ecx
testl %ecx, %ecx
jle 0x18afb
movq (%rbx), %rdx
movq 0x8(%rbx), %rdi
subq %rdx, %rdi
sarq $0x3, %rdi
movslq 0x38(%r14), %rax
leaq 0x1(%rax), %r8
cmpq %r8, %rdi
jne 0x18b1a
movsd (%rdx), %xmm0
incq %rdi
xorpd %xmm1, %xmm1
decq %rdi
je 0x188fc
ucomisd %xmm1, %xmm0
jae 0x188d2
leaq 0xd885(%rip), %rdi      # 0x26169
leaq 0xc9d7(%rip), %rsi      # 0x252c2
leaq 0xd81d(%rip), %rcx      # 0x2610f
movl $0x639, %edx            # imm = 0x639
callq 0x31a0
xorpd %xmm5, %xmm5
ucomisd %xmm5, %xmm0
jbe 0x1895f
imull %esi, %ecx
movq (%r14), %rsi
xorl %edi, %edi
testl %ecx, %ecx
cmovlel %edi, %ecx
movapd 0x96f5(%rip), %xmm0     # 0x22010
cmpq %rdi, %rcx
je 0x1895f
movsd (%rsi,%rdi,8), %xmm1
movapd %xmm1, %xmm4
andpd %xmm0, %xmm4
movsd (%rdx), %xmm2
xorpd %xmm3, %xmm3
ucomisd %xmm4, %xmm2
ja 0x18955
ucomisd %xmm5, %xmm1
jbe 0x18947
subsd %xmm2, %xmm1
jmp 0x18951
ucomisd %xmm1, %xmm5
jbe 0x1895a
addsd %xmm2, %xmm1
movapd %xmm1, %xmm3
movsd %xmm3, (%rsi,%rdi,8)
incq %rdi
jmp 0x1891b
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq %eax, %rcx
leal -0x2(,%r12,2), %eax
cmpq %rcx, %r12
jge 0x18aee
movq (%rbx), %rdx
movsd 0x8(%rdx,%r12,8), %xmm1
incq %r12
addl $0x2, %eax
ucomisd %xmm5, %xmm1
jne 0x18991
jnp 0x18970
movl 0x34(%r14), %ebp
imull 0x30(%r14), %ebp
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x3280
movsd 0x8(%rsp), %xmm4
movapd 0x9656(%rip), %xmm3     # 0x22010
xorpd %xmm5, %xmm5
cvttsd2si %xmm0, %ecx
movl %ebp, %eax
cltd
idivl %ecx
movq 0x8(%r14), %rcx
movq 0x10(%r14), %rdx
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdi
testl %eax, %eax
cmovlel %r15d, %eax
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x18ae5
movq -0x8(%rcx,%r12,8), %r9
movsd (%r9,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm4
ja 0x18a20
ucomisd %xmm5, %xmm0
jbe 0x18a12
subsd %xmm4, %xmm0
jmp 0x18a1c
ucomisd %xmm0, %xmm5
jbe 0x18a26
addsd %xmm4, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
movq -0x8(%rdx,%r12,8), %r9
movsd (%r9,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm4
ja 0x18a5d
ucomisd %xmm5, %xmm0
jbe 0x18a4f
subsd %xmm4, %xmm0
jmp 0x18a59
ucomisd %xmm0, %xmm5
jbe 0x18a63
addsd %xmm4, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
movq -0x8(%rsi,%r12,8), %r9
movsd (%r9,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm4
ja 0x18a9a
ucomisd %xmm5, %xmm0
jbe 0x18a8c
subsd %xmm4, %xmm0
jmp 0x18a96
ucomisd %xmm0, %xmm5
jbe 0x18aa0
addsd %xmm4, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
movq -0x8(%rdi,%r12,8), %r9
movsd (%r9,%r8,8), %xmm0
movapd %xmm0, %xmm2
andpd %xmm3, %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm2, %xmm4
ja 0x18ad7
ucomisd %xmm5, %xmm0
jbe 0x18ac9
subsd %xmm4, %xmm0
jmp 0x18ad3
ucomisd %xmm0, %xmm5
jbe 0x18add
addsd %xmm4, %xmm0
movapd %xmm0, %xmm1
movsd %xmm1, (%r9,%r8,8)
incq %r8
jmp 0x189e0
movl 0x38(%r14), %eax
jmp 0x18965
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd56d(%rip), %rdi      # 0x2606f
leaq 0xc7b9(%rip), %rsi      # 0x252c2
leaq 0xd5ff(%rip), %rcx      # 0x2610f
movl $0x635, %edx            # imm = 0x635
callq 0x31a0
leaq 0xd624(%rip), %rdi      # 0x26145
leaq 0xc79a(%rip), %rsi      # 0x252c2
leaq 0xd5e0(%rip), %rcx      # 0x2610f
movl $0x637, %edx            # imm = 0x637
callq 0x31a0
nop