// File: /workspace/github_cpp_makefile_star2_O2/henrixh[P]shittydsa/examples/../src/fft.h
// Function: convolve(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
vd convolve(vd& as, vd& bs) {
  vc acs {};
  vc bcs {};
  acs.reserve(as.size() + bs.size());
  bcs.reserve(as.size() + bs.size());

  // Increase complexity
  for(auto a : as) {
    acs.push_back(a);
  }
  for(auto b : bs) {
    bcs.push_back(b);
  }

  for (ul i = 0; i < bs.size(); ++i) {
    acs.push_back({0,0});
  }
  for (ul i = 0; i < as.size(); ++i) {
    bcs.push_back({0,0});
  }

  pad(acs);
  pad(bcs);

  // autobots_roll_out.gif
  vc ACS = fft(acs);
  vc BCS = fft(bcs);

  vc RES;
  RES.reserve(ACS.size());
  l n = ACS.size();
  for (l i { 0 };  i < n; ++i) {
    RES.push_back(ACS[i] * BCS[i]);
  }

  // Get real
  vc res_c { ifft(RES) };
  vd res {};
  res.reserve(res_c.size());
  for(auto r : res_c) {
    res.push_back(r.real());
  }
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x48(%rsp)
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
sarq $0x3, %rax
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
sarq $0x3, %rsi
addq %rax, %rsi
callq 0x1bc4
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x3, %rax
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
addq %rax, %rsi
leaq 0x30(%rsp), %rdi
callq 0x1bc4
movq (%r14), %rbx
movq 0x8(%r14), %rbp
leaq 0x50(%rsp), %r12
movq %rsp, %r13
cmpq %rbp, %rbx
je 0x1741
movsd (%rbx), %xmm0
movsd %xmm0, (%rsp)
andq $0x0, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1d56
addq $0x8, %rbx
jmp 0x171c
movq (%r15), %rbp
movq 0x8(%r15), %rbx
leaq 0x30(%rsp), %r12
movq %rsp, %r13
cmpq %rbx, %rbp
je 0x1776
movsd (%rbp), %xmm0
movsd %xmm0, (%rsp)
andq $0x0, 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1d56
addq $0x8, %rbp
jmp 0x1750
xorl %ebp, %ebp
leaq 0x50(%rsp), %r12
movq %rsp, %r13
movl %ebp, %eax
movq 0x8(%r15), %rcx
subq (%r15), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jbe 0x17a8
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x1d56
incl %ebp
jmp 0x1780
xorl %ebp, %ebp
leaq 0x30(%rsp), %r15
movq %rsp, %r12
movl %ebp, %eax
movq 0x8(%r14), %rcx
subq (%r14), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jbe 0x17da
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1d56
incl %ebp
jmp 0x17b2
leaq 0x50(%rsp), %rdi
callq 0x129c
leaq 0x30(%rsp), %rdi
callq 0x129c
movq %rsp, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1674
movq 0x48(%rsp), %rbp
leaq 0x90(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1674
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x4, %rsi
callq 0x1bc4
movq 0x8(%rsp), %r12
subq (%rsp), %r12
shrq $0x4, %r12
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
shlq $0x4, %r12
leaq 0x70(%rsp), %r14
leaq 0x18(%rsp), %r15
cmpq %r13, %r12
je 0x1892
movq (%rsp), %rdi
addq %r13, %rdi
movq 0x90(%rsp), %rsi
addq %r13, %rsi
callq 0x1b31
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1d56
addq $0x10, %r13
jmp 0x1859
leaq 0x18(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x1684
xorps %xmm0, %xmm0
movups %xmm0, (%rbp)
andq $0x0, 0x10(%rbp)
movq 0x20(%rsp), %rsi
subq 0x18(%rsp), %rsi
sarq $0x4, %rsi
movq %rbp, %rdi
callq 0x1c6c
movq 0x18(%rsp), %rbx
movq 0x20(%rsp), %r15
leaq 0x68(%rsp), %r14
cmpq %r15, %rbx
je 0x18f2
movsd (%rbx), %xmm0
movsd %xmm0, 0x68(%rsp)
movq %rbp, %rdi
movq %r14, %rsi
callq 0x20fe
addq $0x10, %rbx
jmp 0x18d2
leaq 0x18(%rsp), %rdi
callq 0x1edc
leaq 0x70(%rsp), %rdi
callq 0x1edc
leaq 0x90(%rsp), %rdi
callq 0x1edc
movq %rsp, %rdi
callq 0x1edc
leaq 0x30(%rsp), %rdi
callq 0x1edc
leaq 0x50(%rsp), %rdi
callq 0x1edc
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1953
jmp 0x1977
jmp 0x1977
movq %rax, %r14
jmp 0x1991
jmp 0x1972
jmp 0x1972
movq %rax, %r14
movq 0x48(%rsp), %rdi
callq 0x208e
leaq 0x18(%rsp), %rdi
callq 0x1edc
jmp 0x197a
jmp 0x1972
jmp 0x1972
jmp 0x1972
movq %rax, %r14
jmp 0x1999
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x1edc
leaq 0x90(%rsp), %rdi
callq 0x1edc
movq %rsp, %rdi
callq 0x1edc
leaq 0x30(%rsp), %rdi
callq 0x1edc
leaq 0x50(%rsp), %rdi
callq 0x1edc
movq %r14, %rdi
callq 0x1160