// File: 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:
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x40(%rsp)
movq %rdi, %rax
movq %rax, 0x48(%rsp)
movq %rdi, 0x220(%rsp)
movq %rsi, 0x218(%rsp)
movq %rdx, 0x210(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x1f0(%rsp)
movq $0x0, 0x200(%rsp)
leaq 0x1f0(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x24b0
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x1d0(%rsp)
movq $0x0, 0x1e0(%rsp)
leaq 0x1d0(%rsp), %rdi
callq 0x24b0
movq 0x218(%rsp), %rdi
callq 0x29f0
movq %rax, 0x68(%rsp)
movq 0x210(%rsp), %rdi
callq 0x29f0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdi
addq %rax, %rsi
callq 0x28e0
jmp 0x1bb3
movq 0x218(%rsp), %rdi
callq 0x29f0
movq %rax, 0x38(%rsp)
movq 0x210(%rsp), %rdi
callq 0x29f0
movq 0x38(%rsp), %rsi
addq %rax, %rsi
leaq 0x1d0(%rsp), %rdi
callq 0x28e0
jmp 0x1be9
movq 0x218(%rsp), %rax
movq %rax, 0x1b8(%rsp)
movq 0x1b8(%rsp), %rdi
callq 0x2a10
movq %rax, 0x1b0(%rsp)
movq 0x1b8(%rsp), %rdi
callq 0x2a40
movq %rax, 0x1a8(%rsp)
leaq 0x1b0(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2a70
testb $0x1, %al
jne 0x1c3e
jmp 0x1cb4
leaq 0x1b0(%rsp), %rdi
callq 0x2ab0
movsd (%rax), %xmm0
movsd %xmm0, 0x1a0(%rsp)
movsd 0x1a0(%rsp), %xmm0
leaq 0x190(%rsp), %rdi
xorps %xmm1, %xmm1
callq 0x2480
jmp 0x1c73
leaq 0x1f0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x2450
jmp 0x1c8a
jmp 0x1c8c
leaq 0x1b0(%rsp), %rdi
callq 0x2ac0
jmp 0x1c23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0x218f
movq 0x210(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x188(%rsp), %rdi
callq 0x2a10
movq %rax, 0x180(%rsp)
movq 0x188(%rsp), %rdi
callq 0x2a40
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x2a70
testb $0x1, %al
jne 0x1d09
jmp 0x1d66
leaq 0x180(%rsp), %rdi
callq 0x2ab0
movsd (%rax), %xmm0
movsd %xmm0, 0x170(%rsp)
movsd 0x170(%rsp), %xmm0
leaq 0x160(%rsp), %rdi
xorps %xmm1, %xmm1
callq 0x2480
jmp 0x1d3e
leaq 0x1d0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x2450
jmp 0x1d55
jmp 0x1d57
leaq 0x180(%rsp), %rdi
callq 0x2ac0
jmp 0x1cee
movl $0x0, 0x15c(%rsp)
movl 0x15c(%rsp), %eax
movq %rax, 0x30(%rsp)
movq 0x210(%rsp), %rdi
callq 0x29f0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x1dd8
leaq 0x148(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2480
jmp 0x1dac
leaq 0x1f0(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2450
jmp 0x1dc3
jmp 0x1dc5
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
jmp 0x1d71
movl $0x0, 0x144(%rsp)
movl 0x144(%rsp), %eax
movq %rax, 0x28(%rsp)
movq 0x218(%rsp), %rdi
callq 0x29f0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x1e4a
leaq 0x130(%rsp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2480
jmp 0x1e1e
leaq 0x1d0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x2450
jmp 0x1e35
jmp 0x1e37
movl 0x144(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x144(%rsp)
jmp 0x1de3
leaq 0x1f0(%rsp), %rdi
callq 0x12b0
jmp 0x1e59
leaq 0x1d0(%rsp), %rdi
callq 0x12b0
jmp 0x1e68
leaq 0x118(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x1aa0
jmp 0x1e7f
leaq 0x100(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x1aa0
jmp 0x1e96
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x24b0
leaq 0x118(%rsp), %rdi
callq 0x2430
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x28e0
jmp 0x1ec4
leaq 0x118(%rsp), %rdi
callq 0x2430
movl %eax, 0xe4(%rsp)
movl $0x0, 0xe0(%rsp)
movl 0xe0(%rsp), %eax
cmpl 0xe4(%rsp), %eax
jge 0x1fc0
movslq 0xe0(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x2520
movq %rax, 0x8(%rsp)
movslq 0xe0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x2520
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x2720
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%rsp)
jmp 0x1f41
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movsd %xmm1, 0xd0(%rsp)
movsd %xmm0, 0xd8(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x2450
jmp 0x1f76
jmp 0x1f78
movl 0xe0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xe0(%rsp)
jmp 0x1ee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0x2182
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
jmp 0x2168
leaq 0xb8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x1ad0
jmp 0x1fd7
movq 0x40(%rsp), %rdi
movb $0x0, 0xb7(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x2ae0
leaq 0xb8(%rsp), %rdi
callq 0x2430
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x2af0
jmp 0x2013
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x25a0
movq %rax, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x25d0
movq %rax, 0x98(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x2600
testb $0x1, %al
jne 0x206b
jmp 0x20f1
leaq 0xa0(%rsp), %rdi
callq 0x2640
movups (%rax), %xmm0
movaps %xmm0, 0x80(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x2c30
movsd %xmm0, (%rsp)
jmp 0x2097
movq 0x40(%rsp), %rdi
movsd (%rsp), %xmm0
movsd %xmm0, 0x78(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x2c00
jmp 0x20b3
jmp 0x20b5
leaq 0xa0(%rsp), %rdi
callq 0x2690
jmp 0x204d
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c8(%rsp)
movl %eax, 0x1c4(%rsp)
callq 0x2c40
leaq 0xb8(%rsp), %rdi
callq 0x2540
jmp 0x2168
movb $0x1, 0xb7(%rsp)
testb $0x1, 0xb7(%rsp)
jne 0x210d
movq 0x40(%rsp), %rdi
callq 0x2c40
leaq 0xb8(%rsp), %rdi
callq 0x2540
leaq 0xe8(%rsp), %rdi
callq 0x2540
leaq 0x100(%rsp), %rdi
callq 0x2540
leaq 0x118(%rsp), %rdi
callq 0x2540
leaq 0x1d0(%rsp), %rdi
callq 0x2540
leaq 0x1f0(%rsp), %rdi
callq 0x2540
movq 0x48(%rsp), %rax
addq $0x228, %rsp            # imm = 0x228
retq
leaq 0xe8(%rsp), %rdi
callq 0x2540
leaq 0x100(%rsp), %rdi
callq 0x2540
leaq 0x118(%rsp), %rdi
callq 0x2540
leaq 0x1d0(%rsp), %rdi
callq 0x2540
leaq 0x1f0(%rsp), %rdi
callq 0x2540
movq 0x1c8(%rsp), %rdi
callq 0x1150
nopw %cs:(%rax,%rax)