// File: /workspace/github_cpp_makefile_star2_O2/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, 0x10(%rsp)
movq 0x8(%rsi), %rdi
movq %rsi, 0x28(%rsp)
subq (%rsi), %rdi
sarq $0x3, %rdi
movq 0x8(%rdx), %rsi
movq %rdx, 0x30(%rsp)
subq (%rdx), %rsi
sarq $0x3, %rsi
movq %rdi, 0x8(%rsp)
cmpq %rdi, %rsi
ja 0x4b47
movq %rsi, %r14
cmpl $0x1, %ecx
jne 0x4a44
movq %r14, %rbp
shrq %rbp
movq 0x8(%rsp), %rax
leaq (%rax,%rbp), %r13
jmp 0x4a60
leaq -0x1(%r14), %rax
xorl %r13d, %r13d
cmpl $0x2, %ecx
movl $0x0, %ebp
cmoveq %rax, %rbp
cmovneq %rax, %r13
addq 0x8(%rsp), %r13
movq 0x10(%rsp), %rdi
andq $0x0, 0x10(%rdi)
xorpd %xmm0, %xmm0
movupd %xmm0, (%rdi)
movq %r13, %rsi
subq %rbp, %rsi
callq 0x4d6c
leaq -0x1(%r14), %rbx
movq 0x8(%rsp), %rax
decq %rax
movq %rax, 0x20(%rsp)
leaq (%r14,%rbp), %rax
leaq -0x8(,%rax,8), %r15
negq %r14
cmpq %rbx, %rbp
movq %rbx, %rcx
cmovaq %rbp, %rcx
cmpq %r13, %rbp
jae 0x4b33
shlq $0x3, %rcx
movq %r15, %rax
subq %rcx, %rax
cmpq %rbx, %rbp
leaq 0x1(%rbp,%r14), %rcx
movl $0x0, %edx
cmovbq %rdx, %rcx
leaq 0x1(%rbp), %r12
cmpq 0x20(%rsp), %rbp
movq 0x8(%rsp), %rdx
cmovbq %r12, %rdx
andq $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rsi
movq (%rsi), %rsi
movq 0x30(%rsp), %rdi
addq (%rdi), %rax
xorpd %xmm0, %xmm0
cmpq %rdx, %rcx
jae 0x4b18
movsd (%rsi,%rcx,8), %xmm1
mulsd (%rax), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
incq %rcx
addq $-0x8, %rax
jmp 0x4af7
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x4e02
addq $0x8, %r15
movq %r12, %rbp
jmp 0x4a9d
movq 0x10(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %rbx
leaq 0x376f(%rip), %rsi      # 0x82c8
movq %rax, %rdi
callq 0x22e0
movq 0x8478(%rip), %rsi      # 0xcfe0
movq 0x8451(%rip), %rdx      # 0xcfc0
movq %rbx, %rdi
callq 0x22a0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2140
jmp 0x4b93
jmp 0x4b86
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x2d52
movq %r14, %rdi
callq 0x22c0
nop