// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x40(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq %rax, 0x30(%rsp)
movaps %xmm0, 0x20(%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 0x1de6
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x3, %rax
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x3, %rsi
addq %rax, %rsi
leaq 0x20(%rsp), %rdi
callq 0x1de6
movq (%r14), %rbp
movq 0x8(%r14), %r12
cmpq %r12, %rbp
je 0x175c
movq %rsp, %r13
movsd (%rbp), %xmm0
movsd %xmm0, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x1746
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x48(%rsp)
jmp 0x1753
leaq 0x40(%rsp), %rdi
movq %r13, %rdx
callq 0x1f56
addq $0x8, %rbp
cmpq %r12, %rbp
jne 0x1718
movq (%r15), %rbp
movq 0x8(%r15), %r12
cmpq %r12, %rbp
je 0x17af
movq %rsp, %r13
movsd (%rbp), %xmm0
movsd %xmm0, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x1799
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x28(%rsp)
jmp 0x17a6
leaq 0x20(%rsp), %rdi
movq %r13, %rdx
callq 0x1f56
addq $0x8, %rbp
cmpq %r12, %rbp
jne 0x176b
movq 0x8(%r15), %rax
cmpq (%r15), %rax
je 0x1802
movl $0x1, %ebp
leaq 0x40(%rsp), %r12
movq %rsp, %r13
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x48(%rsp), %rsi
cmpq 0x50(%rsp), %rsi
je 0x17e3
movups %xmm0, (%rsi)
addq $0x10, 0x48(%rsp)
jmp 0x17ee
movq %r12, %rdi
movq %r13, %rdx
callq 0x1f56
movq 0x8(%r15), %rax
subq (%r15), %rax
movl %ebp, %ecx
sarq $0x3, %rax
incl %ebp
cmpq %rcx, %rax
ja 0x17c5
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x1855
movl $0x1, %ebp
leaq 0x20(%rsp), %r15
movq %rsp, %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x1836
movups %xmm0, (%rsi)
addq $0x10, 0x28(%rsp)
jmp 0x1841
movq %r15, %rdi
movq %r12, %rdx
callq 0x1f56
movq 0x8(%r14), %rax
subq (%r14), %rax
movl %ebp, %ecx
sarq $0x3, %rax
incl %ebp
cmpq %rcx, %rax
ja 0x1818
leaq 0x40(%rsp), %rdi
callq 0x128c
leaq 0x20(%rsp), %rdi
callq 0x128c
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
xorl %edx, %edx
callq 0x1479
leaq 0xb0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
callq 0x1479
xorps %xmm0, %xmm0
leaq 0x80(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x4, %rsi
callq 0x1de6
movq 0x8(%rsp), %r13
subq (%rsp), %r13
shrq $0x4, %r13
testl %r13d, %r13d
jle 0x1951
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x60(%rsp), %r14
leaq 0x80(%rsp), %r15
leaq 0xa0(%rsp), %r12
movq (%rsp), %rax
movq 0xb0(%rsp), %rsi
addq %rbp, %rsi
movups (%rax,%rbp), %xmm0
movaps %xmm0, 0x60(%rsp)
movq %r14, %rdi
callq 0x1d78
movaps 0x60(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x193d
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x88(%rsp)
jmp 0x1948
movq %r15, %rdi
movq %r12, %rdx
callq 0x1f56
addq $0x10, %rbp
decq %r13
jne 0x18e8
leaq 0x60(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movl $0x1, %edx
callq 0x1479
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq 0x68(%rsp), %rsi
subq 0x60(%rsp), %rsi
sarq $0x4, %rsi
movq %rbx, %rdi
callq 0x1e8e
movq 0x60(%rsp), %r15
movq 0x68(%rsp), %r12
cmpq %r12, %r15
je 0x19dd
leaq 0xa0(%rsp), %r14
movsd (%r15), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x19c9
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x19d4
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2210
addq $0x10, %r15
cmpq %r12, %r15
jne 0x19a3
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x19f4
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1a11
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2e
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1a44
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a5b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a72
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1a9c
jmp 0x1acc
jmp 0x1acc
movq %rax, %r14
jmp 0x1b09
jmp 0x1b27
jmp 0x1b27
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1ab3
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1acf
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
jmp 0x1acf
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1aec
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1b09
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1b2a
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
jmp 0x1b2a
jmp 0x1b27
jmp 0x1b27
jmp 0x1b27
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b41
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1b58
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq %r14, %rdi
callq 0x1130