// File: toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::self_frob_block_trunc(double)
bool HierarchicalBlockSparseMatrix<Treal>::self_frob_block_trunc(Treal trunc_value) {

			bool at_least_one_removed = false;

			for(int i = 0; i < 4; ++i){
				if(children[i] != NULL){ // if child exist
					if(children[i]->get_frob_squared() < trunc_value*trunc_value){
						children[i] = nullptr;
						at_least_one_removed = at_least_one_removed || true;
					}
					else{
						bool child_cleared = children[i]->self_frob_block_trunc(trunc_value);
						at_least_one_removed = at_least_one_removed || child_cleared;
					}
				}
			}


			for(int i = 0; i < 4; ++i){
				if(children[i] != NULL){
					if(!children[i]->lowest_level() && !children[i]->children_exist()){
						children[i] = nullptr;
					}
				}
			}

			return at_least_one_removed;

		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movb $0x0, -0x11(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x4, -0x18(%rbp)
jge 0x34db9
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x232b0
testb $0x1, %al
jne 0x34ce3
jmp 0x34da9
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x23570
movq %rax, %rdi
callq 0x22b80
movaps %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x34d64
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x23590
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x235b0
leaq -0x28(%rbp), %rdi
callq 0x235e0
movb $0x1, %al
testb $0x1, -0x11(%rbp)
movb %al, -0x49(%rbp)
jne 0x34d5a
movb $0x1, %al
movb %al, -0x49(%rbp)
jmp 0x34d5a
movb -0x49(%rbp), %al
andb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x34da7
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x18(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x23570
movq %rax, %rdi
movsd -0x10(%rbp), %xmm0
callq 0x34c90
andb $0x1, %al
movb %al, -0x29(%rbp)
movb $0x1, %al
testb $0x1, -0x11(%rbp)
movb %al, -0x4a(%rbp)
jne 0x34d9f
movb -0x29(%rbp), %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
andb $0x1, %al
movb %al, -0x11(%rbp)
jmp 0x34da9
jmp 0x34dab
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x34cb4
movl $0x0, -0x30(%rbp)
cmpl $0x4, -0x30(%rbp)
jge 0x34e78
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x232b0
testb $0x1, %al
jne 0x34dec
jmp 0x34e68
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x23570
movq %rax, %rdi
callq 0x23500
testb $0x1, %al
jne 0x34e66
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x23570
movq %rax, %rdi
callq 0x23140
testb $0x1, %al
jne 0x34e66
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x23590
movq -0x48(%rbp), %rdi
addq $0x28, %rdi
movslq -0x30(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq -0x40(%rbp), %rsi
callq 0x235b0
leaq -0x40(%rbp), %rdi
callq 0x235e0
jmp 0x34e68
jmp 0x34e6a
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x34dc0
movb -0x11(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)