// File: /workspace/github_cpp_makefile_star2_O3/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 0x1df2
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 0x1df2
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 0x1f68
addq $0x8, %rbp
cmpq %r12, %rbp
jne 0x1718
movq (%r15), %rbp
movq 0x8(%r15), %r12
cmpq %r12, %rbp
je 0x1806
movq %rsp, %r13
movsd (%rbp), %xmm0
movsd %xmm0, (%rsp)
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x179d
movups (%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x28(%rsp)
jmp 0x17aa
leaq 0x20(%rsp), %rdi
movq %r13, %rdx
callq 0x1f68
addq $0x8, %rbp
cmpq %r12, %rbp
jne 0x176f
movq 0x8(%r15), %rax
cmpq (%r15), %rax
je 0x1806
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 0x17e7
movups %xmm0, (%rsi)
addq $0x10, 0x48(%rsp)
jmp 0x17f2
movq %r12, %rdi
movq %r13, %rdx
callq 0x1f68
movq 0x8(%r15), %rax
subq (%r15), %rax
movl %ebp, %ecx
sarq $0x3, %rax
incl %ebp
cmpq %rcx, %rax
ja 0x17c9
movq 0x8(%r14), %rax
cmpq (%r14), %rax
je 0x1859
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 0x183a
movups %xmm0, (%rsi)
addq $0x10, 0x28(%rsp)
jmp 0x1845
movq %r15, %rdi
movq %r12, %rdx
callq 0x1f68
movq 0x8(%r14), %rax
subq (%r14), %rax
movl %ebp, %ecx
sarq $0x3, %rax
incl %ebp
cmpq %rcx, %rax
ja 0x181c
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 0x1df2
movq 0x8(%rsp), %r13
subq (%rsp), %r13
shrq $0x4, %r13
testl %r13d, %r13d
jle 0x1955
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 0x1d84
movaps 0x60(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x1941
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsi)
addq $0x10, 0x88(%rsp)
jmp 0x194c
movq %r15, %rdi
movq %r12, %rdx
callq 0x1f68
addq $0x10, %rbp
decq %r13
jne 0x18ec
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 0x1e9a
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r12
cmpq %r12, %r14
je 0x19e6
leaq 0xa0(%rsp), %r15
movsd (%r14), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x19cd
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x19d8
movq %rbx, %rdi
movq %r15, %rdx
callq 0x223e
addq $0x10, %r14
cmpq %r12, %r14
jne 0x19a7
movq 0x60(%rsp), %r14
testq %r14, %r14
je 0x19fb
movq 0x70(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x10c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1a18
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a35
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1a4b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1a62
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a79
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 0x1aa8
jmp 0x1ad8
jmp 0x1ad8
movq %rax, %r14
jmp 0x1b15
jmp 0x1b31
jmp 0x1b31
jmp 0x1b31
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1abf
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1adb
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
jmp 0x1adb
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1af8
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x1b15
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1b34
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
jmp 0x1b34
jmp 0x1b31
jmp 0x1b31
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b4b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1b62
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x10c0
movq %r14, %rdi
callq 0x1130