// File: /workspace/github_cpp_makefile_star2_O1/matteotiziano[P]simple-wavelet/./vector.h
// Function: std::vector<double, std::allocator<double>> Vector::Conv<double>(std::vector<double, std::allocator<double>> const&, std::vector<double, std::allocator<double>> const&, Vector::ConvolutionType)
std::vector<T> Conv(const std::vector<T>& vector, const std::vector<T>& filter, ConvolutionType convolutionType = kFullConvolution) {
    const size_t vector_size = vector.size();
    const size_t filter_size = filter.size();
    if (filter_size > vector_size) {
      throw std::invalid_argument("Conv");
    }
    // Compute convolution
    size_t minI = 0;
    size_t maxI = vector_size + filter_size - 1;
    if (convolutionType == kSameConvolution) {
      minI = filter_size / 2;
      maxI = minI + vector_size;
    }
    else if (convolutionType == kValidConvolution) {
      minI = filter_size - 1;
      maxI = vector_size;
    }
    std::vector<T> output;
    output.reserve(maxI - minI);
    for (size_t i = minI; i < maxI; i++) {
      const size_t minJ = (i < filter_size - 1) ? 0 : i - filter_size + 1;
      const size_t maxJ = (i >= vector_size - 1) ? vector_size : i + 1;
      T value = static_cast<T>(0);
      for (size_t j = minJ; j < maxJ; j++) {
        value += vector[j] * filter[i - j];
      }
      output.push_back(value);
    }
    return output;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
movq %rsi, 0x18(%rsp)
subq (%rsi), %rdi
sarq $0x3, %rdi
movq 0x8(%rdx), %r14
movq %rdx, 0x20(%rsp)
subq (%rdx), %r14
sarq $0x3, %r14
movq %rdi, 0x8(%rsp)
cmpq %rdi, %r14
ja 0x548b
cmpl $0x1, %ecx
jne 0x5366
movq %r14, %rbp
shrq %rbp
movq 0x8(%rsp), %rax
leaq (%rax,%rbp), %r15
jmp 0x5382
leaq -0x1(%r14), %rax
xorl %r15d, %r15d
cmpl $0x2, %ecx
movl $0x0, %ebp
cmoveq %rax, %rbp
cmovneq %rax, %r15
addq 0x8(%rsp), %r15
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r15, %rsi
subq %rbp, %rsi
movq %rbx, %rdi
callq 0x5756
movq %r15, 0x30(%rsp)
cmpq %rbp, %r15
jbe 0x5479
leaq -0x1(%r14), %r15
movq 0x8(%rsp), %rax
decq %rax
movq %rax, 0x28(%rsp)
leaq (%r14,%rbp), %rax
leaq -0x8(,%rax,8), %r12
negq %r14
xorl %r13d, %r13d
cmpq %r15, %rbp
movq %r15, %rsi
cmovaq %rbp, %rsi
leaq 0x1(%rbp,%r14), %rax
cmovbq %r13, %rax
cmpq 0x28(%rsp), %rbp
leaq 0x1(%rbp), %rbp
movq 0x8(%rsp), %rcx
cmovbq %rbp, %rcx
movq %r13, 0x10(%rsp)
cmpq %rcx, %rax
jae 0x543f
shlq $0x3, %rsi
movq %r12, %rdx
subq %rsi, %rdx
movsd 0x10(%rsp), %xmm0
movq 0x18(%rsp), %rsi
movq (%rsi), %rsi
movq 0x20(%rsp), %rdi
addq (%rdi), %rdx
movsd (%rsi,%rax,8), %xmm1
mulsd (%rdx), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
incq %rax
addq $-0x8, %rdx
cmpq %rcx, %rax
jb 0x5420
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x545d
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x546a
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0x5d3c
addq $0x8, %r12
cmpq 0x30(%rsp), %rbp
jne 0x53d1
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x3df9(%rip), %rsi      # 0x9298
movq %rax, %rdi
callq 0x22f0
movq 0x8b32(%rip), %rsi      # 0xdfe0
movq 0x8b0b(%rip), %rdx      # 0xdfc0
movq %rbx, %rdi
callq 0x22b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
jmp 0x54e3
jmp 0x54cc
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x54e3
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x21d0
movq %r14, %rdi
callq 0x22d0
nop