// File: /workspace/github_cpp_makefile_star2_O3/matteotiziano[P]simple-wavelet/wavelet.cpp
// Function: Wavelet<double>::Convdown(Matrix<double> const&, std::vector<double, std::allocator<double>> const&, Matrix<double>&, Matrix<double>&) const
void Wavelet<T>::Convdown(const Matrix<T>& x, const std::vector<T>& f, Matrix<T>& xL, Matrix<T>& xH) const {
  // Compute size of subbands
  const size_t num_rows_subband = static_cast<size_t>(std::ceil(static_cast<double>(x.GetNumRows()) / 2.0));
  const size_t num_cols_subband = static_cast<size_t>(std::ceil(static_cast<double>(x.GetNumColumns()) / 2.0));
  // Convolve and decimate each row with the chosen filter
  Matrix<T> tmp(x.GetNumRows(), num_cols_subband);
  for (size_t i = 0; i < x.GetNumRows(); i++) {
    const std::vector<T> row = Convdown(x.GetRow(i), f);
    tmp.SetRow(row, i);
  }
  // Compute high-pass subband of pre-filtered tmp matrix
  xH = Matrix<T>(num_rows_subband, num_cols_subband);
  for (size_t j = 0; j < tmp.GetNumColumns(); j++) {
    const std::vector<T> column = Convdown(tmp.GetColumn(j), Hi_D_);
    xH.SetColumn(column, j);
  }
  // Compute low-pass subband of pre-filtered tmp matrix
  xL = Matrix<T>(num_rows_subband, num_cols_subband);
  for (size_t j = 0; j < tmp.GetNumColumns(); j++) {
    const std::vector<T> column = Convdown(tmp.GetColumn(j), Lo_D_);
    xL.SetColumn(column, j);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movq %rsi, %rdi
callq 0x6390
movq %rax, %xmm1
punpckldq 0x4a0b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x4a13(%rip), %xmm1     # 0x9160
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x4a2f(%rip), %xmm0     # 0x9190
callq 0x2060
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x4a1e(%rip), %xmm0     # 0x9198
cvttsd2si %xmm0, %rdx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, 0x48(%rsp)
movq %r12, %rdi
callq 0x6394
movq %rax, %xmm1
punpckldq 0x49b1(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x49b9(%rip), %xmm1     # 0x9160
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x49d5(%rip), %xmm0     # 0x9190
callq 0x2060
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x49c4(%rip), %xmm0     # 0x9198
cvttsd2si %xmm0, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movq %r12, %rdi
callq 0x6390
leaq 0x60(%rsp), %rdi
xorpd %xmm0, %xmm0
movq %rax, %rsi
movq %rbx, 0x40(%rsp)
movq %rbx, %rdx
callq 0x6218
xorl %ebx, %ebx
movq %rsp, %r15
leaq 0x18(%rsp), %r13
movq %r12, %rdi
callq 0x6390
cmpq %rax, %rbx
jae 0x4878
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6866
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq 0x3e66
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x484c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x6670
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4873
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
incq %rbx
jmp 0x480a
leaq 0x18(%rsp), %rdi
xorpd %xmm0, %xmm0
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x6218
leaq 0x28(%rsp), %rsi
movupd -0x10(%rsi), %xmm0
movq 0x58(%rsp), %rax
movupd %xmm0, (%rax)
leaq 0x10(%rax), %rdi
callq 0x354e
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x6376
leaq 0x18(%r14), %r13
xorl %ebx, %ebx
leaq 0x60(%rsp), %rbp
movq %rsp, %r15
movq %rbp, %rdi
callq 0x6394
cmpq %rax, %rbx
jae 0x4935
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x6912
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x3e66
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4909
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x58(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6752
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4930
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
incq %rbx
jmp 0x48c7
leaq 0x18(%rsp), %rdi
xorpd %xmm0, %xmm0
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0x6218
leaq 0x28(%rsp), %rsi
movupd -0x10(%rsi), %xmm0
movq 0x50(%rsp), %rax
movupd %xmm0, (%rax)
leaq 0x10(%rax), %rdi
callq 0x354e
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x6376
xorl %ebx, %ebx
leaq 0x60(%rsp), %r12
movq %rsp, %r13
movq %r12, %rdi
callq 0x6394
cmpq %rax, %rbx
jae 0x49ee
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6912
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x3e66
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x49c2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x50(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6752
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x49e9
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
incq %rbx
jmp 0x4980
leaq 0x60(%rsp), %rdi
callq 0x6376
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a0e
jmp 0x4a60
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x6376
jmp 0x4a63
jmp 0x4a60
jmp 0x4a2b
jmp 0x4a3f
jmp 0x4a60
jmp 0x4a2b
jmp 0x4a3f
jmp 0x4a60
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x4a63
movq 0x28(%rsp), %rsi
jmp 0x4a50
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4a63
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x4a63
jmp 0x4a60
jmp 0x4a60
jmp 0x4a60
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x6376
movq %rbx, %rdi
callq 0x22d0
nop