// File: /workspace/github_cpp_makefile_star2_O3/toxaart[P]hierarchical_block_sparse_lib/source/HierarchicalBlockSparseMatrix.h
// Function: hbsm::HierarchicalBlockSparseMatrix<double>::get_errors_of_approx_multiplication(hbsm::HierarchicalBlockSparseMatrix<double> const&, bool, hbsm::HierarchicalBlockSparseMatrix<double> const&, bool, std::vector<double, std::allocator<double>> const&, bool const&, bool const&)
std::vector<Treal> HierarchicalBlockSparseMatrix<Treal>::get_errors_of_approx_multiplication(HierarchicalBlockSparseMatrix<Treal> const & A, const bool tA, HierarchicalBlockSparseMatrix<Treal> const & B, const bool tB, std::vector<Treal> const & taus, const bool & apply_truncation, const bool & apply_spamm){

			std::vector<unsigned long int> skips = count_skips(A, tA, B, tB, taus, apply_truncation, apply_spamm);

			assert(skips.size() == taus.size());

			std::vector<Treal> errors;
			errors.resize(skips.size());

			Treal c1 = A.get_max_abs_value();
			Treal c2 = B.get_max_abs_value();

			//truncmul
			if(apply_truncation && !apply_spamm){
				for(int i = 0; i < errors.size(); ++i){
					errors[i] = std::max(c1,c2) * std::sqrt(taus[i] * taus[i] * skips[i]);
				}
			}

			//spamm
			if(!apply_truncation && apply_spamm){
				for(int i = 0; i < errors.size(); ++i){
					errors[i] = std::sqrt(taus[i] * taus[i] * skips[i]);
				}
			}

			//hybrid
			if(apply_truncation	&& apply_spamm){
				for(int i = 0; i < errors.size(); ++i){
					errors[i] = std::max(1.0,std::max(c1,c2)) * std::sqrt(taus[i] * taus[i] * skips[i]);
				}
			}

			//regular multiplication - do nothing
			if(!apply_truncation && !apply_spamm){

			}

			return errors;

		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x70(%rsp), %rax
leaq 0x18(%rsp), %r13
movq %r13, %rdi
pushq 0x78(%rsp)
movq %rax, %rbp
pushq %rax
callq 0x164fa
addq $0x10, %rsp
movq 0x8(%r13), %rsi
subq (%r13), %rsi
movq 0x8(%r14), %rax
subq (%r14), %rax
cmpq %rax, %rsi
jne 0x18cc2
sarq $0x3, %rsi
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq 0x1b416
movq %r12, %rdi
callq 0x21b60
movsd %xmm0, 0x10(%rsp)
movq 0x78(%rsp), %r12
movq %r15, %rdi
callq 0x21b60
movsd %xmm0, 0x8(%rsp)
movb (%rbp), %al
cmpb $0x1, %al
jne 0x18b28
cmpb $0x0, (%r12)
jne 0x18b28
movq 0x8(%rbx), %rcx
cmpq (%rbx), %rcx
je 0x18b28
movsd 0x8(%rsp), %xmm3
maxsd 0x10(%rsp), %xmm3
xorl %r15d, %r15d
movsd 0xb897(%rip), %xmm4     # 0x24330
movapd 0xb89f(%rip), %xmm5     # 0x24340
xorpd %xmm6, %xmm6
movsd %xmm3, 0x30(%rsp)
movq (%r14), %rax
movsd (%rax,%r15,8), %xmm1
mulsd %xmm1, %xmm1
movq 0x18(%rsp), %rax
movsd (%rax,%r15,8), %xmm2
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
subpd %xmm5, %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
ucomisd %xmm6, %xmm0
jb 0x18ae6
sqrtsd %xmm0, %xmm0
jmp 0x18b05
callq 0x2170
xorpd %xmm6, %xmm6
movapd 0xb849(%rip), %xmm5     # 0x24340
movsd 0xb831(%rip), %xmm4     # 0x24330
movsd 0x30(%rsp), %xmm3
mulsd %xmm3, %xmm0
movq (%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x18aab
movb (%rbp), %al
testb $0x1, %al
jne 0x18bd2
cmpb $0x1, (%r12)
jne 0x18bd2
movq 0x8(%rbx), %rcx
cmpq (%rbx), %rcx
je 0x18bd2
xorl %r15d, %r15d
movsd 0xb7dd(%rip), %xmm3     # 0x24330
movapd 0xb7e5(%rip), %xmm4     # 0x24340
xorpd %xmm5, %xmm5
movq (%r14), %rax
movsd (%rax,%r15,8), %xmm1
mulsd %xmm1, %xmm1
movq 0x18(%rsp), %rax
movsd (%rax,%r15,8), %xmm2
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jb 0x18b9a
sqrtsd %xmm0, %xmm0
jmp 0x18bb3
callq 0x2170
xorpd %xmm5, %xmm5
movapd 0xb795(%rip), %xmm4     # 0x24340
movsd 0xb77d(%rip), %xmm3     # 0x24330
movq (%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x18b5f
movb (%rbp), %al
testb $0x1, %al
je 0x18c99
cmpb $0x1, (%r12)
jne 0x18c99
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x18c99
movsd 0x8(%rsp), %xmm0
maxsd 0x10(%rsp), %xmm0
maxsd 0xb41a(%rip), %xmm0     # 0x24020
movsd %xmm0, 0x8(%rsp)
xorl %r15d, %r15d
movsd 0xb719(%rip), %xmm3     # 0x24330
movapd 0xb721(%rip), %xmm4     # 0x24340
xorpd %xmm5, %xmm5
movq (%r14), %rax
movsd (%rax,%r15,8), %xmm1
mulsd %xmm1, %xmm1
movq 0x18(%rsp), %rax
movsd (%rax,%r15,8), %xmm2
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
subpd %xmm4, %xmm2
movapd %xmm2, %xmm0
unpckhpd %xmm2, %xmm0            # xmm0 = xmm0[1],xmm2[1]
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
ucomisd %xmm5, %xmm0
jb 0x18c5e
sqrtsd %xmm0, %xmm0
jmp 0x18c77
callq 0x2170
xorpd %xmm5, %xmm5
movapd 0xb6d1(%rip), %xmm4     # 0x24340
movsd 0xb6b9(%rip), %xmm3     # 0x24330
mulsd 0x8(%rsp), %xmm0
movq (%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x18c23
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18cb0
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd055(%rip), %rdi      # 0x25d1e
leaq 0xbacf(%rip), %rsi      # 0x2479f
leaq 0xd063(%rip), %rcx      # 0x25d3a
movl $0x144d, %edx           # imm = 0x144D
callq 0x2100
jmp 0x18ce5
jmp 0x18ce5
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x18cfc
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18d13
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22b0
nop