// File: matteotiziano[P]simple-wavelet/wavelet.cpp
// Function: Wavelet<double>::Upconv(Matrix<double> const&, std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, MatrixSize const&) const
Matrix<T> Wavelet<T>::Upconv(const Matrix<T>& x, const std::vector<T>& f1, const std::vector<T>& f2, const MatrixSize& s) const {
  // Upsample each column
  Matrix<T> tmp(s[0], x.GetNumColumns());
  for (size_t j = 0; j < x.GetNumColumns(); j++) {
    tmp.SetColumn(Upconv(x.GetColumn(j), f1, s.GetNumRows()), j);
  }
  // Upsample each row of tmp Matrix
  Matrix<T> y(s.GetNumRows(), s.GetNumColums());
  for (size_t i = 0; i < y.GetNumRows(); i++) {
    y.SetRow(Upconv(tmp.GetRow(i), f2, s.GetNumColums()), i);
  }
  return y;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x100(%rbp)
movq %rdi, %rax
movq %rax, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x85a0
movq (%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
callq 0xca60
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
leaq -0x58(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xc7e0
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rdi
callq 0xca60
movq %rax, -0x108(%rbp)
jmp 0x723a
movq -0x110(%rbp), %rax
movq -0x108(%rbp), %rcx
cmpq %rcx, %rax
jae 0x7335
movq -0x18(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xd320
jmp 0x7267
movq -0x20(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8540
movq %rax, -0x118(%rbp)
jmp 0x7284
movq -0x118(%rbp), %r8
movq -0x120(%rbp), %rcx
movq -0xf0(%rbp), %rsi
leaq -0x88(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x6210
jmp 0x72ae
movq -0x60(%rbp), %rdx
leaq -0x58(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xd080
jmp 0x72c4
leaq -0x88(%rbp), %rdi
callq 0x3430
leaq -0xa0(%rbp), %rdi
callq 0x3430
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x721d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x74f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7324
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3430
leaq -0xa0(%rbp), %rdi
callq 0x3430
jmp 0x74f2
movb $0x0, -0xa1(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8540
movq %rax, -0x128(%rbp)
jmp 0x734e
movq -0x30(%rbp), %rdi
callq 0x8570
movq %rax, -0x130(%rbp)
jmp 0x7360
movq -0x130(%rbp), %rdx
movq -0x128(%rbp), %rsi
movq -0x100(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xc7e0
jmp 0x737f
movq $0x0, -0xb0(%rbp)
movq -0x100(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq %rax, -0x140(%rbp)
callq 0xca40
movq %rax, -0x138(%rbp)
jmp 0x73ad
movq -0x140(%rbp), %rax
movq -0x138(%rbp), %rcx
cmpq %rcx, %rax
jae 0x74b1
movq -0xb0(%rbp), %rdx
leaq -0xe0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xd240
jmp 0x73dd
movq -0x28(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8570
movq %rax, -0x148(%rbp)
jmp 0x73fa
movq -0x148(%rbp), %r8
movq -0x150(%rbp), %rcx
movq -0xf0(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x6210
jmp 0x7424
movq -0x100(%rbp), %rdi
movq -0xb0(%rbp), %rdx
leaq -0xc8(%rbp), %rsi
callq 0xcf80
jmp 0x7440
leaq -0xc8(%rbp), %rdi
callq 0x3430
leaq -0xe0(%rbp), %rdi
callq 0x3430
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
jmp 0x738a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x74e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x74a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3430
leaq -0xe0(%rbp), %rdi
callq 0x3430
jmp 0x74e6
movb $0x1, -0xa1(%rbp)
testb $0x1, -0xa1(%rbp)
jne 0x74cd
movq -0x100(%rbp), %rdi
callq 0xca20
leaq -0x58(%rbp), %rdi
callq 0xca20
movq -0xf8(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x100(%rbp), %rdi
callq 0xca20
leaq -0x58(%rbp), %rdi
callq 0xca20
movq -0x68(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)
nop